MPMGRW.H 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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. #ifndef mpmgr_h
  19. #define mpmgr_h
  20. #include "connmgr.h"
  21. #include "mplayer.h"
  22. #include <windows.h>
  23. // maximum number of connections
  24. #define CONNECT_MAX 7
  25. #define MAX_NAME_LEN 128
  26. class MPlayerManClass : public ConnManClass {
  27. public:
  28. MPlayerManClass(void);
  29. ~MPlayerManClass(void);
  30. // queues up incoming packets appropriately
  31. int Service(void);
  32. // initialization
  33. int Init(void);
  34. int Find_Num_Connections(void);
  35. void Flush_All(void);
  36. // send/receive data
  37. int Send_Private_Message(void *buf, int buflen, int ack_req = 1, int conn_id = CONNECTION_NONE);
  38. int Get_Private_Message(void *buf, int *buflen, int *conn_id);
  39. int Send_Global_Message(void *buf, int buflen, int ack_req = 0, int address = 0);
  40. int Get_Global_Message(void *buf, int *buflen, int *address = 0);
  41. // manage connections
  42. int Num_Connections(void);
  43. int Connection_ID(int index);
  44. int Connection_Index(int id);
  45. int Create_Connection(int id, char *name, int address);
  46. int Delete_Connection(int id);
  47. char *Connection_Name(int id);
  48. int Connection_Address(int id);
  49. // queueing routines
  50. int Global_Num_Send(void);
  51. int Global_Num_Receive(void);
  52. int Private_Num_Send(int id = CONNECTION_NONE);
  53. int Private_Num_Receive(int id = CONNECTION_NONE);
  54. // timing magnagement
  55. void Reset_Response_Time(void);
  56. unsigned long Response_Time(void);
  57. void Set_Timing(unsigned long retrydelta, unsigned long maxretries, unsigned long timeout);
  58. // debug
  59. void Configure_Debug(int index, int type_offset, int type_size, char **names, int namestart,
  60. int namecount);
  61. void Mono_Debug_Print(int index, int refresh);
  62. private:
  63. //HGULP _gulp;
  64. //HGULP _pgulp;
  65. //GAMEDEF _gameDef;
  66. //int _myAddr;
  67. //int _Connections[CONNECT_MAX];
  68. //int _ID[CONNECT_MAX];
  69. //char _Names[CONNECT_MAX][MAX_NAME_LEN];
  70. //int _nConnections;
  71. };
  72. #endif // mpmgr_h