TENMGR.H 3.8 KB

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