Core: Update Player Limit and Player Security Level variables

- Allowed Security Level will be set at server load or with 'server plimit reset' command (before it was read each time someone tried to join)
- If Security Level is updated to a more restrictive value all people under that level will be autokicked

--HG--
branch : trunk
This commit is contained in:
Spp
2010-08-24 19:09:41 +02:00
parent 119e057810
commit 89d87339d5
4 changed files with 28 additions and 27 deletions
+5 -6
View File
@@ -6228,19 +6228,18 @@ bool ChatHandler::HandleServerPLimitCommand(const char *args)
else if (strncmp(param,"administrator",l) == 0)
sWorld.SetPlayerSecurityLimit(SEC_ADMINISTRATOR);
else if (strncmp(param,"reset",l) == 0)
sWorld.SetPlayerLimit(sConfig.GetIntDefault("PlayerLimit", 100));
{
sWorld.SetPlayerAmountLimit(sConfig.GetIntDefault("PlayerLimit", 100));
sWorld.LoadDBAllowedSecurityLevel();
}
else
{
int val = atoi(param);
if (val < 0)
sWorld.SetPlayerSecurityLimit(AccountTypes(uint32(-val)));
else
sWorld.SetPlayerLimit(val);
sWorld.SetPlayerAmountLimit(uint32(val));
}
// kick all low security level players
if (sWorld.GetPlayerSecurityLimit() > SEC_PLAYER)
sWorld.KickAllLess(sWorld.GetPlayerSecurityLimit());
}
uint32 pLimit = sWorld.GetPlayerAmountLimit();