diff options
author | megamage <none@none> | 2009-07-10 08:25:33 +0800 |
---|---|---|
committer | megamage <none@none> | 2009-07-10 08:25:33 +0800 |
commit | 6976043e228b35687125e66f19933c44ebc561ba (patch) | |
tree | 4c8a8372c34bf276854c0c38e39bbe3b2c6d36b5 /src/game/Level3.cpp | |
parent | 474af870d71a46c02b28a713c19080af6e2f5781 (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/Level3.cpp')
-rw-r--r-- | src/game/Level3.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/game/Level3.cpp b/src/game/Level3.cpp index a099aa8f66c..4fb765fa8a9 100644 --- a/src/game/Level3.cpp +++ b/src/game/Level3.cpp @@ -6481,18 +6481,18 @@ bool ChatHandler::HandlePDumpLoadCommand(const char *args) char* name_str = strtok(NULL, " "); std::string name; - if(name_str) + if (name_str) { name = name_str; // normalize the name if specified and check if it exists - if(!normalizePlayerName(name)) + if (!normalizePlayerName(name)) { PSendSysMessage(LANG_INVALID_CHARACTER_NAME); SetSentErrorMessage(true); return false; } - if(!ObjectMgr::IsValidName(name,true)) + if (ObjectMgr::CheckPlayerName(name,true) != CHAR_NAME_SUCCESS) { PSendSysMessage(LANG_INVALID_CHARACTER_NAME); SetSentErrorMessage(true); @@ -6504,17 +6504,17 @@ bool ChatHandler::HandlePDumpLoadCommand(const char *args) uint32 guid = 0; - if(guid_str) + if (guid_str) { guid = atoi(guid_str); - if(!guid) + if (!guid) { PSendSysMessage(LANG_INVALID_CHARACTER_GUID); SetSentErrorMessage(true); return false; } - if(objmgr.GetPlayerAccountIdByGUID(guid)) + if (objmgr.GetPlayerAccountIdByGUID(guid)) { PSendSysMessage(LANG_CHARACTER_GUID_IN_USE,guid); SetSentErrorMessage(true); |