Core: Crash fix (TemporarySummon), remove some warnings and some other minor changes
- "const uint64" and "uint64 const" --> uint64 - Add some info in LFGDungeonEntry - Move some definitions from ".h" files and move to ".cpp"
This commit is contained in:
@@ -308,7 +308,7 @@ void LFGMgr::Update(uint32 diff)
|
||||
@param[in] guid Player or group guid to add to queue
|
||||
@param[in] queueId Queue Id to add player/group to
|
||||
*/
|
||||
void LFGMgr::AddToQueue(const uint64 guid, uint8 queueId)
|
||||
void LFGMgr::AddToQueue(uint64 guid, uint8 queueId)
|
||||
{
|
||||
if (sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_GROUP))
|
||||
queueId = 0;
|
||||
@@ -329,7 +329,7 @@ void LFGMgr::AddToQueue(const uint64 guid, uint8 queueId)
|
||||
@param[in] guid Player or group guid to add to queue
|
||||
@return true if guid was found in main queue.
|
||||
*/
|
||||
bool LFGMgr::RemoveFromQueue(const uint64 guid)
|
||||
bool LFGMgr::RemoveFromQueue(uint64 guid)
|
||||
{
|
||||
for (LfgGuidListMap::iterator it = m_currentQueue.begin(); it != m_currentQueue.end(); ++it)
|
||||
it->second.remove(guid);
|
||||
@@ -1250,7 +1250,7 @@ bool LFGMgr::CheckGroupRoles(LfgRolesMap& groles, bool removeLeaderFlag /*= true
|
||||
@param[in] guid Player guid to update answer
|
||||
@param[in] accept Player answer
|
||||
*/
|
||||
void LFGMgr::UpdateProposal(uint32 proposalId, const uint64 guid, bool accept)
|
||||
void LFGMgr::UpdateProposal(uint32 proposalId, uint64 guid, bool accept)
|
||||
{
|
||||
// Check if the proposal exists
|
||||
LfgProposalMap::iterator itProposal = m_Proposals.find(proposalId);
|
||||
@@ -1364,17 +1364,29 @@ void LFGMgr::UpdateProposal(uint32 proposalId, const uint64 guid, bool accept)
|
||||
switch(role)
|
||||
{
|
||||
case ROLE_DAMAGE:
|
||||
m_WaitTimeDps = int32((m_WaitTimeDps * m_NumWaitTimeDps + waitTimesMap[plr->GetGUID()]) / ++m_NumWaitTimeDps);
|
||||
{
|
||||
uint32 old_number = m_NumWaitTimeDps++;
|
||||
m_WaitTimeDps = int32((m_WaitTimeDps * old_number + waitTimesMap[plr->GetGUID()]) / m_NumWaitTimeDps);
|
||||
break;
|
||||
}
|
||||
case ROLE_HEALER:
|
||||
m_WaitTimeHealer = int32((m_WaitTimeHealer * m_NumWaitTimeHealer + waitTimesMap[plr->GetGUID()]) / ++m_NumWaitTimeHealer);
|
||||
{
|
||||
uint32 old_number = m_NumWaitTimeHealer++;
|
||||
m_WaitTimeHealer = int32((m_WaitTimeHealer * old_number + waitTimesMap[plr->GetGUID()]) / m_NumWaitTimeHealer);
|
||||
break;
|
||||
}
|
||||
case ROLE_TANK:
|
||||
m_WaitTimeTank = int32((m_WaitTimeTank * m_NumWaitTimeTank + waitTimesMap[plr->GetGUID()]) / ++m_NumWaitTimeTank);
|
||||
{
|
||||
uint32 old_number = m_NumWaitTimeTank++;
|
||||
m_WaitTimeTank = int32((m_WaitTimeTank * old_number + waitTimesMap[plr->GetGUID()]) / m_NumWaitTimeTank);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
m_WaitTimeAvg = int32((m_WaitTimeAvg * m_NumWaitTimeAvg + waitTimesMap[plr->GetGUID()]) / ++m_NumWaitTimeAvg);
|
||||
{
|
||||
uint32 old_number = m_NumWaitTimeAvg++;
|
||||
m_WaitTimeAvg = int32((m_WaitTimeAvg * old_number + waitTimesMap[plr->GetGUID()]) / m_NumWaitTimeAvg);
|
||||
break;
|
||||
}
|
||||
}
|
||||
grp->SetLfgRoles(pguid, pProposal->players[pguid]->role);
|
||||
SetState(pguid, LFG_STATE_DUNGEON);
|
||||
@@ -1519,7 +1531,7 @@ void LFGMgr::RemoveProposal(LfgProposalMap::iterator itProposal, LfgUpdateType t
|
||||
@param[in] victim Victim guid
|
||||
@param[in] reason Kick reason
|
||||
*/
|
||||
void LFGMgr::InitBoot(Group* grp, const uint64 kicker, const uint64 victim, std::string reason)
|
||||
void LFGMgr::InitBoot(Group* grp, uint64 kicker, uint64 victim, std::string reason)
|
||||
{
|
||||
if (!grp)
|
||||
return;
|
||||
@@ -1889,7 +1901,7 @@ std::string LFGMgr::ConcatenateGuids(LfgGuidList check)
|
||||
return o.str();
|
||||
}
|
||||
|
||||
LfgState LFGMgr::GetState(const uint64 guid)
|
||||
LfgState LFGMgr::GetState(uint64 guid)
|
||||
{
|
||||
sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::GetState: [" UI64FMTD "]", guid);
|
||||
if (IS_GROUP(guid))
|
||||
@@ -1898,61 +1910,61 @@ LfgState LFGMgr::GetState(const uint64 guid)
|
||||
return m_Players[guid].GetState();
|
||||
}
|
||||
|
||||
uint32 LFGMgr::GetDungeon(const uint64 guid, bool asId /*= true*/)
|
||||
uint32 LFGMgr::GetDungeon(uint64 guid, bool asId /*= true*/)
|
||||
{
|
||||
sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::GetDungeon: [" UI64FMTD "] asId: %u", guid, asId);
|
||||
return m_Groups[guid].GetDungeon(asId);
|
||||
}
|
||||
|
||||
uint8 LFGMgr::GetRoles(const uint64 guid)
|
||||
uint8 LFGMgr::GetRoles(uint64 guid)
|
||||
{
|
||||
sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::GetRoles: [" UI64FMTD "]", guid);
|
||||
return m_Players[guid].GetRoles();
|
||||
}
|
||||
|
||||
const std::string& LFGMgr::GetComment(const uint64 guid)
|
||||
const std::string& LFGMgr::GetComment(uint64 guid)
|
||||
{
|
||||
sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::GetComment: [" UI64FMTD "]", guid);
|
||||
return m_Players[guid].GetComment();
|
||||
}
|
||||
|
||||
const LfgDungeonSet& LFGMgr::GetSelectedDungeons(const uint64 guid)
|
||||
const LfgDungeonSet& LFGMgr::GetSelectedDungeons(uint64 guid)
|
||||
{
|
||||
sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::GetSelectedDungeons: [" UI64FMTD "]", guid);
|
||||
return m_Players[guid].GetSelectedDungeons();
|
||||
}
|
||||
|
||||
const LfgLockMap& LFGMgr::GetLockedDungeons(const uint64 guid)
|
||||
const LfgLockMap& LFGMgr::GetLockedDungeons(uint64 guid)
|
||||
{
|
||||
sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::GetLockedDungeons: [" UI64FMTD "]", guid);
|
||||
return m_Players[guid].GetLockedDungeons();
|
||||
}
|
||||
|
||||
uint8 LFGMgr::GetKicksLeft(const uint64 guid)
|
||||
uint8 LFGMgr::GetKicksLeft(uint64 guid)
|
||||
{
|
||||
sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::GetKicksLeft: [" UI64FMTD "]", guid);
|
||||
return m_Groups[guid].GetKicksLeft();
|
||||
}
|
||||
|
||||
uint8 LFGMgr::GetVotesNeeded(const uint64 guid)
|
||||
uint8 LFGMgr::GetVotesNeeded(uint64 guid)
|
||||
{
|
||||
sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::GetVotesNeeded: [" UI64FMTD "]", guid);
|
||||
return m_Groups[guid].GetVotesNeeded();
|
||||
}
|
||||
|
||||
void LFGMgr::RestoreState(const uint64 guid)
|
||||
void LFGMgr::RestoreState(uint64 guid)
|
||||
{
|
||||
sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::RestoreState: [" UI64FMTD "]", guid);
|
||||
m_Groups[guid].RestoreState();
|
||||
}
|
||||
|
||||
void LFGMgr::ClearState(const uint64 guid)
|
||||
void LFGMgr::ClearState(uint64 guid)
|
||||
{
|
||||
sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::ClearState: [" UI64FMTD "]", guid);
|
||||
m_Players[guid].ClearState();
|
||||
}
|
||||
|
||||
void LFGMgr::SetState(const uint64 guid, LfgState state)
|
||||
void LFGMgr::SetState(uint64 guid, LfgState state)
|
||||
{
|
||||
sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::SetState: [" UI64FMTD "] state %u", guid, state);
|
||||
if (IS_GROUP(guid))
|
||||
@@ -1961,43 +1973,43 @@ void LFGMgr::SetState(const uint64 guid, LfgState state)
|
||||
m_Players[guid].SetState(state);
|
||||
}
|
||||
|
||||
void LFGMgr::SetDungeon(const uint64 guid, uint32 dungeon)
|
||||
void LFGMgr::SetDungeon(uint64 guid, uint32 dungeon)
|
||||
{
|
||||
sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::SetDungeon: [" UI64FMTD "] dungeon %u", guid, dungeon);
|
||||
m_Groups[guid].SetDungeon(dungeon);
|
||||
}
|
||||
|
||||
void LFGMgr::SetRoles(const uint64 guid, uint8 roles)
|
||||
void LFGMgr::SetRoles(uint64 guid, uint8 roles)
|
||||
{
|
||||
sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::SetRoles: [" UI64FMTD "] roles: %u", guid, roles);
|
||||
m_Players[guid].SetRoles(roles);
|
||||
}
|
||||
|
||||
void LFGMgr::SetComment(const uint64 guid, const std::string& comment)
|
||||
void LFGMgr::SetComment(uint64 guid, const std::string& comment)
|
||||
{
|
||||
sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::SetComment: [" UI64FMTD "] comment: %s", guid, comment.c_str());
|
||||
m_Players[guid].SetComment(comment);
|
||||
}
|
||||
|
||||
void LFGMgr::SetSelectedDungeons(const uint64 guid, const LfgDungeonSet& dungeons)
|
||||
void LFGMgr::SetSelectedDungeons(uint64 guid, const LfgDungeonSet& dungeons)
|
||||
{
|
||||
sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::SetSelectedDungeons: [" UI64FMTD "]", guid);
|
||||
m_Players[guid].SetSelectedDungeons(dungeons);
|
||||
}
|
||||
|
||||
void LFGMgr::SetLockedDungeons(const uint64 guid, const LfgLockMap& lock)
|
||||
void LFGMgr::SetLockedDungeons(uint64 guid, const LfgLockMap& lock)
|
||||
{
|
||||
sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::SetLockedDungeons: [" UI64FMTD "]", guid);
|
||||
m_Players[guid].SetLockedDungeons(lock);
|
||||
}
|
||||
|
||||
void LFGMgr::DecreaseKicksLeft(const uint64 guid)
|
||||
void LFGMgr::DecreaseKicksLeft(uint64 guid)
|
||||
{
|
||||
sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::DecreaseKicksLeft: [" UI64FMTD "]", guid);
|
||||
m_Groups[guid].DecreaseKicksLeft();
|
||||
}
|
||||
|
||||
void LFGMgr::RemovePlayerData(const uint64 guid)
|
||||
void LFGMgr::RemovePlayerData(uint64 guid)
|
||||
{
|
||||
sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::RemovePlayerData: [" UI64FMTD "]", guid);
|
||||
LfgPlayerDataMap::iterator it = m_Players.find(guid);
|
||||
@@ -2005,7 +2017,7 @@ void LFGMgr::RemovePlayerData(const uint64 guid)
|
||||
m_Players.erase(it);
|
||||
}
|
||||
|
||||
void LFGMgr::RemoveGroupData(const uint64 guid)
|
||||
void LFGMgr::RemoveGroupData(uint64 guid)
|
||||
{
|
||||
sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::RemoveGroupData: [" UI64FMTD "]", guid);
|
||||
LfgGroupDataMap::iterator it = m_Groups.find(guid);
|
||||
|
||||
@@ -272,45 +272,45 @@ class LFGMgr
|
||||
void UpdateRoleCheck(uint64 gguid, uint64 guid = 0, uint8 roles = ROLE_NONE);
|
||||
|
||||
// Proposals
|
||||
void UpdateProposal(uint32 proposalId, const uint64 guid, bool accept);
|
||||
void UpdateProposal(uint32 proposalId, uint64 guid, bool accept);
|
||||
|
||||
// Teleportation
|
||||
void TeleportPlayer(Player* plr, bool out, bool fromOpcode = false);
|
||||
|
||||
// Vote kick
|
||||
void InitBoot(Group* grp, const uint64 kguid, const uint64 vguid, std::string reason);
|
||||
void InitBoot(Group* grp, uint64 kguid, uint64 vguid, std::string reason);
|
||||
void UpdateBoot(Player* plr, bool accept);
|
||||
void OfferContinue(Group* grp);
|
||||
|
||||
void InitializeLockedDungeons(Player* plr);
|
||||
|
||||
void SetComment(const uint64 guid, const std::string& comment);
|
||||
const LfgLockMap& GetLockedDungeons(const uint64 guid);
|
||||
LfgState GetState(const uint64 guid);
|
||||
const LfgDungeonSet& GetSelectedDungeons(const uint64 guid);
|
||||
uint32 GetDungeon(const uint64 guid, bool asId = true);
|
||||
void ClearState(const uint64 guid);
|
||||
void RemovePlayerData(const uint64 guid);
|
||||
void RemoveGroupData(const uint64 guid);
|
||||
uint8 GetKicksLeft(const uint64 gguid);
|
||||
uint8 GetVotesNeeded(const uint64 gguid);
|
||||
void SetRoles(const uint64 guid, uint8 roles);
|
||||
void SetComment(uint64 guid, const std::string& comment);
|
||||
const LfgLockMap& GetLockedDungeons(uint64 guid);
|
||||
LfgState GetState(uint64 guid);
|
||||
const LfgDungeonSet& GetSelectedDungeons(uint64 guid);
|
||||
uint32 GetDungeon(uint64 guid, bool asId = true);
|
||||
void ClearState(uint64 guid);
|
||||
void RemovePlayerData(uint64 guid);
|
||||
void RemoveGroupData(uint64 guid);
|
||||
uint8 GetKicksLeft(uint64 gguid);
|
||||
uint8 GetVotesNeeded(uint64 gguid);
|
||||
void SetRoles(uint64 guid, uint8 roles);
|
||||
|
||||
private:
|
||||
|
||||
uint8 GetRoles(const uint64 guid);
|
||||
const std::string& GetComment(const uint64 gguid);
|
||||
void RestoreState(const uint64 guid);
|
||||
void SetState(const uint64 guid, LfgState state);
|
||||
void SetDungeon(const uint64 guid, uint32 dungeon);
|
||||
void SetSelectedDungeons(const uint64 guid, const LfgDungeonSet& dungeons);
|
||||
void SetLockedDungeons(const uint64 guid, const LfgLockMap& lock);
|
||||
void DecreaseKicksLeft(const uint64 guid);
|
||||
uint8 GetRoles(uint64 guid);
|
||||
const std::string& GetComment(uint64 gguid);
|
||||
void RestoreState(uint64 guid);
|
||||
void SetState(uint64 guid, LfgState state);
|
||||
void SetDungeon(uint64 guid, uint32 dungeon);
|
||||
void SetSelectedDungeons(uint64 guid, const LfgDungeonSet& dungeons);
|
||||
void SetLockedDungeons(uint64 guid, const LfgLockMap& lock);
|
||||
void DecreaseKicksLeft(uint64 guid);
|
||||
void NoExiste(uint8 lala);
|
||||
|
||||
// Queue
|
||||
void AddToQueue(const uint64 guid, uint8 queueId);
|
||||
bool RemoveFromQueue(const uint64 guid);
|
||||
void AddToQueue(uint64 guid, uint8 queueId);
|
||||
bool RemoveFromQueue(uint64 guid);
|
||||
|
||||
// Proposals
|
||||
void RemoveProposal(LfgProposalMap::iterator itProposal, LfgUpdateType type);
|
||||
|
||||
Reference in New Issue
Block a user