| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154 |
- /*
- ** Command & Conquer Red Alert(tm)
- ** Copyright 2025 Electronic Arts Inc.
- **
- ** This program is free software: you can redistribute it and/or modify
- ** it under the terms of the GNU General Public License as published by
- ** the Free Software Foundation, either version 3 of the License, or
- ** (at your option) any later version.
- **
- ** This program is distributed in the hope that it will be useful,
- ** but WITHOUT ANY WARRANTY; without even the implied warranty of
- ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- ** GNU General Public License for more details.
- **
- ** You should have received a copy of the GNU General Public License
- ** along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
- /* $Header: /CounterStrike/CONNMGR.H 1 3/03/97 10:24a Joe_bostic $ */
- /***************************************************************************
- ** C O N F I D E N T I A L --- W E S T W O O D S T U D I O S **
- ***************************************************************************
- * *
- * Project Name : Command & Conquer *
- * *
- * File Name : CONNMGR.H *
- * *
- * Programmer : Bill Randolph *
- * *
- * Start Date : December 19, 1994 *
- * *
- * Last Update : April 3, 1995 [BR] *
- * *
- *-------------------------------------------------------------------------*
- * *
- * This is the Connection Manager base class. This is an abstract base *
- * class that's just a shell for more functional derived classes. *
- * The main job of the Connection Manager classes is to parse a "pool" of *
- * incoming packets, which may be from different computers, and distribute *
- * those packets to Connection Classes via their Receive_Packet function. *
- * *
- * This class should be the only access to the network/modem for the *
- * application, so if the app needs any functions to access the *
- * connections or the queue's, the derived versions of this class should *
- * provide them. *
- * *
- * It's up to the derived class to define: *
- * - Service: polling routine; should Service each connection *
- * - Init: initialization; should perform hardware-dependent *
- * initialization, then Init each connection; this function *
- * isn't defined in this class, since the parameters will *
- * be highly protocol-dependent) *
- * - Send_Message:sends a packet across the connection (this function *
- * isn't defined in this class, since the parameters will *
- * be highly protocol-dependent) *
- * - Get_Message: gets a message from the connection (this function *
- * isn't defined in this class, since the parameters will *
- * be highly protocol-dependent) *
- * *
- * If the derived class supports multiple connections, it should provide *
- * functions for creating the connections, associating them with a name *
- * or ID or both, destroying them, and sending data through all or any *
- * connection. *
- * *
- * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
- #ifndef CONNMGR_H
- #define CONNMGR_H
- /*
- ***************************** Class Declaration *****************************
- */
- class ConnManClass
- {
- /*
- ---------------------------- Public Interface ----------------------------
- */
- public:
- /*.....................................................................
- Various useful enums:
- .....................................................................*/
- enum IPXConnTag {
- CONNECTION_NONE = -1 // value of an invalid connection ID
- };
- /*.....................................................................
- Constructor/Destructor. These currently do nothing.
- .....................................................................*/
- ConnManClass (void) {};
- virtual ~ConnManClass () {};
- /*.....................................................................
- The Service routine:
- - Parses incoming packets, and adds them to the Receive Queue for the
- Connection Class(s) for this protocol
- - Invokes each connection's Service routine; returns an error if the
- connection's Service routine indicates an error.
- .....................................................................*/
- virtual int Service (void) = 0;
- /*.....................................................................
- Sending & receiving data
- .....................................................................*/
- virtual int Send_Private_Message (void *buf, int buflen,
- int ack_req = 1, int conn_id = CONNECTION_NONE) = 0;
- virtual int Get_Private_Message (void *buf, int *buflen,
- int *conn_id) = 0;
- /*.....................................................................
- Connection management
- .....................................................................*/
- virtual int Num_Connections(void) = 0;
- virtual int Connection_ID(int index) = 0;
- virtual int Connection_Index(int id) = 0;
- /*.....................................................................
- Queue utility routines
- .....................................................................*/
- virtual int Global_Num_Send(void) = 0;
- virtual int Global_Num_Receive(void) = 0;
- virtual int Private_Num_Send(int id = CONNECTION_NONE) = 0;
- virtual int Private_Num_Receive(int id = CONNECTION_NONE) = 0;
- /*.....................................................................
- Timing management
- .....................................................................*/
- virtual void Reset_Response_Time(void) = 0;
- virtual unsigned long Response_Time(void) = 0;
- virtual void Set_Timing (unsigned long retrydelta,
- unsigned long maxretries, unsigned long timeout) = 0;
- /*.....................................................................
- Debugging
- .....................................................................*/
- virtual void Configure_Debug(int index, int type_offset, int type_size,
- char **names, int namestart, int namecount) = 0;
- #ifdef CHEAT_KEYS
- virtual void Mono_Debug_Print(int index, int refresh) = 0;
- #endif
- /*
- --------------------------- Private Interface ----------------------------
- */
- private:
- /*.....................................................................
- This abstract class contains no data members; but a derived class
- will contain:
- - An instance of one or more derived Connection Classes
- - A buffer to store incoming packets
- .....................................................................*/
- };
- #endif
|