mirror of
https://github.com/dashr9230/SA-MP.git
synced 2025-09-20 04:36:01 +08:00
[server] Implement ServerMaxPlayersChanged
This commit is contained in:
@ -139,7 +139,19 @@ void ServerPasswordChanged()
|
|||||||
|
|
||||||
void ServerMaxPlayersChanged()
|
void ServerMaxPlayersChanged()
|
||||||
{
|
{
|
||||||
// TODO: ServerMaxPlayersChanged
|
int maxplayers = pConsole->GetIntVariable("maxplayers");
|
||||||
|
if (maxplayers < 0)
|
||||||
|
pConsole->SetIntVariable("maxplayers", 0);
|
||||||
|
if (maxplayers > MAX_PLAYERS)
|
||||||
|
pConsole->SetIntVariable("maxplayers", MAX_PLAYERS);
|
||||||
|
|
||||||
|
if (pNetGame)
|
||||||
|
{
|
||||||
|
if (pConsole->GetIntVariable("maxplayers") > MAX_PLAYERS) {
|
||||||
|
pConsole->SetIntVariable("maxplayers", MAX_PLAYERS);
|
||||||
|
}
|
||||||
|
pNetGame->GetRakServer()->SetAllowedPlayers((WORD)pConsole->GetIntVariable("maxplayers"));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------
|
//----------------------------------------------------
|
||||||
|
@ -60,6 +60,9 @@ public:
|
|||||||
|
|
||||||
void Init(BOOL bFirst);
|
void Init(BOOL bFirst);
|
||||||
void ShutdownForGameModeRestart();
|
void ShutdownForGameModeRestart();
|
||||||
|
|
||||||
|
RakServerInterface * GetRakServer() { return m_pRak; };
|
||||||
|
|
||||||
void Process();
|
void Process();
|
||||||
|
|
||||||
void LoadBanList();
|
void LoadBanList();
|
||||||
|
Reference in New Issue
Block a user