2024-06-24 15:46:58 -04:00
|
|
|
#include "dplay.h"
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
int nbSessions;
|
|
|
|
DPSESSIONDESC sessions[100];
|
|
|
|
}
|
|
|
|
NetSessionList;
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
byte bIsPresent;
|
|
|
|
byte ready;
|
|
|
|
byte unk_2;
|
|
|
|
byte unk_3;
|
|
|
|
byte ip[4];
|
|
|
|
short team;
|
|
|
|
char name[22];
|
|
|
|
}
|
|
|
|
NetPlayer;
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
byte type;
|
|
|
|
byte a;
|
|
|
|
short x;
|
|
|
|
short y;
|
|
|
|
short channel;
|
|
|
|
}
|
|
|
|
NetEvent;
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
byte type;
|
|
|
|
int packetsSent;
|
|
|
|
short x;
|
|
|
|
short y;
|
|
|
|
NetEvent event[5];
|
|
|
|
};
|
|
|
|
|
2024-05-30 21:58:09 -04:00
|
|
|
class CNetwork
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CNetwork();
|
|
|
|
~CNetwork();
|
|
|
|
|
|
|
|
BOOL Create();
|
2024-07-02 11:52:36 -04:00
|
|
|
BOOL IsSessionFree();
|
|
|
|
void FreeCurrentSession();
|
2024-06-01 20:56:16 -04:00
|
|
|
void FreeSessionList();
|
2024-06-18 17:20:37 -04:00
|
|
|
void FreeSessionList2();
|
2024-06-24 15:46:58 -04:00
|
|
|
void FreeField18();
|
|
|
|
BOOL EnumerateCallback(LPGUID lpguidSP, LPSTR lpSTName, DWORD dwMajorVersion, DWORD dwMinorVersion, NetSessionList* lpContext);
|
2024-06-01 20:56:16 -04:00
|
|
|
|
2024-05-30 21:58:09 -04:00
|
|
|
protected:
|
2024-07-02 11:52:36 -04:00
|
|
|
IDirectPlay m_pDP;
|
2024-06-18 12:05:45 -04:00
|
|
|
LPVOID m_pContext;
|
2024-07-02 11:52:36 -04:00
|
|
|
LPVOID m_pUnk4;
|
|
|
|
DPSESSIONDESC m_pCurrentSession;
|
2024-06-18 12:05:45 -04:00
|
|
|
LPVOID m_pUnkC;
|
|
|
|
addr m_pUnk18;
|
|
|
|
NetSessionList m_pSessions;
|
|
|
|
BOOL m_pUnk1C;
|
|
|
|
DPID m_pDPID;
|
2024-05-30 21:58:09 -04:00
|
|
|
NetPlayer m_players[4];
|
|
|
|
};
|