MPMGRW.H 2.7 KB

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