CnC_Remastered_Collection

Command and Conquer: Red Alert
Log | Files | Refs | README | LICENSE

MPMGRW.H (2755B)


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