From 0a4d79ef390460b17e95bbc6e8de9ad34114e713 Mon Sep 17 00:00:00 2001 From: Trazom62 Date: Sun, 2 May 2010 16:48:18 +0200 Subject: 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 --- src/game/Level3.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'src/game/Level3.cpp') diff --git a/src/game/Level3.cpp b/src/game/Level3.cpp index d5b496082c6..0a3f9c3f779 100644 --- a/src/game/Level3.cpp +++ b/src/game/Level3.cpp @@ -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()); } -- cgit v1.2.3