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

@@ -46,14 +46,14 @@ public:
static bool HandleResetAchievementsCommand(ChatHandler* handler, char const* args)
{
Player* target;
uint64 targetGuid;
ObjectGuid targetGuid;
if (!handler->extractPlayerTarget((char*)args, &target, &targetGuid))
return false;
if (target)
target->ResetAchievements();
else
AchievementMgr::DeleteFromDB(GUID_LOPART(targetGuid));
AchievementMgr::DeleteFromDB(targetGuid.GetCounter());
return true;
}
@@ -145,7 +145,7 @@ public:
static bool HandleResetSpellsCommand(ChatHandler* handler, char const* args)
{
Player* target;
uint64 targetGuid;
ObjectGuid targetGuid;
std::string targetName;
if (!handler->extractPlayerTarget((char*)args, &target, &targetGuid, &targetName))
return false;
@@ -162,7 +162,7 @@ public:
{
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ADD_AT_LOGIN_FLAG);
stmt->setUInt16(0, uint16(AT_LOGIN_RESET_SPELLS));
stmt->setUInt32(1, GUID_LOPART(targetGuid));
stmt->setUInt32(1, targetGuid.GetCounter());
CharacterDatabase.Execute(stmt);
handler->PSendSysMessage(LANG_RESET_SPELLS_OFFLINE, targetName.c_str());
@@ -192,7 +192,7 @@ public:
static bool HandleResetTalentsCommand(ChatHandler* handler, char const* args)
{
Player* target;
uint64 targetGuid;
ObjectGuid targetGuid;
std::string targetName;
if (!handler->extractPlayerTarget((char*)args, &target, &targetGuid, &targetName))
{
@@ -236,7 +236,7 @@ public:
{
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ADD_AT_LOGIN_FLAG);
stmt->setUInt16(0, uint16(AT_LOGIN_NONE | AT_LOGIN_RESET_PET_TALENTS));
stmt->setUInt32(1, GUID_LOPART(targetGuid));
stmt->setUInt32(1, targetGuid.GetCounter());
CharacterDatabase.Execute(stmt);
std::string nameLink = handler->playerLink(targetName);
@@ -285,7 +285,7 @@ public:
CharacterDatabase.Execute(stmt);
std::shared_lock<std::shared_mutex> lock(*HashMapHolder<Player>::GetLock());
HashMapHolder<Player>::MapType const& plist = sObjectAccessor->GetPlayers();
HashMapHolder<Player>::MapType const& plist = ObjectAccessor::GetPlayers();
for (HashMapHolder<Player>::MapType::const_iterator itr = plist.begin(); itr != plist.end(); ++itr)
itr->second->SetAtLoginFlag(atLogin);