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:
Trazom62
2010-05-02 16:48:18 +02:00
parent e0cce6984c
commit 0a4d79ef39
3 changed files with 12 additions and 11 deletions
+9 -8
View File
@@ -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());
}
+1
View File
@@ -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);
+2 -3
View File
@@ -99,9 +99,8 @@ EAIErrorLevel = 2
# Maximum number of players in the world. Excluding Mods, GMs and Admins
# Default: 100
# 0 (for infinite players)
# -1 (for Mods, GM's and Admins only)
# -2 (for GM's and Admins only)
# -3 (for Admins only)
# If you want to block players and enable Mods, GMs or Admins use
# DB field realmd.realmlist.allowedSecurityLevel
#
# SaveRespawnTimeImmediately
# Save respawn time for creatures at death and gameobjects at use/open