mirror of
https://github.com/mangosfour/server.git
synced 2025-12-16 04:37:00 +00:00
[10811] Use ObjectGuids in chat commands.
Still exist 15 GUID_LOPART uses in code.
This commit is contained in:
parent
c6d3c5e0d6
commit
b305f203b9
15 changed files with 151 additions and 146 deletions
|
|
@ -56,7 +56,7 @@ bool ChatHandler::HandleMuteCommand(char* args)
|
|||
char* nameStr = ExtractOptNotLastArg(&args);
|
||||
|
||||
Player* target;
|
||||
uint64 target_guid;
|
||||
ObjectGuid target_guid;
|
||||
std::string target_name;
|
||||
if (!ExtractPlayerTarget(&nameStr, &target, &target_guid, &target_name))
|
||||
return false;
|
||||
|
|
@ -98,7 +98,7 @@ bool ChatHandler::HandleMuteCommand(char* args)
|
|||
bool ChatHandler::HandleUnmuteCommand(char* args)
|
||||
{
|
||||
Player* target;
|
||||
uint64 target_guid;
|
||||
ObjectGuid target_guid;
|
||||
std::string target_name;
|
||||
if (!ExtractPlayerTarget(&args, &target, &target_guid, &target_name))
|
||||
return false;
|
||||
|
|
@ -1459,7 +1459,7 @@ bool ChatHandler::HandleModifyRepCommand(char* args)
|
|||
}
|
||||
|
||||
// check online security
|
||||
if (HasLowerSecurity(target, 0))
|
||||
if (HasLowerSecurity(target))
|
||||
return false;
|
||||
|
||||
uint32 factionId;
|
||||
|
|
@ -2422,7 +2422,7 @@ bool ChatHandler::HandleDeMorphCommand(char* /*args*/)
|
|||
|
||||
|
||||
// check online security
|
||||
else if (target->GetTypeId() == TYPEID_PLAYER && HasLowerSecurity((Player*)target, 0))
|
||||
else if (target->GetTypeId() == TYPEID_PLAYER && HasLowerSecurity((Player*)target))
|
||||
return false;
|
||||
|
||||
target->DeMorph();
|
||||
|
|
@ -2443,7 +2443,7 @@ bool ChatHandler::HandleModifyMorphCommand(char* args)
|
|||
target = m_session->GetPlayer();
|
||||
|
||||
// check online security
|
||||
else if (target->GetTypeId() == TYPEID_PLAYER && HasLowerSecurity((Player*)target, 0))
|
||||
else if (target->GetTypeId() == TYPEID_PLAYER && HasLowerSecurity((Player*)target))
|
||||
return false;
|
||||
|
||||
target->SetDisplayId(display_id);
|
||||
|
|
@ -2466,7 +2466,7 @@ bool ChatHandler::HandleKickPlayerCommand(char *args)
|
|||
}
|
||||
|
||||
// check online security
|
||||
if (HasLowerSecurity(target, 0))
|
||||
if (HasLowerSecurity(target))
|
||||
return false;
|
||||
|
||||
// send before target pointer invalidate
|
||||
|
|
@ -2488,7 +2488,7 @@ bool ChatHandler::HandleModifyPhaseCommand(char* args)
|
|||
target = m_session->GetPlayer();
|
||||
|
||||
// check online security
|
||||
else if (target->GetTypeId() == TYPEID_PLAYER && HasLowerSecurity((Player*)target, 0))
|
||||
else if (target->GetTypeId() == TYPEID_PLAYER && HasLowerSecurity((Player*)target))
|
||||
return false;
|
||||
|
||||
target->SetPhaseMask(phasemask,true);
|
||||
|
|
@ -2500,7 +2500,7 @@ bool ChatHandler::HandleModifyPhaseCommand(char* args)
|
|||
bool ChatHandler::HandlePInfoCommand(char* args)
|
||||
{
|
||||
Player* target;
|
||||
uint64 target_guid;
|
||||
ObjectGuid target_guid;
|
||||
std::string target_name;
|
||||
if (!ExtractPlayerTarget(&args, &target, &target_guid, &target_name))
|
||||
return false;
|
||||
|
|
@ -2515,7 +2515,7 @@ bool ChatHandler::HandlePInfoCommand(char* args)
|
|||
if (target)
|
||||
{
|
||||
// check online security
|
||||
if (HasLowerSecurity(target, 0))
|
||||
if (HasLowerSecurity(target))
|
||||
return false;
|
||||
|
||||
accId = target->GetSession()->GetAccountId();
|
||||
|
|
@ -2532,7 +2532,7 @@ bool ChatHandler::HandlePInfoCommand(char* args)
|
|||
return false;
|
||||
|
||||
// 0 1 2 3
|
||||
QueryResult *result = CharacterDatabase.PQuery("SELECT totaltime, level, money, account FROM characters WHERE guid = '%u'", GUID_LOPART(target_guid));
|
||||
QueryResult *result = CharacterDatabase.PQuery("SELECT totaltime, level, money, account FROM characters WHERE guid = '%u'", target_guid.GetCounter());
|
||||
if (!result)
|
||||
return false;
|
||||
|
||||
|
|
@ -2572,7 +2572,7 @@ bool ChatHandler::HandlePInfoCommand(char* args)
|
|||
|
||||
std::string nameLink = playerLink(target_name);
|
||||
|
||||
PSendSysMessage(LANG_PINFO_ACCOUNT, (target?"":GetMangosString(LANG_OFFLINE)), nameLink.c_str(), GUID_LOPART(target_guid), username.c_str(), accId, security, last_ip.c_str(), last_login.c_str(), latency);
|
||||
PSendSysMessage(LANG_PINFO_ACCOUNT, (target?"":GetMangosString(LANG_OFFLINE)), nameLink.c_str(), target_guid.GetCounter(), username.c_str(), accId, security, last_ip.c_str(), last_login.c_str(), latency);
|
||||
|
||||
std::string timeStr = secsToTimeString(total_player_time,true,true);
|
||||
uint32 gold = money /GOLD;
|
||||
|
|
@ -2589,7 +2589,7 @@ void ChatHandler::ShowTicket(GMTicket const* ticket)
|
|||
std::string lastupdated = TimeToTimestampStr(ticket->GetLastUpdate());
|
||||
|
||||
std::string name;
|
||||
if (!sObjectMgr.GetPlayerNameByGUID(ObjectGuid(HIGHGUID_PLAYER, ticket->GetPlayerLowGuid()), name))
|
||||
if (!sObjectMgr.GetPlayerNameByGUID(ticket->GetPlayerGuid(), name))
|
||||
name = GetMangosString(LANG_UNKNOWN);
|
||||
|
||||
std::string nameLink = playerLink(name);
|
||||
|
|
@ -2677,13 +2677,13 @@ bool ChatHandler::HandleTicketCommand(char* args)
|
|||
}
|
||||
else
|
||||
{
|
||||
uint64 target_guid;
|
||||
ObjectGuid target_guid;
|
||||
std::string target_name;
|
||||
if (!ExtractPlayerTarget(&args, NULL, &target_guid, &target_name))
|
||||
return false;
|
||||
|
||||
// ticket respond $char_name
|
||||
ticket = sTicketMgr.GetGMTicket(GUID_LOPART(target_guid));
|
||||
ticket = sTicketMgr.GetGMTicket(target_guid);
|
||||
|
||||
if (!ticket)
|
||||
{
|
||||
|
|
@ -2699,7 +2699,7 @@ bool ChatHandler::HandleTicketCommand(char* args)
|
|||
|
||||
ticket->SetResponseText(args);
|
||||
|
||||
if (Player* pl = sObjectMgr.GetPlayer(ObjectGuid(HIGHGUID_PLAYER, ticket->GetPlayerLowGuid())))
|
||||
if (Player* pl = sObjectMgr.GetPlayer(ticket->GetPlayerGuid()))
|
||||
pl->GetSession()->SendGMResponse(ticket);
|
||||
|
||||
return true;
|
||||
|
|
@ -2725,13 +2725,13 @@ bool ChatHandler::HandleTicketCommand(char* args)
|
|||
return true;
|
||||
}
|
||||
|
||||
uint64 target_guid;
|
||||
ObjectGuid target_guid;
|
||||
std::string target_name;
|
||||
if (!ExtractPlayerTarget(&px, NULL, &target_guid, &target_name))
|
||||
return false;
|
||||
|
||||
// ticket $char_name
|
||||
GMTicket* ticket = sTicketMgr.GetGMTicket(GUID_LOPART(target_guid));
|
||||
GMTicket* ticket = sTicketMgr.GetGMTicket(target_guid);
|
||||
if (!ticket)
|
||||
{
|
||||
PSendSysMessage(LANG_COMMAND_TICKETNOTEXIST_NAME, target_name.c_str());
|
||||
|
|
@ -2777,12 +2777,12 @@ bool ChatHandler::HandleDelTicketCommand(char *args)
|
|||
return false;
|
||||
}
|
||||
|
||||
uint32 lowguid = ticket->GetPlayerLowGuid();
|
||||
ObjectGuid guid = ticket->GetPlayerGuid();
|
||||
|
||||
sTicketMgr.Delete(lowguid);
|
||||
sTicketMgr.Delete(guid);
|
||||
|
||||
//notify player
|
||||
if (Player* pl = sObjectMgr.GetPlayer(ObjectGuid(HIGHGUID_PLAYER, lowguid)))
|
||||
if (Player* pl = sObjectMgr.GetPlayer(guid))
|
||||
{
|
||||
pl->GetSession()->SendGMTicketGetTicket(0x0A);
|
||||
PSendSysMessage(LANG_COMMAND_TICKETPLAYERDEL, GetNameLink(pl).c_str());
|
||||
|
|
@ -2794,13 +2794,13 @@ bool ChatHandler::HandleDelTicketCommand(char *args)
|
|||
}
|
||||
|
||||
Player* target;
|
||||
uint64 target_guid;
|
||||
ObjectGuid target_guid;
|
||||
std::string target_name;
|
||||
if (!ExtractPlayerTarget(&px, &target, &target_guid, &target_name))
|
||||
return false;
|
||||
|
||||
// delticket $char_name
|
||||
sTicketMgr.Delete(GUID_LOPART(target_guid));
|
||||
sTicketMgr.Delete(target_guid);
|
||||
|
||||
// notify players about ticket deleting
|
||||
if (target)
|
||||
|
|
@ -3954,7 +3954,7 @@ bool ChatHandler::HandleWpImportCommand(char *args)
|
|||
bool ChatHandler::HandleCharacterRenameCommand(char* args)
|
||||
{
|
||||
Player* target;
|
||||
uint64 target_guid;
|
||||
ObjectGuid target_guid;
|
||||
std::string target_name;
|
||||
if (!ExtractPlayerTarget(&args, &target, &target_guid, &target_name))
|
||||
return false;
|
||||
|
|
@ -3962,7 +3962,7 @@ bool ChatHandler::HandleCharacterRenameCommand(char* args)
|
|||
if (target)
|
||||
{
|
||||
// check online security
|
||||
if (HasLowerSecurity(target, 0))
|
||||
if (HasLowerSecurity(target))
|
||||
return false;
|
||||
|
||||
PSendSysMessage(LANG_RENAME_PLAYER, GetNameLink(target).c_str());
|
||||
|
|
@ -3977,8 +3977,8 @@ bool ChatHandler::HandleCharacterRenameCommand(char* args)
|
|||
|
||||
std::string oldNameLink = playerLink(target_name);
|
||||
|
||||
PSendSysMessage(LANG_RENAME_PLAYER_GUID, oldNameLink.c_str(), GUID_LOPART(target_guid));
|
||||
CharacterDatabase.PExecute("UPDATE characters SET at_login = at_login | '1' WHERE guid = '%u'", GUID_LOPART(target_guid));
|
||||
PSendSysMessage(LANG_RENAME_PLAYER_GUID, oldNameLink.c_str(), target_guid.GetCounter());
|
||||
CharacterDatabase.PExecute("UPDATE characters SET at_login = at_login | '1' WHERE guid = '%u'", target_guid.GetCounter());
|
||||
}
|
||||
|
||||
return true;
|
||||
|
|
@ -3988,7 +3988,7 @@ bool ChatHandler::HandleCharacterRenameCommand(char* args)
|
|||
bool ChatHandler::HandleCharacterCustomizeCommand(char* args)
|
||||
{
|
||||
Player* target;
|
||||
uint64 target_guid;
|
||||
ObjectGuid target_guid;
|
||||
std::string target_name;
|
||||
if (!ExtractPlayerTarget(&args, &target, &target_guid, &target_name))
|
||||
return false;
|
||||
|
|
@ -4003,8 +4003,8 @@ bool ChatHandler::HandleCharacterCustomizeCommand(char* args)
|
|||
{
|
||||
std::string oldNameLink = playerLink(target_name);
|
||||
|
||||
PSendSysMessage(LANG_CUSTOMIZE_PLAYER_GUID, oldNameLink.c_str(), GUID_LOPART(target_guid));
|
||||
CharacterDatabase.PExecute("UPDATE characters SET at_login = at_login | '8' WHERE guid = '%u'", GUID_LOPART(target_guid));
|
||||
PSendSysMessage(LANG_CUSTOMIZE_PLAYER_GUID, oldNameLink.c_str(), target_guid.GetCounter());
|
||||
CharacterDatabase.PExecute("UPDATE characters SET at_login = at_login | '8' WHERE guid = '%u'", target_guid.GetCounter());
|
||||
}
|
||||
|
||||
return true;
|
||||
|
|
@ -4057,7 +4057,7 @@ bool ChatHandler::HandleHonorAddCommand(char* args)
|
|||
}
|
||||
|
||||
// check online security
|
||||
if (HasLowerSecurity(target, 0))
|
||||
if (HasLowerSecurity(target))
|
||||
return false;
|
||||
|
||||
float amount = (float)atof(args);
|
||||
|
|
@ -4076,7 +4076,7 @@ bool ChatHandler::HandleHonorAddKillCommand(char* /*args*/)
|
|||
}
|
||||
|
||||
// check online security
|
||||
if (target->GetTypeId() == TYPEID_PLAYER && HasLowerSecurity((Player*)target, 0))
|
||||
if (target->GetTypeId() == TYPEID_PLAYER && HasLowerSecurity((Player*)target))
|
||||
return false;
|
||||
|
||||
m_session->GetPlayer()->RewardHonor(target, 1);
|
||||
|
|
@ -4094,7 +4094,7 @@ bool ChatHandler::HandleHonorUpdateCommand(char* /*args*/)
|
|||
}
|
||||
|
||||
// check online security
|
||||
if (HasLowerSecurity(target, 0))
|
||||
if (HasLowerSecurity(target))
|
||||
return false;
|
||||
|
||||
target->UpdateHonorFields();
|
||||
|
|
@ -4324,7 +4324,7 @@ bool ChatHandler::HandleCombatStopCommand(char* args)
|
|||
return false;
|
||||
|
||||
// check online security
|
||||
if (HasLowerSecurity(target, 0))
|
||||
if (HasLowerSecurity(target))
|
||||
return false;
|
||||
|
||||
target->CombatStop();
|
||||
|
|
@ -4694,7 +4694,7 @@ bool ChatHandler::HandleRepairitemsCommand(char* args)
|
|||
return false;
|
||||
|
||||
// check online security
|
||||
if (HasLowerSecurity(target, 0))
|
||||
if (HasLowerSecurity(target))
|
||||
return false;
|
||||
|
||||
// Repair items
|
||||
|
|
@ -4726,7 +4726,7 @@ bool ChatHandler::HandleWaterwalkCommand(char* args)
|
|||
}
|
||||
|
||||
// check online security
|
||||
if (HasLowerSecurity(player, 0))
|
||||
if (HasLowerSecurity(player))
|
||||
return false;
|
||||
|
||||
if (value)
|
||||
|
|
@ -4839,7 +4839,7 @@ bool ChatHandler::HandleTitlesAddCommand(char* args)
|
|||
}
|
||||
|
||||
// check online security
|
||||
if (HasLowerSecurity(target, 0))
|
||||
if (HasLowerSecurity(target))
|
||||
return false;
|
||||
|
||||
CharTitlesEntry const* titleInfo = sCharTitlesStore.LookupEntry(id);
|
||||
|
|
@ -4885,7 +4885,7 @@ bool ChatHandler::HandleTitlesRemoveCommand(char* args)
|
|||
}
|
||||
|
||||
// check online security
|
||||
if (HasLowerSecurity(target, 0))
|
||||
if (HasLowerSecurity(target))
|
||||
return false;
|
||||
|
||||
CharTitlesEntry const* titleInfo = sCharTitlesStore.LookupEntry(id);
|
||||
|
|
@ -4934,7 +4934,7 @@ bool ChatHandler::HandleTitlesSetMaskCommand(char* args)
|
|||
}
|
||||
|
||||
// check online security
|
||||
if (HasLowerSecurity(target, 0))
|
||||
if (HasLowerSecurity(target))
|
||||
return false;
|
||||
|
||||
uint64 titles2 = titles;
|
||||
|
|
@ -5017,7 +5017,7 @@ bool ChatHandler::HandleTitlesCurrentCommand(char* args)
|
|||
}
|
||||
|
||||
// check online security
|
||||
if (HasLowerSecurity(target, 0))
|
||||
if (HasLowerSecurity(target))
|
||||
return false;
|
||||
|
||||
CharTitlesEntry const* titleInfo = sCharTitlesStore.LookupEntry(id);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue