TENMGR.H 3.7 KB

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