mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-27 23:56:25 +00:00
feat(Core/Misc): implement ObjectGuid class (port from TC) (#4885)
This commit is contained in:
@@ -129,18 +129,18 @@ static const uint8 GroupUpdateLength[GROUP_UPDATE_FLAGS_COUNT] = { 0, 2, 2, 2, 1
|
||||
class Roll : public LootValidatorRef
|
||||
{
|
||||
public:
|
||||
Roll(uint64 _guid, LootItem const& li);
|
||||
Roll(ObjectGuid _guid, LootItem const& li);
|
||||
~Roll();
|
||||
void setLoot(Loot* pLoot);
|
||||
Loot* getLoot();
|
||||
void targetObjectBuildLink();
|
||||
|
||||
uint64 itemGUID;
|
||||
ObjectGuid itemGUID;
|
||||
uint32 itemid;
|
||||
int32 itemRandomPropId;
|
||||
uint32 itemRandomSuffix;
|
||||
uint8 itemCount;
|
||||
typedef std::map<uint64, RollVote> PlayerVote;
|
||||
typedef std::map<ObjectGuid, RollVote> PlayerVote;
|
||||
PlayerVote playerVote; //vote position correspond with player position (in group)
|
||||
uint8 totalPlayersRolling;
|
||||
uint8 totalNeed;
|
||||
@@ -157,7 +157,7 @@ class Group
|
||||
public:
|
||||
struct MemberSlot
|
||||
{
|
||||
uint64 guid;
|
||||
ObjectGuid guid;
|
||||
std::string name;
|
||||
uint8 group;
|
||||
uint8 flags;
|
||||
@@ -179,21 +179,21 @@ public:
|
||||
// group manipulation methods
|
||||
bool Create(Player* leader);
|
||||
bool LoadGroupFromDB(Field* field);
|
||||
void LoadMemberFromDB(uint32 guidLow, uint8 memberFlags, uint8 subgroup, uint8 roles);
|
||||
void LoadMemberFromDB(ObjectGuid::LowType guidLow, uint8 memberFlags, uint8 subgroup, uint8 roles);
|
||||
bool AddInvite(Player* player);
|
||||
void RemoveInvite(Player* player);
|
||||
void RemoveAllInvites();
|
||||
bool AddLeaderInvite(Player* player);
|
||||
bool AddMember(Player* player);
|
||||
bool RemoveMember(uint64 guid, const RemoveMethod& method = GROUP_REMOVEMETHOD_DEFAULT, uint64 kicker = 0, const char* reason = nullptr);
|
||||
void ChangeLeader(uint64 guid);
|
||||
bool RemoveMember(ObjectGuid guid, const RemoveMethod& method = GROUP_REMOVEMETHOD_DEFAULT, ObjectGuid kicker = ObjectGuid::Empty, const char* reason = nullptr);
|
||||
void ChangeLeader(ObjectGuid guid);
|
||||
void SetLootMethod(LootMethod method);
|
||||
void SetLooterGuid(uint64 guid);
|
||||
void SetMasterLooterGuid(uint64 guid);
|
||||
void SetLooterGuid(ObjectGuid guid);
|
||||
void SetMasterLooterGuid(ObjectGuid guid);
|
||||
void UpdateLooterGuid(WorldObject* pLootedObject, bool ifneed = false);
|
||||
void SetLootThreshold(ItemQualities threshold);
|
||||
void Disband(bool hideDestroy = false);
|
||||
void SetLfgRoles(uint64 guid, const uint8 roles);
|
||||
void SetLfgRoles(ObjectGuid guid, const uint8 roles);
|
||||
|
||||
// properties accessories
|
||||
bool IsFull() const;
|
||||
@@ -202,26 +202,25 @@ public:
|
||||
bool isBFGroup() const;
|
||||
bool isBGGroup() const;
|
||||
bool IsCreated() const;
|
||||
uint64 GetLeaderGUID() const;
|
||||
uint64 GetGUID() const;
|
||||
uint32 GetLowGUID() const;
|
||||
ObjectGuid GetLeaderGUID() const;
|
||||
ObjectGuid GetGUID() const;
|
||||
const char* GetLeaderName() const;
|
||||
LootMethod GetLootMethod() const;
|
||||
uint64 GetLooterGuid() const;
|
||||
uint64 GetMasterLooterGuid() const;
|
||||
ObjectGuid GetLooterGuid() const;
|
||||
ObjectGuid GetMasterLooterGuid() const;
|
||||
ItemQualities GetLootThreshold() const;
|
||||
|
||||
// member manipulation methods
|
||||
bool IsMember(uint64 guid) const;
|
||||
bool IsLeader(uint64 guid) const;
|
||||
uint64 GetMemberGUID(const std::string& name);
|
||||
bool IsAssistant(uint64 guid) const;
|
||||
bool IsMember(ObjectGuid guid) const;
|
||||
bool IsLeader(ObjectGuid guid) const;
|
||||
ObjectGuid GetMemberGUID(const std::string& name);
|
||||
bool IsAssistant(ObjectGuid guid) const;
|
||||
|
||||
Player* GetInvited(uint64 guid) const;
|
||||
Player* GetInvited(ObjectGuid guid) const;
|
||||
Player* GetInvited(const std::string& name) const;
|
||||
|
||||
bool SameSubGroup(uint64 guid1, uint64 guid2) const;
|
||||
bool SameSubGroup(uint64 guid1, MemberSlot const* slot2) const;
|
||||
bool SameSubGroup(ObjectGuid guid1, ObjectGuid guid2) const;
|
||||
bool SameSubGroup(ObjectGuid guid1, MemberSlot const* slot2) const;
|
||||
bool SameSubGroup(Player const* member1, Player const* member2) const;
|
||||
bool HasFreeSlotSubGroup(uint8 subgroup) const;
|
||||
|
||||
@@ -230,7 +229,7 @@ public:
|
||||
GroupReference const* GetFirstMember() const { return m_memberMgr.getFirst(); }
|
||||
uint32 GetMembersCount() const { return m_memberSlots.size(); }
|
||||
|
||||
uint8 GetMemberGroup(uint64 guid) const;
|
||||
uint8 GetMemberGroup(ObjectGuid guid) const;
|
||||
|
||||
void ConvertToLFG();
|
||||
void ConvertToRaid();
|
||||
@@ -239,9 +238,9 @@ public:
|
||||
void SetBattlefieldGroup(Battlefield* bf);
|
||||
GroupJoinBattlegroundResult CanJoinBattlegroundQueue(Battleground const* bgTemplate, BattlegroundQueueTypeId bgQueueTypeId, uint32 MinPlayerCount, uint32 MaxPlayerCount, bool isRated, uint32 arenaSlot);
|
||||
|
||||
void ChangeMembersGroup(uint64 guid, uint8 group);
|
||||
void SetTargetIcon(uint8 id, uint64 whoGuid, uint64 targetGuid);
|
||||
void SetGroupMemberFlag(uint64 guid, bool apply, GroupMemberFlags flag);
|
||||
void ChangeMembersGroup(ObjectGuid guid, uint8 group);
|
||||
void SetTargetIcon(uint8 id, ObjectGuid whoGuid, ObjectGuid targetGuid);
|
||||
void SetGroupMemberFlag(ObjectGuid guid, bool apply, GroupMemberFlags flag);
|
||||
void RemoveUniqueGroupMemberFlag(GroupMemberFlags flag);
|
||||
|
||||
Difficulty GetDifficulty(bool isRaid) const;
|
||||
@@ -256,10 +255,10 @@ public:
|
||||
//void SendInit(WorldSession* session);
|
||||
void SendTargetIconList(WorldSession* session);
|
||||
void SendUpdate();
|
||||
void SendUpdateToPlayer(uint64 playerGUID, MemberSlot* slot = nullptr);
|
||||
void SendUpdateToPlayer(ObjectGuid playerGUID, MemberSlot* slot = nullptr);
|
||||
void UpdatePlayerOutOfRange(Player* player);
|
||||
// ignore: GUID of player that will be ignored
|
||||
void BroadcastPacket(WorldPacket* packet, bool ignorePlayersInBGRaid, int group = -1, uint64 ignore = 0);
|
||||
void BroadcastPacket(WorldPacket* packet, bool ignorePlayersInBGRaid, int group = -1, ObjectGuid ignore = ObjectGuid::Empty);
|
||||
void BroadcastReadyCheck(WorldPacket* packet);
|
||||
void OfflineReadyCheck();
|
||||
|
||||
@@ -270,16 +269,16 @@ public:
|
||||
bool isRollLootActive() const;
|
||||
void SendLootStartRoll(uint32 CountDown, uint32 mapid, const Roll& r);
|
||||
void SendLootStartRollToPlayer(uint32 countDown, uint32 mapId, Player* p, bool canNeed, Roll const& r);
|
||||
void SendLootRoll(uint64 SourceGuid, uint64 TargetGuid, uint8 RollNumber, uint8 RollType, const Roll& r);
|
||||
void SendLootRollWon(uint64 SourceGuid, uint64 TargetGuid, uint8 RollNumber, uint8 RollType, const Roll& r);
|
||||
void SendLootRoll(ObjectGuid SourceGuid, ObjectGuid TargetGuid, uint8 RollNumber, uint8 RollType, const Roll& r);
|
||||
void SendLootRollWon(ObjectGuid SourceGuid, ObjectGuid TargetGuid, uint8 RollNumber, uint8 RollType, const Roll& r);
|
||||
void SendLootAllPassed(Roll const& roll);
|
||||
void SendLooter(Creature* creature, Player* pLooter);
|
||||
void GroupLoot(Loot* loot, WorldObject* pLootedObject);
|
||||
void NeedBeforeGreed(Loot* loot, WorldObject* pLootedObject);
|
||||
void MasterLoot(Loot* loot, WorldObject* pLootedObject);
|
||||
Rolls::iterator GetRoll(uint64 Guid);
|
||||
Rolls::iterator GetRoll(ObjectGuid Guid);
|
||||
void CountTheRoll(Rolls::iterator roll, Map* allowedMap);
|
||||
bool CountRollVote(uint64 playerGUID, uint64 Guid, uint8 Choise);
|
||||
bool CountRollVote(ObjectGuid playerGUID, ObjectGuid Guid, uint8 Choise);
|
||||
void EndRoll(Loot* loot, Map* allowedMap);
|
||||
|
||||
// related to disenchant rolls
|
||||
@@ -312,8 +311,8 @@ protected:
|
||||
void _cancelHomebindIfInstance(Player* player);
|
||||
|
||||
void _initRaidSubGroupsCounter();
|
||||
member_citerator _getMemberCSlot(uint64 Guid) const;
|
||||
member_witerator _getMemberWSlot(uint64 Guid);
|
||||
member_citerator _getMemberCSlot(ObjectGuid Guid) const;
|
||||
member_witerator _getMemberWSlot(ObjectGuid Guid);
|
||||
void SubGroupCounterIncrease(uint8 subgroup);
|
||||
void SubGroupCounterDecrease(uint8 subgroup);
|
||||
void ToggleGroupMemberFlag(member_witerator slot, uint8 flag, bool apply);
|
||||
@@ -321,21 +320,21 @@ protected:
|
||||
MemberSlotList m_memberSlots;
|
||||
GroupRefManager m_memberMgr;
|
||||
InvitesList m_invitees;
|
||||
uint64 m_leaderGuid;
|
||||
ObjectGuid m_leaderGuid;
|
||||
std::string m_leaderName;
|
||||
GroupType m_groupType;
|
||||
Difficulty m_dungeonDifficulty;
|
||||
Difficulty m_raidDifficulty;
|
||||
Battlefield* m_bfGroup;
|
||||
Battleground* m_bgGroup;
|
||||
uint64 m_targetIcons[TARGETICONCOUNT];
|
||||
ObjectGuid m_targetIcons[TARGETICONCOUNT];
|
||||
LootMethod m_lootMethod;
|
||||
ItemQualities m_lootThreshold;
|
||||
uint64 m_looterGuid;
|
||||
uint64 m_masterLooterGuid;
|
||||
ObjectGuid m_looterGuid;
|
||||
ObjectGuid m_masterLooterGuid;
|
||||
Rolls RollId;
|
||||
uint8* m_subGroupsCounts;
|
||||
uint64 m_guid;
|
||||
ObjectGuid m_guid;
|
||||
uint32 m_counter; // used only in SMSG_GROUP_LIST
|
||||
uint32 m_maxEnchantingLevel;
|
||||
uint8 m_lfgGroupFlags;
|
||||
|
||||
Reference in New Issue
Block a user