mirror of
https://github.com/dashr9230/SA-MP.git
synced 2024-12-22 22:47:29 +08:00
[saco] Implement CPlayerPool ctor
This commit is contained in:
parent
125a453d53
commit
c6b1f81352
@ -3,12 +3,14 @@
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
#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;
|
||||
|
@ -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();
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
|
20
saco/net/playerpool.cpp
Normal file
20
saco/net/playerpool.cpp
Normal file
@ -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;
|
||||
}
|
||||
|
||||
//----------------------------------------------------
|
27
saco/net/playerpool.h
Normal file
27
saco/net/playerpool.h
Normal file
@ -0,0 +1,27 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
|
||||
//----------------------------------------------------
|
||||
|
||||
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();
|
||||
};
|
||||
|
||||
//----------------------------------------------------
|
@ -252,6 +252,12 @@
|
||||
<File
|
||||
RelativePath=".\net\netrpc.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\net\playerpool.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\net\playerpool.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\net\scriptrpc.cpp">
|
||||
</File>
|
||||
|
Loading…
Reference in New Issue
Block a user