2023-10-31 21:31:16 +08:00
|
|
|
|
2024-01-15 23:51:39 +08:00
|
|
|
#include "../main.h"
|
|
|
|
|
2024-03-14 23:24:26 +08:00
|
|
|
extern CNetGame *pNetGame;
|
|
|
|
|
2024-01-15 23:51:39 +08:00
|
|
|
//----------------------------------------------------
|
2023-10-31 21:31:16 +08:00
|
|
|
|
|
|
|
CPlayerPool::CPlayerPool()
|
|
|
|
{
|
|
|
|
field_7163 = 0;
|
|
|
|
field_8107 = 0;
|
2024-01-15 23:51:39 +08:00
|
|
|
|
|
|
|
// loop through and initialize all net players to null and slot states to false
|
|
|
|
for(PLAYERID playerId = 0; playerId < MAX_PLAYERS; playerId++) {
|
2024-03-14 23:24:26 +08:00
|
|
|
m_bPlayerSlotState[playerId] = FALSE;
|
2024-01-15 23:51:39 +08:00
|
|
|
field_7167[playerId] = 0;
|
|
|
|
field_810B[playerId] = 0;
|
2023-10-31 21:31:16 +08:00
|
|
|
}
|
|
|
|
}
|
2024-01-15 23:51:39 +08:00
|
|
|
|
|
|
|
//----------------------------------------------------
|
2024-03-14 23:24:26 +08:00
|
|
|
|
|
|
|
CPlayerPool::~CPlayerPool()
|
|
|
|
{
|
|
|
|
for(PLAYERID playerId = 0; playerId < MAX_PLAYERS; playerId++) {
|
|
|
|
Delete(playerId,0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//----------------------------------------------------
|
|
|
|
|
2024-06-08 21:39:40 +08:00
|
|
|
BOOL CPlayerPool::New(PLAYERID playerId, PCHAR szPlayerName)
|
|
|
|
{
|
|
|
|
m_bPlayerSlotState[playerId] = TRUE;
|
|
|
|
strcpy(m_szPlayerNames[playerId], szPlayerName);
|
|
|
|
pNetGame->SetPlayerAdded(playerId, FALSE);
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
//----------------------------------------------------
|
|
|
|
|
2024-03-14 23:24:26 +08:00
|
|
|
BOOL CPlayerPool::Delete(PLAYERID playerId, BYTE byteReason)
|
|
|
|
{
|
|
|
|
m_bPlayerSlotState[playerId] = FALSE;
|
2024-06-03 22:58:59 +08:00
|
|
|
pNetGame->SetPlayerAdded(playerId, FALSE);
|
2024-03-14 23:24:26 +08:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
//----------------------------------------------------
|
2024-06-01 18:30:44 +08:00
|
|
|
|
|
|
|
BOOL CPlayerPool::Process()
|
|
|
|
{
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
//----------------------------------------------------
|