Core/Dungeon Finder: Move all LFG data from Player and Group classes to internal LFG data classes.

--HG--
branch : trunk
This commit is contained in:
Spp
2010-12-16 10:53:21 +01:00
parent 451a6f40d4
commit 4671500172
15 changed files with 615 additions and 259 deletions
+13 -4
View File
@@ -66,6 +66,7 @@
#include "ConditionMgr.h"
#include "DisableMgr.h"
#include "WeatherMgr.h"
#include "LFGMgr.h"
#include <cmath>
#define ZONE_UPDATE_INTERVAL (1*IN_MILLISECONDS)
@@ -22202,16 +22203,18 @@ PartyResult Player::CanUninviteFromGroup() const
if (grp->isLFGGroup())
{
if (grp->GetLfgKicks() == GROUP_MAX_LFG_KICKS)
uint64 gguid = grp->GetGUID();
if (!sLFGMgr.GetKicksLeft(gguid))
return ERR_PARTY_LFG_BOOT_LIMIT;
if (GetLfgState() == LFG_STATE_BOOT)
LfgState state = sLFGMgr.GetState(gguid);
if (state == LFG_STATE_BOOT)
return ERR_PARTY_LFG_BOOT_IN_PROGRESS;
if (grp->GetMembersCount() <= GROUP_LFG_KICK_VOTES_NEEDED)
if (grp->GetMembersCount() <= sLFGMgr.GetVotesNeeded(gguid))
return ERR_PARTY_LFG_BOOT_TOO_FEW_PLAYERS;
if (GetLfgState() == LFG_STATE_FINISHED_DUNGEON)
if (state == LFG_STATE_FINISHED_DUNGEON)
return ERR_PARTY_LFG_BOOT_DUNGEON_COMPLETE;
if (grp->isRollLootActive())
@@ -22235,6 +22238,12 @@ PartyResult Player::CanUninviteFromGroup() const
return ERR_PARTY_RESULT_OK;
}
bool Player::isUsingLfg()
{
uint64 guid = GetGUID();
return sLFGMgr.GetState(guid) != LFG_STATE_NONE;
}
void Player::SetBattlegroundRaid(Group* group, int8 subgroup)
{
//we must move references from m_group to m_originalGroup
+1 -31
View File
@@ -28,7 +28,6 @@
#include "GroupReference.h"
#include "ItemPrototype.h"
#include "Item.h"
#include "LFG.h"
#include "MapReference.h"
#include "NPCHandler.h"
#include "Pet.h"
@@ -2255,34 +2254,7 @@ class Player : public Unit, public GridObject<Player>
void SetAtLoginFlag(AtLoginFlags f) { m_atLoginFlags |= f; }
void RemoveAtLoginFlag(AtLoginFlags f, bool in_db_also = false);
// Dungeon Finder
LfgDungeonSet *GetLfgDungeons() { return &m_LookingForGroup.applyDungeons; }
std::string GetLfgComment() { return m_LookingForGroup.comment; }
void SetLfgComment(std::string _comment) { m_LookingForGroup.comment = _comment; }
uint8 GetLfgRoles() { return m_LookingForGroup.roles; }
void SetLfgRoles(uint8 _roles) { m_LookingForGroup.roles = _roles; }
LfgState GetLfgState() const { return m_LookingForGroup.state; }
void SetLfgState(LfgState state)
{
switch(state)
{
case LFG_STATE_NONE:
case LFG_STATE_DUNGEON:
case LFG_STATE_FINISHED_DUNGEON:
m_LookingForGroup.oldState = state;
// No break on purpose
default:
m_LookingForGroup.state = state;
}
}
void ClearLfgState()
{
m_LookingForGroup.applyDungeons.clear();
m_LookingForGroup.roles = ROLE_NONE;
m_LookingForGroup.state = m_LookingForGroup.oldState;
}
bool isUsingLfg() { return GetLfgState() != LFG_STATE_NONE; }
bool isUsingLfg();
typedef std::set<uint32> DFQuestsDoneList;
DFQuestsDoneList m_DFQuests;
@@ -2711,8 +2683,6 @@ class Player : public Unit, public GridObject<Player>
uint32 m_timeSyncTimer;
uint32 m_timeSyncClient;
uint32 m_timeSyncServer;
LookingForGroup m_LookingForGroup;
};
void AddItemsSetItem(Player*player,Item *item);