Core: add some missing Player Name normalization on input data

(cherrypicked from 6f9e8b6c91)
This commit is contained in:
ariel-
2017-01-28 01:27:39 -03:00
committed by Shauren
parent b485f3e673
commit b742c87222
3 changed files with 15 additions and 4 deletions

View File

@@ -1146,7 +1146,7 @@ bool ChatHandler::GetPlayerGroupAndGUIDByName(const char* cname, Player*& player
{
if (!normalizePlayerName(name))
{
PSendSysMessage(LANG_PLAYER_NOT_FOUND);
SendSysMessage(LANG_PLAYER_NOT_FOUND);
SetSentErrorMessage(true);
return false;
}

View File

@@ -246,6 +246,9 @@ void WorldSession::HandleCalendarEventInvite(WorldPackets::Calendar::CalendarEve
uint32 inviteeTeam = 0;
ObjectGuid::LowType inviteeGuildId = UI64LIT(0);
if (!normalizePlayerName(calendarEventInvite.Name))
return;
if (Player* player = ObjectAccessor::FindConnectedPlayerByName(calendarEventInvite.Name))
{
// Invitee is online

View File

@@ -300,16 +300,24 @@ public:
if (!*args)
return false;
Player* target = ObjectAccessor::FindPlayerByName(args);
ObjectGuid targetGuid;
std::string name(args);
if (!normalizePlayerName(name))
{
handler->SendSysMessage(LANG_BANINFO_NOCHARACTER);
handler->SetSentErrorMessage(true);
return false;
}
Player* target = ObjectAccessor::FindPlayerByName(name);
ObjectGuid targetGuid;
if (!target)
{
targetGuid = sWorld->GetCharacterGuidByName(name);
if (targetGuid.IsEmpty())
{
handler->PSendSysMessage(LANG_BANINFO_NOCHARACTER);
handler->SendSysMessage(LANG_BANINFO_NOCHARACTER);
handler->SetSentErrorMessage(true);
return false;
}
}