diff options
| author | Shauren <shauren.trinity@gmail.com> | 2014-10-26 02:57:28 +0200 |
|---|---|---|
| committer | Shauren <shauren.trinity@gmail.com> | 2014-10-26 02:57:28 +0200 |
| commit | 9e1930959db59013d6f0221d29cc652cdf2f6145 (patch) | |
| tree | 29218cc6af11c18f645eba3503583ed821975b2c /src/server/game/Groups | |
| parent | 747350a0bcffaa4ef2b5d3317bb75fac78c64472 (diff) | |
Core/Entities: Changed object lowguid to uint64
Diffstat (limited to 'src/server/game/Groups')
| -rw-r--r-- | src/server/game/Groups/Group.cpp | 24 | ||||
| -rw-r--r-- | src/server/game/Groups/Group.h | 1 | ||||
| -rw-r--r-- | src/server/game/Groups/GroupMgr.cpp | 8 | ||||
| -rw-r--r-- | src/server/game/Groups/GroupMgr.h | 6 |
4 files changed, 16 insertions, 23 deletions
diff --git a/src/server/game/Groups/Group.cpp b/src/server/game/Groups/Group.cpp index 80e3b0388df..6109524cd21 100644 --- a/src/server/game/Groups/Group.cpp +++ b/src/server/game/Groups/Group.cpp @@ -92,9 +92,8 @@ Group::~Group() bool Group::Create(Player* leader) { ObjectGuid leaderGuid = leader->GetGUID(); - uint32 lowguid = sGroupMgr->GenerateGroupId(); - m_guid = ObjectGuid(HIGHGUID_GROUP, lowguid); + m_guid = ObjectGuid(HIGHGUID_GROUP, sGroupMgr->GenerateGroupId()); m_leaderGuid = leaderGuid; m_leaderName = leader->GetName(); leader->SetFlag(PLAYER_FLAGS, PLAYER_FLAGS_GROUP_LEADER); @@ -164,14 +163,14 @@ void Group::LoadGroupFromDB(Field* fields) { m_dbStoreId = fields[16].GetUInt32(); m_guid = ObjectGuid(HIGHGUID_GROUP, sGroupMgr->GenerateGroupId()); - m_leaderGuid = ObjectGuid(HIGHGUID_PLAYER, fields[0].GetUInt32()); + m_leaderGuid = ObjectGuid(HIGHGUID_PLAYER, fields[0].GetUInt64()); // group leader not exist if (!sObjectMgr->GetPlayerNameByGUID(m_leaderGuid, m_leaderName)) return; m_lootMethod = LootMethod(fields[1].GetUInt8()); - m_looterGuid = ObjectGuid(HIGHGUID_PLAYER, fields[2].GetUInt32()); + m_looterGuid = ObjectGuid(HIGHGUID_PLAYER, fields[2].GetUInt64()); m_lootThreshold = ItemQualities(fields[3].GetUInt8()); for (uint8 i = 0; i < TARGETICONCOUNT; ++i) @@ -193,7 +192,7 @@ void Group::LoadGroupFromDB(Field* fields) else m_raidDifficulty = Difficulty(r_diff); - m_masterLooterGuid = ObjectGuid(HIGHGUID_PLAYER, fields[15].GetUInt32()); + m_masterLooterGuid = ObjectGuid(HIGHGUID_PLAYER, fields[15].GetUInt64()); if (m_groupType & GROUPTYPE_LFG) sLFGMgr->_LoadFromDB(fields, GetGUID()); @@ -565,7 +564,7 @@ bool Group::RemoveMember(ObjectGuid guid, const RemoveMethod& method /*= GROUP_R if (!isBGGroup() && !isBFGroup()) { PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GROUP_MEMBER); - stmt->setUInt32(0, guid.GetCounter()); + stmt->setUInt64(0, guid.GetCounter()); CharacterDatabase.Execute(stmt); DelinkMember(guid); } @@ -959,7 +958,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)) { - ObjectGuid newitemGUID = ObjectGuid(HIGHGUID_ITEM, sObjectMgr->GenerateLowGuid(HIGHGUID_ITEM)); + ObjectGuid newitemGUID = ObjectGuid(HIGHGUID_ITEM, sObjectMgr->GetGenerator<HIGHGUID_ITEM>()->Generate()); Roll* r = new Roll(newitemGUID, *i); //a vector is filled with only near party members @@ -1043,7 +1042,7 @@ void Group::GroupLoot(Loot* loot, WorldObject* pLootedObject) continue; } - ObjectGuid newitemGUID = ObjectGuid(HIGHGUID_ITEM, sObjectMgr->GenerateLowGuid(HIGHGUID_ITEM)); + ObjectGuid newitemGUID = ObjectGuid(HIGHGUID_ITEM, sObjectMgr->GetGenerator<HIGHGUID_ITEM>()->Generate()); Roll* r = new Roll(newitemGUID, *i); //a vector is filled with only near party members @@ -1104,7 +1103,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)) { - ObjectGuid newitemGUID = ObjectGuid(HIGHGUID_ITEM, sObjectMgr->GenerateLowGuid(HIGHGUID_ITEM)); + ObjectGuid newitemGUID = ObjectGuid(HIGHGUID_ITEM, sObjectMgr->GetGenerator<HIGHGUID_ITEM>()->Generate()); Roll* r = new Roll(newitemGUID, *i); for (GroupReference* itr = GetFirstMember(); itr != NULL; itr = itr->next()) @@ -1179,7 +1178,7 @@ void Group::NeedBeforeGreed(Loot* loot, WorldObject* lootedObject) continue; item = sObjectMgr->GetItemTemplate(i->itemid); - ObjectGuid newitemGUID = ObjectGuid(HIGHGUID_ITEM, sObjectMgr->GenerateLowGuid(HIGHGUID_ITEM)); + ObjectGuid newitemGUID = ObjectGuid(HIGHGUID_ITEM, sObjectMgr->GetGenerator<HIGHGUID_ITEM>()->Generate()); Roll* r = new Roll(newitemGUID, *i); for (GroupReference* itr = GetFirstMember(); itr != NULL; itr = itr->next()) @@ -2266,11 +2265,6 @@ ObjectGuid Group::GetGUID() const return m_guid; } -uint32 Group::GetLowGUID() const -{ - return m_guid.GetCounter(); -} - char const* Group::GetLeaderName() const { return m_leaderName.c_str(); diff --git a/src/server/game/Groups/Group.h b/src/server/game/Groups/Group.h index b5946a73a17..0bdfbf24a71 100644 --- a/src/server/game/Groups/Group.h +++ b/src/server/game/Groups/Group.h @@ -215,7 +215,6 @@ class Group bool IsCreated() const; ObjectGuid GetLeaderGUID() const; ObjectGuid GetGUID() const; - uint32 GetLowGUID() const; const char * GetLeaderName() const; LootMethod GetLootMethod() const; ObjectGuid GetLooterGuid() const; diff --git a/src/server/game/Groups/GroupMgr.cpp b/src/server/game/Groups/GroupMgr.cpp index 4a2384d0918..92f9bbd20d4 100644 --- a/src/server/game/Groups/GroupMgr.cpp +++ b/src/server/game/Groups/GroupMgr.cpp @@ -24,7 +24,7 @@ GroupMgr::GroupMgr() { NextGroupDbStoreId = 1; - NextGroupId = 1; + NextGroupId = UI64LIT(1); } GroupMgr::~GroupMgr() @@ -82,7 +82,7 @@ Group* GroupMgr::GetGroupByDbStoreId(uint32 storageId) const return NULL; } -uint32 GroupMgr::GenerateGroupId() +ObjectGuid::LowType GroupMgr::GenerateGroupId() { if (NextGroupId >= 0xFFFFFFFE) { @@ -103,12 +103,12 @@ Group* GroupMgr::GetGroupByGUID(ObjectGuid const& groupId) const void GroupMgr::AddGroup(Group* group) { - GroupStore[group->GetLowGUID()] = group; + GroupStore[group->GetGUID().GetCounter()] = group; } void GroupMgr::RemoveGroup(Group* group) { - GroupStore.erase(group->GetLowGUID()); + GroupStore.erase(group->GetGUID().GetCounter()); } void GroupMgr::LoadGroups() diff --git a/src/server/game/Groups/GroupMgr.h b/src/server/game/Groups/GroupMgr.h index 3e053921f74..74cbbf8df35 100644 --- a/src/server/game/Groups/GroupMgr.h +++ b/src/server/game/Groups/GroupMgr.h @@ -33,7 +33,7 @@ public: return &instance; } - typedef std::map<uint32, Group*> GroupContainer; + typedef std::map<ObjectGuid::LowType, Group*> GroupContainer; typedef std::vector<Group*> GroupDbContainer; Group* GetGroupByGUID(ObjectGuid const& guid) const; @@ -46,13 +46,13 @@ public: void SetGroupDbStoreSize(uint32 newSize) { GroupDbStore.resize(newSize); } void LoadGroups(); - uint32 GenerateGroupId(); + ObjectGuid::LowType GenerateGroupId(); void AddGroup(Group* group); void RemoveGroup(Group* group); protected: - uint32 NextGroupId; + ObjectGuid::LowType NextGroupId; uint32 NextGroupDbStoreId; GroupContainer GroupStore; GroupDbContainer GroupDbStore; |
