[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
This commit is contained in:
+6
-6
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user