mirror of
https://github.com/dashr9230/SA-MP.git
synced 2025-01-03 16:13:34 +08:00
[server] Implement ServerMaxPlayersChanged
This commit is contained in:
parent
0896d3b9bb
commit
b8177ad679
@ -139,7 +139,19 @@ void ServerPasswordChanged()
|
||||
|
||||
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 ShutdownForGameModeRestart();
|
||||
|
||||
RakServerInterface * GetRakServer() { return m_pRak; };
|
||||
|
||||
void Process();
|
||||
|
||||
void LoadBanList();
|
||||
|
Loading…
x
Reference in New Issue
Block a user