Proper naming of LfgDungeon structures
This commit is contained in:
@@ -118,7 +118,7 @@ DBCStorage <ItemRandomPropertiesEntry> sItemRandomPropertiesStore(ItemRandomProp
|
||||
DBCStorage <ItemRandomSuffixEntry> sItemRandomSuffixStore(ItemRandomSuffixfmt);
|
||||
DBCStorage <ItemSetEntry> sItemSetStore(ItemSetEntryfmt);
|
||||
|
||||
DBCStorage <LFGDungeonEntryDbc> sLFGDungeonStore(LFGDungeonEntryfmt);
|
||||
DBCStorage <LFGDungeonEntry> sLFGDungeonStore(LFGDungeonEntryfmt);
|
||||
DBCStorage <LiquidTypeEntry> sLiquidTypeStore(LiquidTypefmt);
|
||||
DBCStorage <LockEntry> sLockStore(LockEntryfmt);
|
||||
|
||||
|
||||
@@ -120,7 +120,7 @@ extern DBCStorage <ItemLimitCategoryEntry> sItemLimitCategoryStore;
|
||||
extern DBCStorage <ItemRandomPropertiesEntry> sItemRandomPropertiesStore;
|
||||
extern DBCStorage <ItemRandomSuffixEntry> sItemRandomSuffixStore;
|
||||
extern DBCStorage <ItemSetEntry> sItemSetStore;
|
||||
extern DBCStorage <LFGDungeonEntryDbc> sLFGDungeonStore;
|
||||
extern DBCStorage <LFGDungeonEntry> sLFGDungeonStore;
|
||||
extern DBCStorage <LiquidTypeEntry> sLiquidTypeStore;
|
||||
extern DBCStorage <LockEntry> sLockStore;
|
||||
extern DBCStorage <MailTemplateEntry> sMailTemplateStore;
|
||||
|
||||
@@ -1193,7 +1193,7 @@ struct ItemSetEntry
|
||||
uint32 required_skill_value; // 52 m_requiredSkillRank
|
||||
};
|
||||
|
||||
struct LFGDungeonEntryDbc
|
||||
struct LFGDungeonEntry
|
||||
{
|
||||
uint32 ID; // 0
|
||||
char* name[16]; // 1-17 Name lang
|
||||
|
||||
@@ -239,7 +239,7 @@ void LFGMgr::LoadRewards()
|
||||
sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u lfg dungeon rewards in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
|
||||
}
|
||||
|
||||
LFGDungeonEntry const* LFGMgr::GetLFGDungeon(uint32 id)
|
||||
LFGDungeonData const* LFGMgr::GetLFGDungeon(uint32 id)
|
||||
{
|
||||
LFGDungeonMap::const_iterator itr = m_LfgDungeonMap.find(id);
|
||||
if (itr != m_LfgDungeonMap.end())
|
||||
@@ -262,7 +262,7 @@ void LFGMgr::LoadLFGDungeons(bool reload /* = false */)
|
||||
// Initialize Dungeon map with data from dbcs
|
||||
for (uint32 i = 0; i < sLFGDungeonStore.GetNumRows(); ++i)
|
||||
{
|
||||
LFGDungeonEntryDbc const* dungeon = sLFGDungeonStore.LookupEntry(i);
|
||||
LFGDungeonEntry const* dungeon = sLFGDungeonStore.LookupEntry(i);
|
||||
if (!dungeon)
|
||||
continue;
|
||||
|
||||
@@ -272,7 +272,7 @@ void LFGMgr::LoadLFGDungeons(bool reload /* = false */)
|
||||
case LFG_TYPE_HEROIC:
|
||||
case LFG_TYPE_RAID:
|
||||
case LFG_TYPE_RANDOM:
|
||||
m_LfgDungeonMap[dungeon->ID] = LFGDungeonEntry(dungeon);
|
||||
m_LfgDungeonMap[dungeon->ID] = LFGDungeonData(dungeon);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -299,7 +299,7 @@ void LFGMgr::LoadLFGDungeons(bool reload /* = false */)
|
||||
continue;
|
||||
}
|
||||
|
||||
LFGDungeonEntry& data = dungeonItr->second;
|
||||
LFGDungeonData& data = dungeonItr->second;
|
||||
data.x = fields[1].GetFloat();
|
||||
data.y = fields[2].GetFloat();
|
||||
data.z = fields[3].GetFloat();
|
||||
@@ -314,7 +314,7 @@ void LFGMgr::LoadLFGDungeons(bool reload /* = false */)
|
||||
// Fill all other teleport coords from areatriggers
|
||||
for (LFGDungeonMap::iterator itr = m_LfgDungeonMap.begin(); itr != m_LfgDungeonMap.end(); ++itr)
|
||||
{
|
||||
LFGDungeonEntry& dungeon = itr->second;
|
||||
LFGDungeonData& dungeon = itr->second;
|
||||
// No teleport coords in database, load from areatriggers
|
||||
if (dungeon.x == 0.0f && dungeon.y == 0.0f && dungeon.z == 0.0f)
|
||||
{
|
||||
@@ -462,7 +462,7 @@ void LFGMgr::InitializeLockedDungeons(Player* player, uint8 level /* = 0 */)
|
||||
|
||||
for (LfgDungeonSet::const_iterator it = dungeons.begin(); it != dungeons.end(); ++it)
|
||||
{
|
||||
LFGDungeonEntry const* dungeon = GetLFGDungeon(*it);
|
||||
LFGDungeonData const* dungeon = GetLFGDungeon(*it);
|
||||
if (!dungeon) // should never happen - We provide a list from sLFGDungeonStore
|
||||
continue;
|
||||
|
||||
@@ -1014,7 +1014,7 @@ void LFGMgr::MakeNewGroup(const LfgProposal& proposal)
|
||||
}
|
||||
|
||||
// Set the dungeon difficulty
|
||||
LFGDungeonEntry const* dungeon = GetLFGDungeon(proposal.dungeonId);
|
||||
LFGDungeonData const* dungeon = GetLFGDungeon(proposal.dungeonId);
|
||||
ASSERT(dungeon);
|
||||
|
||||
Group* grp = proposal.group ? sGroupMgr->GetGroupByGUID(GUID_LOPART(proposal.group)) : NULL;
|
||||
@@ -1384,7 +1384,7 @@ void LFGMgr::TeleportPlayer(Player* player, bool out, bool fromOpcode /*= false*
|
||||
|
||||
Group* grp = player->GetGroup();
|
||||
uint64 gguid = grp->GetGUID();
|
||||
LFGDungeonEntry const* dungeon = GetLFGDungeon(GetDungeon(gguid));
|
||||
LFGDungeonData const* dungeon = GetLFGDungeon(GetDungeon(gguid));
|
||||
if (!dungeon || (out && player->GetMapId() != uint32(dungeon->map)))
|
||||
return;
|
||||
|
||||
@@ -1501,7 +1501,7 @@ void LFGMgr::RewardDungeonDoneFor(const uint32 dungeonId, Player* player)
|
||||
SetState(guid, LFG_STATE_FINISHED_DUNGEON);
|
||||
|
||||
// Give rewards only if its a random or seasonal dungeon
|
||||
LFGDungeonEntry const* dungeon = GetLFGDungeon(rDungeonId);
|
||||
LFGDungeonData const* dungeon = GetLFGDungeon(rDungeonId);
|
||||
if (!dungeon || (dungeon->type != LFG_TYPE_RANDOM && !dungeon->seasonal))
|
||||
{
|
||||
sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::RewardDungeonDoneFor: [" UI64FMTD "] dungeon %u is not random nor seasonal", guid, rDungeonId);
|
||||
@@ -1551,7 +1551,7 @@ void LFGMgr::RewardDungeonDoneFor(const uint32 dungeonId, Player* player)
|
||||
*/
|
||||
const LfgDungeonSet& LFGMgr::GetDungeonsByRandom(uint32 randomdungeon)
|
||||
{
|
||||
LFGDungeonEntry const* dungeon = GetLFGDungeon(randomdungeon);
|
||||
LFGDungeonData const* dungeon = GetLFGDungeon(randomdungeon);
|
||||
uint32 group = dungeon ? dungeon->group : 0;
|
||||
return m_CachedDungeonMap[group];
|
||||
}
|
||||
@@ -1586,7 +1586,7 @@ LfgReward const* LFGMgr::GetRandomDungeonReward(uint32 dungeon, uint8 level)
|
||||
*/
|
||||
LfgType LFGMgr::GetDungeonType(uint32 dungeonId)
|
||||
{
|
||||
LFGDungeonEntry const* dungeon = GetLFGDungeon(dungeonId);
|
||||
LFGDungeonData const* dungeon = GetLFGDungeon(dungeonId);
|
||||
if (!dungeon)
|
||||
return LFG_TYPE_NONE;
|
||||
|
||||
|
||||
@@ -117,7 +117,7 @@ enum LfgRoleCheckState
|
||||
};
|
||||
|
||||
// Forward declaration (just to have all typedef together)
|
||||
struct LFGDungeonEntry;
|
||||
struct LFGDungeonData;
|
||||
struct LfgReward;
|
||||
struct LfgQueueInfo;
|
||||
struct LfgRoleCheck;
|
||||
@@ -136,7 +136,7 @@ typedef std::map<uint64, LfgProposalPlayer> LfgProposalPlayerMap;
|
||||
typedef std::map<uint64, LfgPlayerBoot> LfgPlayerBootMap;
|
||||
typedef std::map<uint64, LfgGroupData> LfgGroupDataMap;
|
||||
typedef std::map<uint64, LfgPlayerData> LfgPlayerDataMap;
|
||||
typedef UNORDERED_MAP<uint32, LFGDungeonEntry> LFGDungeonMap;
|
||||
typedef UNORDERED_MAP<uint32, LFGDungeonData> LFGDungeonMap;
|
||||
|
||||
// Data needed by SMSG_LFG_JOIN_RESULT
|
||||
struct LfgJoinResultData
|
||||
@@ -251,12 +251,12 @@ struct LfgPlayerBoot
|
||||
std::string reason; ///< kick reason
|
||||
};
|
||||
|
||||
struct LFGDungeonEntry
|
||||
struct LFGDungeonData
|
||||
{
|
||||
LFGDungeonEntry(): id(0), name(""), map(0), type(0), expansion(0), group(0), minlevel(0),
|
||||
LFGDungeonData(): id(0), name(""), map(0), type(0), expansion(0), group(0), minlevel(0),
|
||||
maxlevel(0), difficulty(REGULAR_DIFFICULTY), seasonal(false), x(0.0f), y(0.0f), z(0.0f), o(0.0f)
|
||||
{ }
|
||||
LFGDungeonEntry(LFGDungeonEntryDbc const* dbc): id(dbc->ID), name(dbc->name[0]), map(dbc->map),
|
||||
LFGDungeonData(LFGDungeonEntry const* dbc): id(dbc->ID), name(dbc->name[0]), map(dbc->map),
|
||||
type(dbc->type), expansion(dbc->expansion), group(dbc->grouptype),
|
||||
minlevel(dbc->minlevel), maxlevel(dbc->maxlevel), difficulty(Difficulty(dbc->difficulty)),
|
||||
seasonal(dbc->flags & LFG_FLAG_SEASONAL), x(0.0f), y(0.0f), z(0.0f), o(0.0f)
|
||||
@@ -358,7 +358,7 @@ class LFGMgr
|
||||
static char const * GetStateString(LfgState state);
|
||||
|
||||
void LoadLFGDungeons(bool reload = false);
|
||||
LFGDungeonEntry const* GetLFGDungeon(uint32 id);
|
||||
LFGDungeonData const* GetLFGDungeon(uint32 id);
|
||||
LFGDungeonMap& GetLFGDungeonMap();
|
||||
|
||||
void ClearState(uint64 guid, char const *debugMsg);
|
||||
|
||||
@@ -11901,7 +11901,7 @@ InventoryResult Player::CanRollForItemInLFG(ItemTemplate const* proto, WorldObje
|
||||
bool lootedObjectInDungeon = false;
|
||||
Map const* map = lootedObject->GetMap();
|
||||
if (uint32 dungeonId = sLFGMgr->GetDungeon(GetGroup()->GetGUID(), true))
|
||||
if (LFGDungeonEntry const* dungeon = sLFGMgr->GetLFGDungeon(dungeonId))
|
||||
if (LFGDungeonData const* dungeon = sLFGMgr->GetLFGDungeon(dungeonId))
|
||||
if (uint32(dungeon->map) == map->GetId() && dungeon->difficulty == uint32(map->GetDifficulty()))
|
||||
lootedObjectInDungeon = true;
|
||||
|
||||
@@ -23304,7 +23304,7 @@ bool Player::inRandomLfgDungeon()
|
||||
const LfgDungeonSet& dungeons = sLFGMgr->GetSelectedDungeons(GetGUID());
|
||||
if (!dungeons.empty())
|
||||
{
|
||||
LFGDungeonEntry const* dungeon = sLFGMgr->GetLFGDungeon(*dungeons.begin());
|
||||
LFGDungeonData const* dungeon = sLFGMgr->GetLFGDungeon(*dungeons.begin());
|
||||
if (dungeon && (dungeon->type == LFG_TYPE_RANDOM || dungeon->seasonal))
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -600,7 +600,7 @@ bool Group::RemoveMember(uint64 guid, const RemoveMethod &method /*= GROUP_REMOV
|
||||
if (isLFGGroup() && GetMembersCount() == 1)
|
||||
{
|
||||
Player* Leader = ObjectAccessor::FindPlayer(GetLeaderGUID());
|
||||
LFGDungeonEntry const* dungeon = sLFGMgr->GetLFGDungeon(sLFGMgr->GetDungeon(GetGUID()));
|
||||
LFGDungeonData const* dungeon = sLFGMgr->GetLFGDungeon(sLFGMgr->GetDungeon(GetGUID()));
|
||||
if ((Leader && dungeon && Leader->isAlive() && Leader->GetMapId() != uint32(dungeon->map)) || !dungeon)
|
||||
{
|
||||
Disband();
|
||||
|
||||
@@ -165,7 +165,7 @@ void WorldSession::HandleLfgPlayerLockInfoRequestOpcode(WorldPacket& /*recv_data
|
||||
LFGDungeonMap& LfgDungeons = sLFGMgr->GetLFGDungeonMap();
|
||||
for (LFGDungeonMap::const_iterator itr = LfgDungeons.begin(); itr != LfgDungeons.end(); ++itr)
|
||||
{
|
||||
LFGDungeonEntry const& dungeon = itr->second;
|
||||
LFGDungeonData const& dungeon = itr->second;
|
||||
if ((dungeon.type == LFG_TYPE_RANDOM || (dungeon.seasonal && sLFGMgr->IsSeasonActive(dungeon.id)))
|
||||
&& dungeon.expansion <= expansion && dungeon.minlevel <= level && level <= dungeon.maxlevel)
|
||||
randomDungeons.insert(dungeon.Entry());
|
||||
@@ -403,7 +403,7 @@ void WorldSession::SendLfgRoleCheckUpdate(const LfgRoleCheck& roleCheck)
|
||||
{
|
||||
for (LfgDungeonSet::iterator it = dungeons.begin(); it != dungeons.end(); ++it)
|
||||
{
|
||||
LFGDungeonEntry const* dungeon = sLFGMgr->GetLFGDungeon(*it);
|
||||
LFGDungeonData const* dungeon = sLFGMgr->GetLFGDungeon(*it);
|
||||
data << uint32(dungeon ? dungeon->Entry() : 0); // Dungeon
|
||||
}
|
||||
}
|
||||
@@ -552,7 +552,7 @@ void WorldSession::SendLfgUpdateProposal(uint32 proposalId, LfgProposal const& p
|
||||
dungeonEntry = (*playerDungeons.begin());
|
||||
}
|
||||
|
||||
if (LFGDungeonEntry const* dungeon = sLFGMgr->GetLFGDungeon(dungeonEntry))
|
||||
if (LFGDungeonData const* dungeon = sLFGMgr->GetLFGDungeon(dungeonEntry))
|
||||
dungeonEntry = dungeon->Entry();
|
||||
|
||||
data << uint32(dungeonEntry); // Dungeon
|
||||
|
||||
@@ -2468,8 +2468,8 @@ bool InstanceMap::AddPlayerToMap(Player* player)
|
||||
|
||||
if (group && group->isLFGGroup())
|
||||
if (uint32 dungeonId = sLFGMgr->GetDungeon(group->GetGUID(), true))
|
||||
if (LFGDungeonEntry const* dungeon = sLFGMgr->GetLFGDungeon(dungeonId))
|
||||
if (LFGDungeonEntry const* randomDungeon = sLFGMgr->GetLFGDungeon(*(sLFGMgr->GetSelectedDungeons(player->GetGUID()).begin())))
|
||||
if (LFGDungeonData const* dungeon = sLFGMgr->GetLFGDungeon(dungeonId))
|
||||
if (LFGDungeonData const* randomDungeon = sLFGMgr->GetLFGDungeon(*(sLFGMgr->GetSelectedDungeons(player->GetGUID()).begin())))
|
||||
if (uint32(dungeon->map) == GetId() && dungeon->difficulty == uint32(GetDifficulty()) && randomDungeon->type == uint32(LFG_TYPE_RANDOM))
|
||||
player->CastSpell(player, LFG_SPELL_LUCK_OF_THE_DRAW, true);
|
||||
}
|
||||
|
||||
@@ -1581,12 +1581,12 @@ class spell_gen_luck_of_the_draw : public SpellScriptLoader
|
||||
}
|
||||
|
||||
|
||||
LFGDungeonEntry const* randomDungeon = sLFGMgr->GetLFGDungeon(*itr);
|
||||
LFGDungeonData const* randomDungeon = sLFGMgr->GetLFGDungeon(*itr);
|
||||
if (Group* group = owner->GetGroup())
|
||||
if (Map const* map = owner->GetMap())
|
||||
if (group->isLFGGroup())
|
||||
if (uint32 dungeonId = sLFGMgr->GetDungeon(group->GetGUID(), true))
|
||||
if (LFGDungeonEntry const* dungeon = sLFGMgr->GetLFGDungeon(dungeonId))
|
||||
if (LFGDungeonData const* dungeon = sLFGMgr->GetLFGDungeon(dungeonId))
|
||||
if (uint32(dungeon->map) == map->GetId() && dungeon->difficulty == uint32(map->GetDifficulty()))
|
||||
if (randomDungeon && randomDungeon->type == LFG_TYPE_RANDOM)
|
||||
return; // in correct dungeon
|
||||
|
||||
Reference in New Issue
Block a user