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:
+8
-7
@@ -6481,25 +6481,26 @@ bool ChatHandler::HandleServerPLimitCommand(const char *args)
|
|||||||
int l = strlen(param);
|
int l = strlen(param);
|
||||||
|
|
||||||
if (strncmp(param,"player",l) == 0)
|
if (strncmp(param,"player",l) == 0)
|
||||||
sWorld.SetPlayerLimit(-SEC_PLAYER);
|
sWorld.SetPlayerSecurityLimit(SEC_PLAYER);
|
||||||
else if (strncmp(param,"moderator",l) == 0)
|
else if (strncmp(param,"moderator",l) == 0)
|
||||||
sWorld.SetPlayerLimit(-SEC_MODERATOR);
|
sWorld.SetPlayerSecurityLimit(SEC_MODERATOR);
|
||||||
else if (strncmp(param,"gamemaster",l) == 0)
|
else if (strncmp(param,"gamemaster",l) == 0)
|
||||||
sWorld.SetPlayerLimit(-SEC_GAMEMASTER);
|
sWorld.SetPlayerSecurityLimit(SEC_GAMEMASTER);
|
||||||
else if (strncmp(param,"administrator",l) == 0)
|
else if (strncmp(param,"administrator",l) == 0)
|
||||||
sWorld.SetPlayerLimit(-SEC_ADMINISTRATOR);
|
sWorld.SetPlayerSecurityLimit(SEC_ADMINISTRATOR);
|
||||||
else if (strncmp(param,"reset",l) == 0)
|
else if (strncmp(param,"reset",l) == 0)
|
||||||
sWorld.SetPlayerLimit(sConfig.GetIntDefault("PlayerLimit", DEFAULT_PLAYER_LIMIT));
|
sWorld.SetPlayerLimit(sConfig.GetIntDefault("PlayerLimit", DEFAULT_PLAYER_LIMIT));
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
int val = atoi(param);
|
int val = atoi(param);
|
||||||
if (val < -SEC_ADMINISTRATOR) val = -SEC_ADMINISTRATOR;
|
if (val < 0)
|
||||||
|
sWorld.SetPlayerSecurityLimit(AccountTypes(uint32(-val)));
|
||||||
|
else
|
||||||
sWorld.SetPlayerLimit(val);
|
sWorld.SetPlayerLimit(val);
|
||||||
}
|
}
|
||||||
|
|
||||||
// kick all low security level players
|
// kick all low security level players
|
||||||
if (sWorld.GetPlayerAmountLimit() > SEC_PLAYER)
|
if (sWorld.GetPlayerSecurityLimit() > SEC_PLAYER)
|
||||||
sWorld.KickAllLess(sWorld.GetPlayerSecurityLimit());
|
sWorld.KickAllLess(sWorld.GetPlayerSecurityLimit());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -511,6 +511,7 @@ class World
|
|||||||
/// Get the active session server limit (or security level limitations)
|
/// Get the active session server limit (or security level limitations)
|
||||||
uint32 GetPlayerAmountLimit() const { return m_playerLimit >= 0 ? m_playerLimit : 0; }
|
uint32 GetPlayerAmountLimit() const { return m_playerLimit >= 0 ? m_playerLimit : 0; }
|
||||||
AccountTypes GetPlayerSecurityLimit() const { return m_allowedSecurityLevel < 0 ? SEC_PLAYER : m_allowedSecurityLevel; }
|
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)
|
/// Set the active session server limit (or security level limitation)
|
||||||
void SetPlayerLimit(int32 limit, bool needUpdate = false);
|
void SetPlayerLimit(int32 limit, bool needUpdate = false);
|
||||||
|
|||||||
@@ -99,9 +99,8 @@ EAIErrorLevel = 2
|
|||||||
# Maximum number of players in the world. Excluding Mods, GMs and Admins
|
# Maximum number of players in the world. Excluding Mods, GMs and Admins
|
||||||
# Default: 100
|
# Default: 100
|
||||||
# 0 (for infinite players)
|
# 0 (for infinite players)
|
||||||
# -1 (for Mods, GM's and Admins only)
|
# If you want to block players and enable Mods, GMs or Admins use
|
||||||
# -2 (for GM's and Admins only)
|
# DB field realmd.realmlist.allowedSecurityLevel
|
||||||
# -3 (for Admins only)
|
|
||||||
#
|
#
|
||||||
# SaveRespawnTimeImmediately
|
# SaveRespawnTimeImmediately
|
||||||
# Save respawn time for creatures at death and gameobjects at use/open
|
# Save respawn time for creatures at death and gameobjects at use/open
|
||||||
|
|||||||
Reference in New Issue
Block a user