diff options
Diffstat (limited to 'src/server/game/Groups/Group.cpp')
-rw-r--r-- | src/server/game/Groups/Group.cpp | 174 |
1 files changed, 87 insertions, 87 deletions
diff --git a/src/server/game/Groups/Group.cpp b/src/server/game/Groups/Group.cpp index bf11885c024..df34c12e332 100644 --- a/src/server/game/Groups/Group.cpp +++ b/src/server/game/Groups/Group.cpp @@ -36,7 +36,7 @@ #include "LFGMgr.h" #include "UpdateFieldFlags.h" -Roll::Roll(uint64 _guid, LootItem const& li) : itemGUID(_guid), itemid(li.itemid), +Roll::Roll(ObjectGuid _guid, LootItem const& li) : itemGUID(_guid), itemid(li.itemid), itemRandomPropId(li.randomPropertyId), itemRandomSuffix(li.randomSuffix), itemCount(li.count), totalPlayersRolling(0), totalNeed(0), totalGreed(0), totalPass(0), itemSlot(0), rollVoteMask(ROLL_ALL_TYPE_NO_DISENCHANT) { } @@ -53,13 +53,13 @@ Loot* Roll::getLoot() return getTarget(); } -Group::Group() : m_leaderGuid(0), m_leaderName(""), m_groupType(GROUPTYPE_NORMAL), +Group::Group() : m_leaderGuid(), m_leaderName(""), m_groupType(GROUPTYPE_NORMAL), m_dungeonDifficulty(DUNGEON_DIFFICULTY_NORMAL), m_raidDifficulty(RAID_DIFFICULTY_10MAN_NORMAL), -m_bgGroup(NULL), m_bfGroup(NULL), m_lootMethod(FREE_FOR_ALL), m_lootThreshold(ITEM_QUALITY_UNCOMMON), m_looterGuid(0), -m_masterLooterGuid(0), m_subGroupsCounts(NULL), m_guid(0), m_counter(0), m_maxEnchantingLevel(0), m_dbStoreId(0) +m_bgGroup(NULL), m_bfGroup(NULL), m_lootMethod(FREE_FOR_ALL), m_lootThreshold(ITEM_QUALITY_UNCOMMON), m_looterGuid(), +m_masterLooterGuid(), m_subGroupsCounts(NULL), m_guid(), m_counter(0), m_maxEnchantingLevel(0), m_dbStoreId(0) { for (uint8 i = 0; i < TARGETICONCOUNT; ++i) - m_targetIcons[i] = 0; + m_targetIcons[i].Clear(); } Group::~Group() @@ -91,10 +91,10 @@ Group::~Group() bool Group::Create(Player* leader) { - uint64 leaderGuid = leader->GetGUID(); + ObjectGuid leaderGuid = leader->GetGUID(); uint32 lowguid = sGroupMgr->GenerateGroupId(); - m_guid = MAKE_NEW_GUID(lowguid, 0, HIGHGUID_GROUP); + m_guid = ObjectGuid(HIGHGUID_GROUP, lowguid); m_leaderGuid = leaderGuid; m_leaderName = leader->GetName(); leader->SetFlag(PLAYER_FLAGS, PLAYER_FLAGS_GROUP_LEADER); @@ -110,7 +110,7 @@ bool Group::Create(Player* leader) m_lootThreshold = ITEM_QUALITY_UNCOMMON; m_looterGuid = leaderGuid; - m_masterLooterGuid = 0; + m_masterLooterGuid.Clear(); m_dungeonDifficulty = DUNGEON_DIFFICULTY_NORMAL; m_raidDifficulty = RAID_DIFFICULTY_10MAN_NORMAL; @@ -130,22 +130,22 @@ bool Group::Create(Player* leader) uint8 index = 0; stmt->setUInt32(index++, m_dbStoreId); - stmt->setUInt32(index++, GUID_LOPART(m_leaderGuid)); + stmt->setUInt32(index++, m_leaderGuid.GetCounter()); stmt->setUInt8(index++, uint8(m_lootMethod)); - stmt->setUInt32(index++, GUID_LOPART(m_looterGuid)); + stmt->setUInt32(index++, m_looterGuid.GetCounter()); stmt->setUInt8(index++, uint8(m_lootThreshold)); - stmt->setUInt32(index++, uint32(m_targetIcons[0])); - stmt->setUInt32(index++, uint32(m_targetIcons[1])); - stmt->setUInt32(index++, uint32(m_targetIcons[2])); - stmt->setUInt32(index++, uint32(m_targetIcons[3])); - stmt->setUInt32(index++, uint32(m_targetIcons[4])); - stmt->setUInt32(index++, uint32(m_targetIcons[5])); - stmt->setUInt32(index++, uint32(m_targetIcons[6])); - stmt->setUInt32(index++, uint32(m_targetIcons[7])); + stmt->setUInt64(index++, m_targetIcons[0].GetRawValue()); + stmt->setUInt64(index++, m_targetIcons[1].GetRawValue()); + stmt->setUInt64(index++, m_targetIcons[2].GetRawValue()); + stmt->setUInt64(index++, m_targetIcons[3].GetRawValue()); + stmt->setUInt64(index++, m_targetIcons[4].GetRawValue()); + stmt->setUInt64(index++, m_targetIcons[5].GetRawValue()); + stmt->setUInt64(index++, m_targetIcons[6].GetRawValue()); + stmt->setUInt64(index++, m_targetIcons[7].GetRawValue()); stmt->setUInt8(index++, uint8(m_groupType)); stmt->setUInt32(index++, uint8(m_dungeonDifficulty)); stmt->setUInt32(index++, uint8(m_raidDifficulty)); - stmt->setUInt32(index++, GUID_LOPART(m_masterLooterGuid)); + stmt->setUInt32(index++, m_masterLooterGuid.GetCounter()); CharacterDatabase.Execute(stmt); @@ -163,19 +163,19 @@ bool Group::Create(Player* leader) void Group::LoadGroupFromDB(Field* fields) { m_dbStoreId = fields[16].GetUInt32(); - m_guid = MAKE_NEW_GUID(sGroupMgr->GenerateGroupId(), 0, HIGHGUID_GROUP); - m_leaderGuid = MAKE_NEW_GUID(fields[0].GetUInt32(), 0, HIGHGUID_PLAYER); + m_guid = ObjectGuid(HIGHGUID_GROUP, sGroupMgr->GenerateGroupId()); + m_leaderGuid = ObjectGuid(HIGHGUID_PLAYER, fields[0].GetUInt32()); // group leader not exist - if (!sObjectMgr->GetPlayerNameByGUID(fields[0].GetUInt32(), m_leaderName)) + if (!sObjectMgr->GetPlayerNameByGUID(m_leaderGuid, m_leaderName)) return; m_lootMethod = LootMethod(fields[1].GetUInt8()); - m_looterGuid = MAKE_NEW_GUID(fields[2].GetUInt32(), 0, HIGHGUID_PLAYER); + m_looterGuid = ObjectGuid(HIGHGUID_PLAYER, fields[2].GetUInt32()); m_lootThreshold = ItemQualities(fields[3].GetUInt8()); for (uint8 i = 0; i < TARGETICONCOUNT; ++i) - m_targetIcons[i] = fields[4+i].GetUInt32(); + m_targetIcons[i].Set(fields[4 + i].GetUInt64()); m_groupType = GroupType(fields[12].GetUInt8()); if (m_groupType & GROUPTYPE_RAID) @@ -193,7 +193,7 @@ void Group::LoadGroupFromDB(Field* fields) else m_raidDifficulty = Difficulty(r_diff); - m_masterLooterGuid = MAKE_NEW_GUID(fields[15].GetUInt32(), 0, HIGHGUID_PLAYER); + m_masterLooterGuid = ObjectGuid(HIGHGUID_PLAYER, fields[15].GetUInt32()); if (m_groupType & GROUPTYPE_LFG) sLFGMgr->_LoadFromDB(fields, GetGUID()); @@ -202,7 +202,7 @@ void Group::LoadGroupFromDB(Field* fields) void Group::LoadMemberFromDB(uint32 guidLow, uint8 memberFlags, uint8 subgroup, uint8 roles) { MemberSlot member; - member.guid = MAKE_NEW_GUID(guidLow, 0, HIGHGUID_PLAYER); + member.guid = ObjectGuid(HIGHGUID_PLAYER, guidLow); // skip non-existed member if (!sObjectMgr->GetPlayerNameByGUID(member.guid, member.name)) @@ -314,7 +314,7 @@ void Group::RemoveAllInvites() m_invitees.clear(); } -Player* Group::GetInvited(uint64 guid) const +Player* Group::GetInvited(ObjectGuid guid) const { for (InvitesList::const_iterator itr = m_invitees.begin(); itr != m_invitees.end(); ++itr) { @@ -383,7 +383,7 @@ bool Group::AddMember(Player* player) if (!isRaidGroup()) // reset targetIcons for non-raid-groups { for (uint8 i = 0; i < TARGETICONCOUNT; ++i) - m_targetIcons[i] = 0; + m_targetIcons[i].Clear(); } // insert into the table if we're not a battleground group @@ -392,7 +392,7 @@ bool Group::AddMember(Player* player) PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_GROUP_MEMBER); stmt->setUInt32(0, m_dbStoreId); - stmt->setUInt32(1, GUID_LOPART(member.guid)); + stmt->setUInt32(1, member.guid.GetCounter()); stmt->setUInt8(2, member.flags); stmt->setUInt8(3, member.group); stmt->setUInt8(4, member.roles); @@ -482,7 +482,7 @@ bool Group::AddMember(Player* player) return true; } -bool Group::RemoveMember(uint64 guid, const RemoveMethod& method /*= GROUP_REMOVEMETHOD_DEFAULT*/, uint64 kicker /*= 0*/, const char* reason /*= NULL*/) +bool Group::RemoveMember(ObjectGuid guid, const RemoveMethod& method /*= GROUP_REMOVEMETHOD_DEFAULT*/, ObjectGuid kicker /*= 0*/, const char* reason /*= NULL*/) { BroadcastGroupUpdate(); @@ -534,7 +534,7 @@ bool Group::RemoveMember(uint64 guid, const RemoveMethod& method /*= GROUP_REMOV if (!isBGGroup() && !isBFGroup()) { PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GROUP_MEMBER); - stmt->setUInt32(0, GUID_LOPART(guid)); + stmt->setUInt32(0, guid.GetCounter()); CharacterDatabase.Execute(stmt); DelinkMember(guid); } @@ -613,7 +613,7 @@ bool Group::RemoveMember(uint64 guid, const RemoveMethod& method /*= GROUP_REMOV } } -void Group::ChangeLeader(uint64 newLeaderGuid) +void Group::ChangeLeader(ObjectGuid newLeaderGuid) { member_witerator slot = _getMemberWSlot(newLeaderGuid); @@ -817,7 +817,7 @@ void Group::SendLootStartRollToPlayer(uint32 countDown, uint32 mapId, Player* p, p->GetSession()->SendPacket(&data); } -void Group::SendLootRoll(uint64 sourceGuid, uint64 targetGuid, uint8 rollNumber, uint8 rollType, Roll const& roll) +void Group::SendLootRoll(ObjectGuid sourceGuid, ObjectGuid targetGuid, uint8 rollNumber, uint8 rollType, Roll const& roll) { WorldPacket data(SMSG_LOOT_ROLL, (8+4+8+4+4+4+1+1+1)); data << uint64(sourceGuid); // guid of the item rolled @@ -841,7 +841,7 @@ void Group::SendLootRoll(uint64 sourceGuid, uint64 targetGuid, uint8 rollNumber, } } -void Group::SendLootRollWon(uint64 sourceGuid, uint64 targetGuid, uint8 rollNumber, uint8 rollType, Roll const& roll) +void Group::SendLootRollWon(ObjectGuid sourceGuid, ObjectGuid targetGuid, uint8 rollNumber, uint8 rollType, Roll const& roll) { WorldPacket data(SMSG_LOOT_ROLL_WON, (8+4+4+4+4+8+1+1)); data << uint64(sourceGuid); // guid of the item rolled @@ -893,7 +893,7 @@ void Group::SendLooter(Creature* creature, Player* groupLooter) data << uint64(creature->GetGUID()); if (GetLootMethod() == MASTER_LOOT && creature->loot.hasOverThresholdItem()) - data.appendPackGUID(GetMasterLooterGuid()); + data << GetMasterLooterGuid().WriteAsPacked(); else data << uint8(0); @@ -926,7 +926,7 @@ void Group::GroupLoot(Loot* loot, WorldObject* pLootedObject) //roll for over-threshold item if it's one-player loot if (item->Quality >= uint32(m_lootThreshold)) { - uint64 newitemGUID = MAKE_NEW_GUID(sObjectMgr->GenerateLowGuid(HIGHGUID_ITEM), 0, HIGHGUID_ITEM); + ObjectGuid newitemGUID = ObjectGuid(HIGHGUID_ITEM, sObjectMgr->GenerateLowGuid(HIGHGUID_ITEM)); Roll* r = new Roll(newitemGUID, *i); //a vector is filled with only near party members @@ -1010,7 +1010,7 @@ void Group::GroupLoot(Loot* loot, WorldObject* pLootedObject) continue; } - uint64 newitemGUID = MAKE_NEW_GUID(sObjectMgr->GenerateLowGuid(HIGHGUID_ITEM), 0, HIGHGUID_ITEM); + ObjectGuid newitemGUID = ObjectGuid(HIGHGUID_ITEM, sObjectMgr->GenerateLowGuid(HIGHGUID_ITEM)); Roll* r = new Roll(newitemGUID, *i); //a vector is filled with only near party members @@ -1071,7 +1071,7 @@ void Group::NeedBeforeGreed(Loot* loot, WorldObject* lootedObject) //roll for over-threshold item if it's one-player loot if (item->Quality >= uint32(m_lootThreshold)) { - uint64 newitemGUID = MAKE_NEW_GUID(sObjectMgr->GenerateLowGuid(HIGHGUID_ITEM), 0, HIGHGUID_ITEM); + ObjectGuid newitemGUID = ObjectGuid(HIGHGUID_ITEM, sObjectMgr->GenerateLowGuid(HIGHGUID_ITEM)); Roll* r = new Roll(newitemGUID, *i); for (GroupReference* itr = GetFirstMember(); itr != NULL; itr = itr->next()) @@ -1146,7 +1146,7 @@ void Group::NeedBeforeGreed(Loot* loot, WorldObject* lootedObject) continue; item = sObjectMgr->GetItemTemplate(i->itemid); - uint64 newitemGUID = MAKE_NEW_GUID(sObjectMgr->GenerateLowGuid(HIGHGUID_ITEM), 0, HIGHGUID_ITEM); + ObjectGuid newitemGUID = ObjectGuid(HIGHGUID_ITEM, sObjectMgr->GenerateLowGuid(HIGHGUID_ITEM)); Roll* r = new Roll(newitemGUID, *i); for (GroupReference* itr = GetFirstMember(); itr != NULL; itr = itr->next()) @@ -1249,7 +1249,7 @@ void Group::MasterLoot(Loot* loot, WorldObject* pLootedObject) } } -void Group::CountRollVote(uint64 playerGUID, uint64 Guid, uint8 Choice) +void Group::CountRollVote(ObjectGuid playerGUID, ObjectGuid Guid, uint8 Choice) { Rolls::iterator rollI = GetRoll(Guid); if (rollI == RollId.end()) @@ -1268,22 +1268,22 @@ void Group::CountRollVote(uint64 playerGUID, uint64 Guid, uint8 Choice) switch (Choice) { case ROLL_PASS: // Player choose pass - SendLootRoll(0, playerGUID, 128, ROLL_PASS, *roll); + SendLootRoll(ObjectGuid::Empty, playerGUID, 128, ROLL_PASS, *roll); ++roll->totalPass; itr->second = PASS; break; case ROLL_NEED: // player choose Need - SendLootRoll(0, playerGUID, 0, 0, *roll); + SendLootRoll(ObjectGuid::Empty, playerGUID, 0, 0, *roll); ++roll->totalNeed; itr->second = NEED; break; case ROLL_GREED: // player choose Greed - SendLootRoll(0, playerGUID, 128, ROLL_GREED, *roll); + SendLootRoll(ObjectGuid::Empty, playerGUID, 128, ROLL_GREED, *roll); ++roll->totalGreed; itr->second = GREED; break; case ROLL_DISENCHANT: // player choose Disenchant - SendLootRoll(0, playerGUID, 128, ROLL_DISENCHANT, *roll); + SendLootRoll(ObjectGuid::Empty, playerGUID, 128, ROLL_DISENCHANT, *roll); ++roll->totalGreed; itr->second = DISENCHANT; break; @@ -1323,7 +1323,7 @@ void Group::CountTheRoll(Rolls::iterator rollI) if (!roll->playerVote.empty()) { uint8 maxresul = 0; - uint64 maxguid = (*roll->playerVote.begin()).first; + ObjectGuid maxguid = (*roll->playerVote.begin()).first; Player* player; for (Roll::PlayerVote::const_iterator itr=roll->playerVote.begin(); itr != roll->playerVote.end(); ++itr) @@ -1332,14 +1332,14 @@ void Group::CountTheRoll(Rolls::iterator rollI) continue; uint8 randomN = urand(1, 100); - SendLootRoll(0, itr->first, randomN, ROLL_NEED, *roll); + SendLootRoll(ObjectGuid::Empty, itr->first, randomN, ROLL_NEED, *roll); if (maxresul < randomN) { maxguid = itr->first; maxresul = randomN; } } - SendLootRollWon(0, maxguid, maxresul, ROLL_NEED, *roll); + SendLootRollWon(ObjectGuid::Empty, maxguid, maxresul, ROLL_NEED, *roll); player = ObjectAccessor::FindPlayer(maxguid); if (player && player->GetSession()) @@ -1369,7 +1369,7 @@ void Group::CountTheRoll(Rolls::iterator rollI) if (!roll->playerVote.empty()) { uint8 maxresul = 0; - uint64 maxguid = (*roll->playerVote.begin()).first; + ObjectGuid maxguid = (*roll->playerVote.begin()).first; Player* player; RollVote rollvote = NOT_VALID; @@ -1380,7 +1380,7 @@ void Group::CountTheRoll(Rolls::iterator rollI) continue; uint8 randomN = urand(1, 100); - SendLootRoll(0, itr->first, randomN, itr->second, *roll); + SendLootRoll(ObjectGuid::Empty, itr->first, randomN, itr->second, *roll); if (maxresul < randomN) { maxguid = itr->first; @@ -1388,7 +1388,7 @@ void Group::CountTheRoll(Rolls::iterator rollI) rollvote = itr->second; } } - SendLootRollWon(0, maxguid, maxresul, rollvote, *roll); + SendLootRollWon(ObjectGuid::Empty, maxguid, maxresul, rollvote, *roll); player = ObjectAccessor::FindPlayer(maxguid); if (player && player->GetSession()) @@ -1457,16 +1457,16 @@ void Group::CountTheRoll(Rolls::iterator rollI) delete roll; } -void Group::SetTargetIcon(uint8 id, uint64 whoGuid, uint64 targetGuid) +void Group::SetTargetIcon(uint8 id, ObjectGuid whoGuid, ObjectGuid targetGuid) { if (id >= TARGETICONCOUNT) return; // clean other icons - if (targetGuid != 0) + if (targetGuid) for (int i=0; i<TARGETICONCOUNT; ++i) if (m_targetIcons[i] == targetGuid) - SetTargetIcon(i, 0, 0); + SetTargetIcon(i, ObjectGuid::Empty, ObjectGuid::Empty); m_targetIcons[id] = targetGuid; @@ -1488,7 +1488,7 @@ void Group::SendTargetIconList(WorldSession* session) for (uint8 i = 0; i < TARGETICONCOUNT; ++i) { - if (m_targetIcons[i] == 0) + if (m_targetIcons[i].IsEmpty()) continue; data << uint8(i); @@ -1504,7 +1504,7 @@ void Group::SendUpdate() SendUpdateToPlayer(witr->guid, &(*witr)); } -void Group::SendUpdateToPlayer(uint64 playerGUID, MemberSlot* slot) +void Group::SendUpdateToPlayer(ObjectGuid playerGUID, MemberSlot* slot) { Player* player = ObjectAccessor::FindPlayer(playerGUID); @@ -1591,12 +1591,12 @@ void Group::UpdatePlayerOutOfRange(Player* player) } } -void Group::BroadcastPacket(WorldPacket* packet, bool ignorePlayersInBGRaid, int group, uint64 ignore) +void Group::BroadcastPacket(WorldPacket* packet, bool ignorePlayersInBGRaid, int group, ObjectGuid ignore) { for (GroupReference* itr = GetFirstMember(); itr != NULL; itr = itr->next()) { Player* player = itr->GetSource(); - if (!player || (ignore != 0 && player->GetGUID() == ignore) || (ignorePlayersInBGRaid && player->GetGroup() != this)) + if (!player || (!ignore.IsEmpty() && player->GetGUID() == ignore) || (ignorePlayersInBGRaid && player->GetGroup() != this)) continue; if (player->GetSession() && (group == -1 || itr->getSubGroup() == group)) @@ -1630,7 +1630,7 @@ void Group::OfflineReadyCheck() } } -bool Group::_setMembersGroup(uint64 guid, uint8 group) +bool Group::_setMembersGroup(ObjectGuid guid, uint8 group) { member_witerator slot = _getMemberWSlot(guid); if (slot == m_memberSlots.end()) @@ -1645,7 +1645,7 @@ bool Group::_setMembersGroup(uint64 guid, uint8 group) PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GROUP_MEMBER_SUBGROUP); stmt->setUInt8(0, group); - stmt->setUInt32(1, GUID_LOPART(guid)); + stmt->setUInt32(1, guid.GetCounter()); CharacterDatabase.Execute(stmt); } @@ -1665,7 +1665,7 @@ bool Group::SameSubGroup(Player const* member1, Player const* member2) const } // Allows setting sub groups both for online or offline members -void Group::ChangeMembersGroup(uint64 guid, uint8 group) +void Group::ChangeMembersGroup(ObjectGuid guid, uint8 group) { // Only raid groups have sub groups if (!isRaidGroup()) @@ -1696,7 +1696,7 @@ void Group::ChangeMembersGroup(uint64 guid, uint8 group) PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GROUP_MEMBER_SUBGROUP); stmt->setUInt8(0, group); - stmt->setUInt32(1, GUID_LOPART(guid)); + stmt->setUInt32(1, guid.GetCounter()); CharacterDatabase.Execute(stmt); } @@ -1736,7 +1736,7 @@ void Group::UpdateLooterGuid(WorldObject* pLootedObject, bool ifneed) if (GetLootMethod() == FREE_FOR_ALL) return; - uint64 oldLooterGUID = GetLooterGuid(); + ObjectGuid oldLooterGUID = GetLooterGuid(); member_citerator guid_itr = _getMemberCSlot(oldLooterGUID); if (guid_itr != m_memberSlots.end()) { @@ -1786,7 +1786,7 @@ void Group::UpdateLooterGuid(WorldObject* pLootedObject, bool ifneed) } else { - SetLooterGuid(0); + SetLooterGuid(ObjectGuid::Empty); SendUpdate(); } } @@ -2088,8 +2088,8 @@ InstanceGroupBind* Group::BindToInstance(InstanceSave* save, bool permanent, boo bind.save = save; bind.perm = permanent; if (!load) - TC_LOG_DEBUG("maps", "Group::BindToInstance: Group (guid: %u, storage id: %u) is now bound to map %d, instance %d, difficulty %d", - GUID_LOPART(GetGUID()), m_dbStoreId, save->GetMapId(), save->GetInstanceId(), save->GetDifficulty()); + TC_LOG_DEBUG("maps", "Group::BindToInstance: %s, storage id: %u is now bound to map %d, instance %d, difficulty %d", + GetGUID().ToString().c_str(), m_dbStoreId, save->GetMapId(), save->GetInstanceId(), save->GetDifficulty()); return &bind; } @@ -2153,12 +2153,12 @@ void Group::SetLootMethod(LootMethod method) m_lootMethod = method; } -void Group::SetLooterGuid(uint64 guid) +void Group::SetLooterGuid(ObjectGuid guid) { m_looterGuid = guid; } -void Group::SetMasterLooterGuid(uint64 guid) +void Group::SetMasterLooterGuid(ObjectGuid guid) { m_masterLooterGuid = guid; } @@ -2168,7 +2168,7 @@ void Group::SetLootThreshold(ItemQualities threshold) m_lootThreshold = threshold; } -void Group::SetLfgRoles(uint64 guid, const uint8 roles) +void Group::SetLfgRoles(ObjectGuid guid, uint8 roles) { member_witerator slot = _getMemberWSlot(guid); if (slot == m_memberSlots.end()) @@ -2208,19 +2208,19 @@ bool Group::IsCreated() const return GetMembersCount() > 0; } -uint64 Group::GetLeaderGUID() const +ObjectGuid Group::GetLeaderGUID() const { return m_leaderGuid; } -uint64 Group::GetGUID() const +ObjectGuid Group::GetGUID() const { return m_guid; } uint32 Group::GetLowGUID() const { - return GUID_LOPART(m_guid); + return m_guid.GetCounter(); } char const* Group::GetLeaderName() const @@ -2233,12 +2233,12 @@ LootMethod Group::GetLootMethod() const return m_lootMethod; } -uint64 Group::GetLooterGuid() const +ObjectGuid Group::GetLooterGuid() const { return m_looterGuid; } -uint64 Group::GetMasterLooterGuid() const +ObjectGuid Group::GetMasterLooterGuid() const { return m_masterLooterGuid; } @@ -2248,25 +2248,25 @@ ItemQualities Group::GetLootThreshold() const return m_lootThreshold; } -bool Group::IsMember(uint64 guid) const +bool Group::IsMember(ObjectGuid guid) const { return _getMemberCSlot(guid) != m_memberSlots.end(); } -bool Group::IsLeader(uint64 guid) const +bool Group::IsLeader(ObjectGuid guid) const { return (GetLeaderGUID() == guid); } -uint64 Group::GetMemberGUID(const std::string& name) +ObjectGuid Group::GetMemberGUID(const std::string& name) { for (member_citerator itr = m_memberSlots.begin(); itr != m_memberSlots.end(); ++itr) if (itr->name == name) return itr->guid; - return 0; + return ObjectGuid::Empty; } -bool Group::IsAssistant(uint64 guid) const +bool Group::IsAssistant(ObjectGuid guid) const { member_citerator mslot = _getMemberCSlot(guid); if (mslot == m_memberSlots.end()) @@ -2274,7 +2274,7 @@ bool Group::IsAssistant(uint64 guid) const return mslot->flags & MEMBER_FLAG_ASSISTANT; } -bool Group::SameSubGroup(uint64 guid1, uint64 guid2) const +bool Group::SameSubGroup(ObjectGuid guid1, ObjectGuid guid2) const { member_citerator mslot2 = _getMemberCSlot(guid2); if (mslot2 == m_memberSlots.end()) @@ -2282,7 +2282,7 @@ bool Group::SameSubGroup(uint64 guid1, uint64 guid2) const return SameSubGroup(guid1, &*mslot2); } -bool Group::SameSubGroup(uint64 guid1, MemberSlot const* slot2) const +bool Group::SameSubGroup(ObjectGuid guid1, MemberSlot const* slot2) const { member_citerator mslot1 = _getMemberCSlot(guid1); if (mslot1 == m_memberSlots.end() || !slot2) @@ -2296,7 +2296,7 @@ bool Group::HasFreeSlotSubGroup(uint8 subgroup) const } -uint8 Group::GetMemberGroup(uint64 guid) const +uint8 Group::GetMemberGroup(ObjectGuid guid) const { member_citerator mslot = _getMemberCSlot(guid); if (mslot == m_memberSlots.end()) @@ -2314,7 +2314,7 @@ void Group::SetBattlefieldGroup(Battlefield *bg) m_bfGroup = bg; } -void Group::SetGroupMemberFlag(uint64 guid, bool apply, GroupMemberFlags flag) +void Group::SetGroupMemberFlag(ObjectGuid guid, bool apply, GroupMemberFlags flag) { // Assistants, main assistants and main tanks are only available in raid groups if (!isRaidGroup()) @@ -2346,7 +2346,7 @@ void Group::SetGroupMemberFlag(uint64 guid, bool apply, GroupMemberFlags flag) PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GROUP_MEMBER_FLAG); stmt->setUInt8(0, slot->flags); - stmt->setUInt32(1, GUID_LOPART(guid)); + stmt->setUInt32(1, guid.GetCounter()); CharacterDatabase.Execute(stmt); @@ -2374,7 +2374,7 @@ bool Group::isRollLootActive() const return !RollId.empty(); } -Group::Rolls::iterator Group::GetRoll(uint64 Guid) +Group::Rolls::iterator Group::GetRoll(ObjectGuid Guid) { Rolls::iterator iter; for (iter=RollId.begin(); iter != RollId.end(); ++iter) @@ -2388,7 +2388,7 @@ void Group::LinkMember(GroupReference* pRef) m_memberMgr.insertFirst(pRef); } -void Group::DelinkMember(uint64 guid) +void Group::DelinkMember(ObjectGuid guid) { GroupReference* ref = m_memberMgr.getFirst(); while (ref) @@ -2420,7 +2420,7 @@ void Group::_initRaidSubGroupsCounter() ++m_subGroupsCounts[itr->group]; } -Group::member_citerator Group::_getMemberCSlot(uint64 Guid) const +Group::member_citerator Group::_getMemberCSlot(ObjectGuid Guid) const { for (member_citerator itr = m_memberSlots.begin(); itr != m_memberSlots.end(); ++itr) if (itr->guid == Guid) @@ -2428,7 +2428,7 @@ Group::member_citerator Group::_getMemberCSlot(uint64 Guid) const return m_memberSlots.end(); } -Group::member_witerator Group::_getMemberWSlot(uint64 Guid) +Group::member_witerator Group::_getMemberWSlot(ObjectGuid Guid) { for (member_witerator itr = m_memberSlots.begin(); itr != m_memberSlots.end(); ++itr) if (itr->guid == Guid) |