SA-MP/bot/net/playerpool.cpp

57 lines
1.2 KiB
C++
Raw Normal View History

2023-10-31 21:31:16 +08:00
2024-01-15 23:51:39 +08:00
#include "../main.h"
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++) {
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
//----------------------------------------------------
CPlayerPool::~CPlayerPool()
{
for(PLAYERID playerId = 0; playerId < MAX_PLAYERS; playerId++) {
Delete(playerId,0);
}
}
//----------------------------------------------------
BOOL CPlayerPool::New(PLAYERID playerId, PCHAR szPlayerName)
{
m_bPlayerSlotState[playerId] = TRUE;
strcpy(m_szPlayerNames[playerId], szPlayerName);
pNetGame->SetPlayerAdded(playerId, FALSE);
return TRUE;
}
//----------------------------------------------------
BOOL CPlayerPool::Delete(PLAYERID playerId, BYTE byteReason)
{
m_bPlayerSlotState[playerId] = FALSE;
pNetGame->SetPlayerAdded(playerId, FALSE);
return TRUE;
}
//----------------------------------------------------
BOOL CPlayerPool::Process()
{
return TRUE;
}
//----------------------------------------------------