Fix command .server plimit.
Fix obsolete comment for PlayerLimit in trinitycore.conf.dist Thanks Phil.Pigeon and Johnholiver. Fixes issue #534. Fixes issue #295. --HG-- branch : trunk
This commit is contained in:
+9
-8
@@ -6481,25 +6481,26 @@ bool ChatHandler::HandleServerPLimitCommand(const char *args)
|
||||
int l = strlen(param);
|
||||
|
||||
if (strncmp(param,"player",l) == 0)
|
||||
sWorld.SetPlayerLimit(-SEC_PLAYER);
|
||||
sWorld.SetPlayerSecurityLimit(SEC_PLAYER);
|
||||
else if (strncmp(param,"moderator",l) == 0)
|
||||
sWorld.SetPlayerLimit(-SEC_MODERATOR);
|
||||
sWorld.SetPlayerSecurityLimit(SEC_MODERATOR);
|
||||
else if (strncmp(param,"gamemaster",l) == 0)
|
||||
sWorld.SetPlayerLimit(-SEC_GAMEMASTER);
|
||||
sWorld.SetPlayerSecurityLimit(SEC_GAMEMASTER);
|
||||
else if (strncmp(param,"administrator",l) == 0)
|
||||
sWorld.SetPlayerLimit(-SEC_ADMINISTRATOR);
|
||||
sWorld.SetPlayerSecurityLimit(SEC_ADMINISTRATOR);
|
||||
else if (strncmp(param,"reset",l) == 0)
|
||||
sWorld.SetPlayerLimit(sConfig.GetIntDefault("PlayerLimit", DEFAULT_PLAYER_LIMIT));
|
||||
else
|
||||
{
|
||||
int val = atoi(param);
|
||||
if (val < -SEC_ADMINISTRATOR) val = -SEC_ADMINISTRATOR;
|
||||
|
||||
sWorld.SetPlayerLimit(val);
|
||||
if (val < 0)
|
||||
sWorld.SetPlayerSecurityLimit(AccountTypes(uint32(-val)));
|
||||
else
|
||||
sWorld.SetPlayerLimit(val);
|
||||
}
|
||||
|
||||
// kick all low security level players
|
||||
if (sWorld.GetPlayerAmountLimit() > SEC_PLAYER)
|
||||
if (sWorld.GetPlayerSecurityLimit() > SEC_PLAYER)
|
||||
sWorld.KickAllLess(sWorld.GetPlayerSecurityLimit());
|
||||
}
|
||||
|
||||
|
||||
@@ -511,6 +511,7 @@ class World
|
||||
/// Get the active session server limit (or security level limitations)
|
||||
uint32 GetPlayerAmountLimit() const { return m_playerLimit >= 0 ? m_playerLimit : 0; }
|
||||
AccountTypes GetPlayerSecurityLimit() const { return m_allowedSecurityLevel < 0 ? SEC_PLAYER : m_allowedSecurityLevel; }
|
||||
void SetPlayerSecurityLimit(AccountTypes sec) { m_allowedSecurityLevel = (sec < SEC_PLAYER ? SEC_PLAYER : sec); }
|
||||
|
||||
/// Set the active session server limit (or security level limitation)
|
||||
void SetPlayerLimit(int32 limit, bool needUpdate = false);
|
||||
|
||||
Reference in New Issue
Block a user