aboutsummaryrefslogtreecommitdiff
path: root/src/game/World.cpp
diff options
context:
space:
mode:
authormegamage <none@none>2009-07-10 08:25:33 +0800
committermegamage <none@none>2009-07-10 08:25:33 +0800
commit6976043e228b35687125e66f19933c44ebc561ba (patch)
tree4c8a8372c34bf276854c0c38e39bbe3b2c6d36b5 /src/game/World.cpp
parent474af870d71a46c02b28a713c19080af6e2f5781 (diff)
[8126] Improvemets in player/pet/charter name checks. Author: VladimirMangos
* Implement new config options for minimal player/pet/charter name length (2 by default) * Better error reporting at problems in names. * Add check from max pet/charter name length (same as for player names at client side) --HG-- branch : trunk
Diffstat (limited to 'src/game/World.cpp')
-rw-r--r--src/game/World.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/game/World.cpp b/src/game/World.cpp
index bd85fe30baa..2fa90e6c148 100644
--- a/src/game/World.cpp
+++ b/src/game/World.cpp
@@ -639,6 +639,27 @@ void World::LoadConfigSettings(bool reload)
m_configs[CONFIG_STRICT_CHARTER_NAMES] = sConfig.GetIntDefault ("StrictCharterNames", 0);
m_configs[CONFIG_STRICT_PET_NAMES] = sConfig.GetIntDefault ("StrictPetNames", 0);
+ m_configs[CONFIG_MIN_PLAYER_NAME] = sConfig.GetIntDefault ("MinPlayerName", 2);
+ if(m_configs[CONFIG_MIN_PLAYER_NAME] < 1 || m_configs[CONFIG_MIN_PLAYER_NAME] > MAX_PLAYER_NAME)
+ {
+ sLog.outError("MinPlayerName (%i) must be in range 1..%u. Set to 2.",m_configs[CONFIG_MIN_PLAYER_NAME],MAX_PLAYER_NAME);
+ m_configs[CONFIG_MIN_PLAYER_NAME] = 2;
+ }
+
+ m_configs[CONFIG_MIN_CHARTER_NAME] = sConfig.GetIntDefault ("MinCharterName", 2);
+ if(m_configs[CONFIG_MIN_CHARTER_NAME] < 1 || m_configs[CONFIG_MIN_CHARTER_NAME] > MAX_CHARTER_NAME)
+ {
+ sLog.outError("MinCharterName (%i) must be in range 1..%u. Set to 2.",m_configs[CONFIG_MIN_CHARTER_NAME],MAX_CHARTER_NAME);
+ m_configs[CONFIG_MIN_CHARTER_NAME] = 2;
+ }
+
+ m_configs[CONFIG_MIN_PET_NAME] = sConfig.GetIntDefault ("MinPetName", 2);
+ if(m_configs[CONFIG_MIN_PET_NAME] < 1 || m_configs[CONFIG_MIN_PET_NAME] > MAX_PET_NAME)
+ {
+ sLog.outError("MinPetName (%i) must be in range 1..%u. Set to 2.",m_configs[CONFIG_MIN_PET_NAME],MAX_PET_NAME);
+ m_configs[CONFIG_MIN_PET_NAME] = 2;
+ }
+
m_configs[CONFIG_CHARACTERS_CREATING_DISABLED] = sConfig.GetIntDefault ("CharactersCreatingDisabled", 0);
m_configs[CONFIG_CHARACTERS_PER_REALM] = sConfig.GetIntDefault("CharactersPerRealm", 10);