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
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
568 changed files with 10655 additions and 11019 deletions

View file

@ -194,7 +194,7 @@ public:
// We declare all the required variables
uint32 playerGuid = player->GetSession()->GetAccountId();
uint32 characterGuid = player->GetGUIDLow();
ObjectGuid::LowType characterGuid = player->GetGUID().GetCounter();
const std::string currentIp = player->GetSession()->GetRemoteAddress();
std::string systemNote = "ERROR"; // "ERROR" is a placeholder here. We change it...
@ -245,18 +245,18 @@ public:
CharacterDeleteActionIpLogger() : PlayerScript("CharacterDeleteActionIpLogger") { }
// CHARACTER_DELETE = 10
void OnDelete(uint64 guid, uint32 accountId) override
void OnDelete(ObjectGuid guid, uint32 accountId) override
{
DeleteIPLogAction(guid, accountId, CHARACTER_DELETE);
}
// CHARACTER_FAILED_DELETE = 11
void OnFailedDelete(uint64 guid, uint32 accountId) override
void OnFailedDelete(ObjectGuid guid, uint32 accountId) override
{
DeleteIPLogAction(guid, accountId, CHARACTER_FAILED_DELETE);
}
void DeleteIPLogAction(uint64 guid, uint32 playerGuid, IPLoggingTypes aType)
void DeleteIPLogAction(ObjectGuid guid, ObjectGuid::LowType playerGuid, IPLoggingTypes aType)
{
if (!sWorld->getBoolConfig(CONFIG_IP_BASED_ACTION_LOGGING))
return;
@ -265,7 +265,7 @@ public:
// Else, this script isn't loaded in the first place: We require no config check.
// We declare all the required variables
uint32 characterGuid = GUID_LOPART(guid); // We have no access to any member function of Player* or WorldSession*. So use old-fashioned way.
ObjectGuid::LowType characterGuid = guid.GetCounter(); // We have no access to any member function of Player* or WorldSession*. So use old-fashioned way.
// Query playerGuid/accountId, as we only have characterGuid
std::string systemNote = "ERROR"; // "ERROR" is a placeholder here. We change it later.