aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/game/Level3.cpp17
-rw-r--r--src/game/World.h1
-rw-r--r--src/trinitycore/trinitycore.conf.dist5
3 files changed, 12 insertions, 11 deletions
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());
}
diff --git a/src/game/World.h b/src/game/World.h
index ef3e0616956..ff641118ace 100644
--- a/src/game/World.h
+++ b/src/game/World.h
@@ -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);
diff --git a/src/trinitycore/trinitycore.conf.dist b/src/trinitycore/trinitycore.conf.dist
index c6582bb1837..9b1aad966d2 100644
--- a/src/trinitycore/trinitycore.conf.dist
+++ b/src/trinitycore/trinitycore.conf.dist
@@ -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