2023-10-22 17:08:53 +08:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2024-05-17 22:48:32 +08:00
|
|
|
#define GAMESTATE_NONE 0 // used for debugging modes and such
|
2024-04-25 22:10:37 +08:00
|
|
|
#define GAMESTATE_CONNECTING 1
|
2024-01-29 19:34:27 +08:00
|
|
|
#define GAMESTATE_CONNECTED 2
|
2024-05-17 22:48:32 +08:00
|
|
|
#define GAMESTATE_AWAIT_JOIN 3
|
2024-01-29 19:34:27 +08:00
|
|
|
|
2024-06-01 18:30:44 +08:00
|
|
|
#define GAMESTATE_RESTARTING 5
|
|
|
|
|
2023-10-22 17:08:53 +08:00
|
|
|
//----------------------------------------------------
|
|
|
|
|
|
|
|
class CNetGame // size: 910 bytes
|
|
|
|
{
|
|
|
|
private:
|
2024-01-15 23:53:36 +08:00
|
|
|
RakClientInterface *m_pRakClient;
|
|
|
|
CPlayerPool *m_pPlayerPool;
|
2024-04-25 22:10:37 +08:00
|
|
|
CVehiclePool *m_pVehiclePool;
|
|
|
|
int m_iGameState;
|
|
|
|
BOOL m_bLanMode;
|
2024-01-15 23:53:36 +08:00
|
|
|
|
2024-04-25 22:14:30 +08:00
|
|
|
void UpdateNetwork();
|
|
|
|
|
|
|
|
// Packet handlers
|
2024-04-25 22:19:11 +08:00
|
|
|
void Packet_AimSync(Packet *p);
|
2024-04-25 22:33:18 +08:00
|
|
|
void Packet_PassengerSync(Packet *p);
|
2024-05-17 22:48:32 +08:00
|
|
|
void Packet_ConnectionSucceeded(Packet *p);
|
2024-05-10 22:20:05 +08:00
|
|
|
void Packet_ConnectionBanned(Packet* packet);
|
2024-05-10 22:20:46 +08:00
|
|
|
void Packet_DisconnectionNotification(Packet* packet);
|
2024-04-25 22:14:30 +08:00
|
|
|
void Packet_ModifiedPacket(Packet* packet);
|
2024-04-25 22:20:29 +08:00
|
|
|
void Packet_TrailerSync(Packet *p);
|
2024-04-25 22:14:30 +08:00
|
|
|
|
2024-04-25 22:10:37 +08:00
|
|
|
int m_iSpawnsAvailable;
|
2023-10-22 17:08:53 +08:00
|
|
|
char _gap18[6];
|
2024-04-25 22:10:37 +08:00
|
|
|
BYTE m_byteWorldTime;
|
|
|
|
BYTE m_byteWorldMinute;
|
|
|
|
BYTE m_byteWeather;
|
2023-10-22 17:08:53 +08:00
|
|
|
char _gap21[16];
|
2024-04-25 22:10:37 +08:00
|
|
|
BYTE m_byteFriendlyFire;
|
2023-10-22 17:08:53 +08:00
|
|
|
char _gap32[2];
|
2024-04-25 22:10:37 +08:00
|
|
|
float m_fGravity;
|
|
|
|
int m_iDeathDropMoney;
|
|
|
|
BYTE m_byteHoldTime;
|
|
|
|
bool m_bInstagib;
|
|
|
|
bool m_bZoneNames;
|
2023-10-22 17:08:53 +08:00
|
|
|
char _gap3F;
|
2024-04-25 22:10:37 +08:00
|
|
|
bool m_bUseCJWalk;
|
2023-10-22 17:08:53 +08:00
|
|
|
char _gap41[9];
|
2024-04-25 22:10:37 +08:00
|
|
|
DWORD m_dwMapIcon[100];
|
2024-06-01 18:30:44 +08:00
|
|
|
int field_1DA;
|
2023-10-22 17:08:53 +08:00
|
|
|
int field_1DE;
|
|
|
|
int field_1E2;
|
|
|
|
char _gap1E6[12];
|
|
|
|
int field_1F2;
|
|
|
|
char _gap1F6[4];
|
|
|
|
int field_1FA;
|
|
|
|
int field_1FE;
|
2023-11-18 00:00:52 +08:00
|
|
|
|
|
|
|
char m_szHostName[256];
|
|
|
|
char m_szHostOrIp[128];
|
|
|
|
int m_iPort;
|
|
|
|
|
2024-01-19 23:19:26 +08:00
|
|
|
CGameMode* m_pGameMode;
|
2023-11-18 00:00:52 +08:00
|
|
|
CScriptTimers* m_pScriptTimers;
|
2023-10-22 17:08:53 +08:00
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
CNetGame();
|
|
|
|
~CNetGame();
|
|
|
|
|
2024-01-29 19:34:27 +08:00
|
|
|
int GetGameState() { return m_iGameState; };
|
|
|
|
|
|
|
|
RakClientInterface * GetRakClient() { return m_pRakClient; };
|
|
|
|
|
2023-11-18 00:00:52 +08:00
|
|
|
void Init(PCHAR szHostOrIp,int iPort,PCHAR szPlayerName,PCHAR szPass,PCHAR szNpcMode);
|
2023-10-22 17:08:53 +08:00
|
|
|
void Process();
|
2024-06-01 18:30:44 +08:00
|
|
|
void ResetVehiclePool();
|
|
|
|
void ShutdownForGameModeRestart();
|
2023-10-22 17:08:53 +08:00
|
|
|
|
2024-03-14 23:24:26 +08:00
|
|
|
void sub_415EA0(PLAYERID playerId, BOOL a2);
|
|
|
|
void sub_415EC0(VEHICLEID VehicleID, BOOL a2);
|
2024-06-01 18:30:44 +08:00
|
|
|
|
|
|
|
void StopRecordingPlayback();
|
2023-10-22 17:08:53 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
//----------------------------------------------------
|