TENMGR.H (3887B)
1 // 2 // Copyright 2020 Electronic Arts Inc. 3 // 4 // TiberianDawn.DLL and RedAlert.dll and corresponding source code is free 5 // software: you can redistribute it and/or modify it under the terms of 6 // the GNU General Public License as published by the Free Software Foundation, 7 // either version 3 of the License, or (at your option) any later version. 8 9 // TiberianDawn.DLL and RedAlert.dll and corresponding source code is distributed 10 // in the hope that it will be useful, but with permitted additional restrictions 11 // under Section 7 of the GPL. See the GNU General Public License in LICENSE.TXT 12 // distributed with this program. You should have received a copy of the 13 // GNU General Public License along with permitted additional restrictions 14 // with this program. If not, see https://github.com/electronicarts/CnC_Remastered_Collection 15 16 /*************************************************************************** 17 * * 18 * Project Name : Command & Conquer * 19 * * 20 * File Name : TENMGR.H * 21 * * 22 * Programmer : Bill R. Randolph * 23 * * 24 * Start Date : 06/26/96 * 25 * * 26 * Last Update : June 26, 1996 [BRR] * 27 * * 28 * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ 29 30 class TenConnManClass : public ConnManClass 31 { 32 public: 33 // 34 // Constructor / Destructor 35 // 36 TenConnManClass(void); 37 virtual ~TenConnManClass(); 38 39 // 40 // Initialization 41 // 42 int Init(void); 43 44 // 45 // Service routine 46 // 47 virtual int Service(void); 48 49 // 50 // Sending & receiving data 51 // 52 virtual int Send_Private_Message (void *buf, int buflen, 53 int ack_req = 1, int conn_id = CONNECTION_NONE); 54 virtual int Get_Private_Message (void *buf, int *buflen, 55 int *conn_id); 56 57 int Send_Global_Message(void *buf, int buflen, 58 int ack_req = 0, int address = 0); 59 int Get_Global_Message(void *buf, int *buflen, 60 int *address = 0); 61 62 // 63 // Connection management 64 // 65 virtual int Num_Connections(void); 66 virtual int Connection_ID(int index); 67 virtual int Connection_Index(int id); 68 69 int Create_Connection(int id, char *name, int address); 70 int Delete_Connection(int id); 71 char *Connection_Name(int id); 72 int Connection_Address(int id); 73 74 // 75 // Queue utility routines 76 // 77 virtual int Global_Num_Send(void); 78 virtual int Global_Num_Receive(void); 79 virtual int Private_Num_Send(int id = CONNECTION_NONE); 80 virtual int Private_Num_Receive(int id = CONNECTION_NONE); 81 82 void Flush_All(void); 83 84 // 85 // Timing management 86 // 87 virtual void Reset_Response_Time(void); 88 virtual unsigned long Response_Time(void); 89 virtual void Set_Timing (unsigned long retrydelta, 90 unsigned long maxretries, unsigned long timeout); 91 92 // 93 // Debugging 94 // 95 virtual void Configure_Debug(int index, int type_offset, int type_size, 96 char **names, int namestart, int namecount); 97 virtual void Mono_Debug_Print(int index, int refresh); 98 99 CommBufferClass *GlobalQueue; 100 CommBufferClass *PrivateQueue; 101 102 // 103 // This flag will be set if I'm the game host. 104 // 105 int IsHost; 106 107 private: 108 int Connections[MAX_PLAYERS]; 109 int ID[MAX_PLAYERS]; 110 char Names[MAX_PLAYERS][128]; 111 int NumConnections; 112 113 }; 114 115 /***************************** end of tenmgr.h *****************************/