mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-15 18:10:26 +00:00
refactor(Core/ObjectMgr): Handle Profanity & Reserved Names in load (#19259)
* refactor(Core/ObjectMgr): Handle Profanity & Reserved Names in load * closes https://github.com/azerothcore/azerothcore-wotlk/issues/18556 * Update ObjectMgr.cpp * Update ObjectMgr.cpp * I swear I am not drunk * We already check all of these * fix build * Forgot we dont send the responsecode in senderrormessage * last commit I swear
This commit is contained in:
@@ -347,21 +347,22 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
if (ObjectMgr::CheckPlayerName(newName, true) != CHAR_NAME_SUCCESS)
|
||||
ResponseCodes res = ResponseCodes(ObjectMgr::CheckPlayerName(newName, true));
|
||||
if (res != CHAR_NAME_SUCCESS)
|
||||
{
|
||||
handler->SendErrorMessage(LANG_BAD_VALUE);
|
||||
return false;
|
||||
}
|
||||
switch (res)
|
||||
{
|
||||
case CHAR_NAME_RESERVED:
|
||||
handler->SendErrorMessage(LANG_RESERVED_NAME);
|
||||
break;
|
||||
case CHAR_NAME_PROFANE:
|
||||
handler->SendErrorMessage(LANG_PROFANITY_NAME);
|
||||
break;
|
||||
default:
|
||||
handler->SendErrorMessage(LANG_BAD_VALUE);
|
||||
break;
|
||||
}
|
||||
|
||||
if (sObjectMgr->IsReservedName(newName))
|
||||
{
|
||||
handler->SendErrorMessage(LANG_RESERVED_NAME);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (sObjectMgr->IsProfanityName(newName))
|
||||
{
|
||||
handler->SendErrorMessage(LANG_PROFANITY_NAME);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user