feat(Core/Misc): implement ObjectGuid class (port from TC) (#4885)

This commit is contained in:
UltraNix
2021-04-25 22:18:03 +02:00
committed by GitHub
parent 91081f4ad8
commit f4c226423d
568 changed files with 10655 additions and 11019 deletions

View File

@@ -82,8 +82,8 @@ public:
}
// Get target information
uint64 targetGuid = sObjectMgr->GetPlayerGUIDByName(target.c_str());
uint64 targetAccountId = sObjectMgr->GetPlayerAccountIdByGUID(targetGuid);
ObjectGuid targetGuid = sObjectMgr->GetPlayerGUIDByName(target.c_str());
uint32 targetAccountId = sObjectMgr->GetPlayerAccountIdByGUID(targetGuid.GetCounter());
uint32 targetGmLevel = AccountMgr::GetSecurity(targetAccountId, realmID);
// Target must exist and have administrative rights
@@ -142,7 +142,7 @@ public:
return true;
}
sTicketMgr->ResolveAndCloseTicket(ticket->GetId(), player ? player->GetGUID() : -1);
sTicketMgr->ResolveAndCloseTicket(ticket->GetId(), player ? player->GetGUID() : ObjectGuid::Empty);
sTicketMgr->UpdateLastChange();
std::string msg = ticket->FormatMessageString(*handler, player ? player->GetName().c_str() : "Console", nullptr, nullptr, nullptr);
@@ -244,7 +244,7 @@ public:
SQLTransaction trans = SQLTransaction(nullptr);
ticket->SetCompleted();
ticket->SetResolvedBy(gm ? gm->GetGUID() : -1);
ticket->SetResolvedBy(gm ? gm->GetGUID() : ObjectGuid::Empty);
ticket->SaveToDB(trans);
std::string msg = ticket->FormatMessageString(*handler, nullptr, nullptr, nullptr, nullptr);
@@ -380,8 +380,8 @@ public:
security = assignedPlayer->GetSession()->GetSecurity();
else
{
uint64 guid = ticket->GetAssignedToGUID();
uint32 accountId = sObjectMgr->GetPlayerAccountIdByGUID(guid);
ObjectGuid guid = ticket->GetAssignedToGUID();
uint32 accountId = sObjectMgr->GetPlayerAccountIdByGUID(guid.GetCounter());
security = AccountMgr::GetSecurity(accountId, realmID);
}
@@ -438,7 +438,7 @@ public:
return false;
// Detect target's GUID
uint64 guid = 0;
ObjectGuid guid;
if (Player* player = ObjectAccessor::FindPlayerByName(name, false))
guid = player->GetGUID();
else