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

@@ -99,7 +99,7 @@ public:
return false;
}
if (handler->HasLowerSecurity(target, 0))
if (handler->HasLowerSecurity(target))
return false;
handler->PSendSysMessage(LANG_YOU_CHANGE_HP, handler->GetNameLink(target).c_str(), hp, hpm);
@@ -137,7 +137,7 @@ public:
}
// check online security
if (handler->HasLowerSecurity(target, 0))
if (handler->HasLowerSecurity(target))
return false;
handler->PSendSysMessage(LANG_YOU_CHANGE_MANA, handler->GetNameLink(target).c_str(), mana, manam);
@@ -186,7 +186,7 @@ public:
}
// check online security
if (handler->HasLowerSecurity(target, 0))
if (handler->HasLowerSecurity(target))
return false;
handler->PSendSysMessage(LANG_YOU_CHANGE_ENERGY, handler->GetNameLink(target).c_str(), energy / 10, energym / 10);
@@ -239,7 +239,7 @@ public:
}
// check online security
if (handler->HasLowerSecurity(target, 0))
if (handler->HasLowerSecurity(target))
return false;
handler->PSendSysMessage(LANG_YOU_CHANGE_RAGE, handler->GetNameLink(target).c_str(), rage / 10, ragem / 10);
@@ -308,7 +308,7 @@ public:
uint32 flag = target->GetUInt32Value(UNIT_FIELD_FLAGS);
uint32 npcflag = target->GetUInt32Value(UNIT_NPC_FLAGS);
uint32 dyflag = target->GetUInt32Value(UNIT_DYNAMIC_FLAGS);
handler->PSendSysMessage(LANG_CURRENT_FACTION, target->GetGUIDLow(), factionid, flag, npcflag, dyflag);
handler->PSendSysMessage(LANG_CURRENT_FACTION, target->GetGUID().GetCounter(), factionid, flag, npcflag, dyflag);
return true;
}
@@ -344,7 +344,7 @@ public:
return false;
}
handler->PSendSysMessage(LANG_YOU_CHANGE_FACTION, target->GetGUIDLow(), factionid, flag, npcflag, dyflag);
handler->PSendSysMessage(LANG_YOU_CHANGE_FACTION, target->GetGUID().GetCounter(), factionid, flag, npcflag, dyflag);
target->setFaction(factionid);
target->SetUInt32Value(UNIT_FIELD_FLAGS, flag);
@@ -393,7 +393,7 @@ public:
}
// check online security
if (handler->HasLowerSecurity(target, 0))
if (handler->HasLowerSecurity(target))
return false;
handler->PSendSysMessage(LANG_YOU_CHANGE_SPELLFLATID, spellflatid, val, mark, handler->GetNameLink(target).c_str());
@@ -431,7 +431,7 @@ public:
if (target->GetTypeId() == TYPEID_PLAYER)
{
// check online security
if (handler->HasLowerSecurity(target->ToPlayer(), 0))
if (handler->HasLowerSecurity(target->ToPlayer()))
return false;
target->ToPlayer()->SetFreeTalentPoints(tp);
target->ToPlayer()->SendTalentsInfoData(false);
@@ -443,7 +443,7 @@ public:
if (owner && owner->GetTypeId() == TYPEID_PLAYER && ((Pet*)target)->IsPermanentPetFor(owner->ToPlayer()))
{
// check online security
if (handler->HasLowerSecurity(owner->ToPlayer(), 0))
if (handler->HasLowerSecurity(owner->ToPlayer()))
return false;
((Pet*)target)->SetFreeTalentPoints(tp);
owner->ToPlayer()->SendTalentsInfoData(true);
@@ -482,7 +482,7 @@ public:
}
// check online security
if (handler->HasLowerSecurity(target, 0))
if (handler->HasLowerSecurity(target))
return false;
std::string targetNameLink = handler->GetNameLink(target);
@@ -532,7 +532,7 @@ public:
}
// check online security
if (handler->HasLowerSecurity(target, 0))
if (handler->HasLowerSecurity(target))
return false;
std::string targetNameLink = handler->GetNameLink(target);
@@ -579,7 +579,7 @@ public:
}
// check online security
if (handler->HasLowerSecurity(target, 0))
if (handler->HasLowerSecurity(target))
return false;
std::string targetNameLink = handler->GetNameLink(target);
@@ -626,7 +626,7 @@ public:
}
// check online security
if (handler->HasLowerSecurity(target, 0))
if (handler->HasLowerSecurity(target))
return false;
std::string targetNameLink = handler->GetNameLink(target);
@@ -673,7 +673,7 @@ public:
}
// check online security
if (handler->HasLowerSecurity(target, 0))
if (handler->HasLowerSecurity(target))
return false;
handler->PSendSysMessage(LANG_YOU_CHANGE_FLY_SPEED, FSpeed, handler->GetNameLink(target).c_str());
@@ -710,7 +710,7 @@ public:
if (Player* player = target->ToPlayer())
{
// check online security
if (handler->HasLowerSecurity(player, 0))
if (handler->HasLowerSecurity(player))
return false;
handler->PSendSysMessage(LANG_YOU_CHANGE_SIZE, Scale, handler->GetNameLink(player).c_str());
@@ -958,7 +958,7 @@ public:
}
// check online security
if (handler->HasLowerSecurity(target, 0))
if (handler->HasLowerSecurity(target))
return false;
handler->PSendSysMessage(LANG_YOU_GIVE_MOUNT, handler->GetNameLink(target).c_str());
@@ -969,14 +969,14 @@ public:
target->Mount(mId);
WorldPacket data(SMSG_FORCE_RUN_SPEED_CHANGE, (8 + 4 + 1 + 4));
data.append(target->GetPackGUID());
data << target->GetPackGUID();
data << (uint32)0;
data << (uint8)0; //new 2.1.0
data << float(speed);
target->SendMessageToSet(&data, true);
data.Initialize(SMSG_FORCE_SWIM_SPEED_CHANGE, (8 + 4 + 4));
data.append(target->GetPackGUID());
data << target->GetPackGUID();
data << (uint32)0;
data << float(speed);
target->SendMessageToSet(&data, true);
@@ -999,7 +999,7 @@ public:
}
// check online security
if (handler->HasLowerSecurity(target, 0))
if (handler->HasLowerSecurity(target))
return false;
int32 moneyToAdd = 0;
@@ -1073,7 +1073,7 @@ public:
}
// check online security
if (target->GetTypeId() == TYPEID_PLAYER && handler->HasLowerSecurity(target->ToPlayer(), 0))
if (target->GetTypeId() == TYPEID_PLAYER && handler->HasLowerSecurity(target->ToPlayer()))
return false;
char* pField = strtok((char*)args, " ");
@@ -1127,7 +1127,7 @@ public:
}
// check online security
if (handler->HasLowerSecurity(target, 0))
if (handler->HasLowerSecurity(target))
return false;
int32 amount = (uint32)atoi(args);
@@ -1168,7 +1168,7 @@ public:
}
// check online security
if (handler->HasLowerSecurity(target, 0))
if (handler->HasLowerSecurity(target))
return false;
char* factionTxt = handler->extractKeyFromLink((char*)args, "Hfaction");
@@ -1264,7 +1264,7 @@ public:
target = handler->GetSession()->GetPlayer();
// check online security
else if (target->GetTypeId() == TYPEID_PLAYER && handler->HasLowerSecurity(target->ToPlayer(), 0))
else if (target->GetTypeId() == TYPEID_PLAYER && handler->HasLowerSecurity(target->ToPlayer()))
return false;
target->SetDisplayId(display_id);
@@ -1280,7 +1280,7 @@ public:
target = handler->GetSession()->GetPlayer();
// check online security
else if (target->GetTypeId() == TYPEID_PLAYER && handler->HasLowerSecurity(target->ToPlayer(), 0))
else if (target->GetTypeId() == TYPEID_PLAYER && handler->HasLowerSecurity(target->ToPlayer()))
return false;
target->DeMorph();
@@ -1300,7 +1300,7 @@ public:
target = handler->GetSession()->GetPlayer();
// check online security
else if (target->GetTypeId() == TYPEID_PLAYER && handler->HasLowerSecurity(target->ToPlayer(), 0))
else if (target->GetTypeId() == TYPEID_PLAYER && handler->HasLowerSecurity(target->ToPlayer()))
return false;
target->SetPhaseMask(phasemask, true);