diff --git a/saco/game/common.h b/saco/game/common.h index a018fcc..450893a 100644 --- a/saco/game/common.h +++ b/saco/game/common.h @@ -3,12 +3,14 @@ #include +#define MAX_PLAYERS 1004 #define MAX_VEHICLES 2000 #define PLAYER_PED_SLOTS 210 //----------------------------------------------------------- typedef unsigned short VEHICLEID; +typedef unsigned short PLAYERID; typedef struct _VECTOR { float X,Y,Z; diff --git a/saco/net/netgame.cpp b/saco/net/netgame.cpp index 3d2409d..d2d7ce4 100644 --- a/saco/net/netgame.cpp +++ b/saco/net/netgame.cpp @@ -33,6 +33,7 @@ void CNetGame::InitPools() { m_pPools = (NETGAME_POOLS *)calloc(1, sizeof(NETGAME_POOLS)); + m_pPools->pPlayerPool = new CPlayerPool(); m_pPools->pVehiclePool = new CVehiclePool(); } diff --git a/saco/net/netgame.h b/saco/net/netgame.h index 068f416..4e22f7b 100644 --- a/saco/net/netgame.h +++ b/saco/net/netgame.h @@ -27,7 +27,8 @@ struct struc_41 typedef struct _NETGAME_POOLS { CVehiclePool *pVehiclePool; - char _gap0[32]; + CPlayerPool *pPlayerPool; + char _gap0[28]; } NETGAME_POOLS; class CNetGame // size: 994 diff --git a/saco/net/playerpool.cpp b/saco/net/playerpool.cpp new file mode 100644 index 0000000..53196d8 --- /dev/null +++ b/saco/net/playerpool.cpp @@ -0,0 +1,20 @@ + +#include "../main.h" + +//---------------------------------------------------- + +CPlayerPool::CPlayerPool() +{ + // loop through and initialize all net players to null and slot states to false + for(PLAYERID playerId = 0; playerId < MAX_PLAYERS; playerId++) { + field_1F8A[playerId] = 0; + field_2A[playerId] = 0; + } + //field_26 = new sub_10004C50(); // TODO: sub_10004C50() + field_0 = 0; + field_22 = 0; + field_4 = 0; + field_2F3A = 0; +} + +//---------------------------------------------------- diff --git a/saco/net/playerpool.h b/saco/net/playerpool.h new file mode 100644 index 0000000..1a0b4b4 --- /dev/null +++ b/saco/net/playerpool.h @@ -0,0 +1,27 @@ + +#pragma once + +#include + +//---------------------------------------------------- + +class CPlayerPool +{ +private: + int field_0; + short field_4; + std::string field_6; + int field_22; + int field_26; + int field_2A[MAX_PLAYERS]; + + char _gapFDA[4016]; + + int field_1F8A[MAX_PLAYERS]; + int field_2F3A; + +public: + CPlayerPool(); +}; + +//---------------------------------------------------- diff --git a/saco/saco.vcproj b/saco/saco.vcproj index 1331c79..ace1702 100644 --- a/saco/saco.vcproj +++ b/saco/saco.vcproj @@ -252,6 +252,12 @@ + + + +