mirror of
https://github.com/mangosfour/server.git
synced 2025-12-15 19:37:02 +00:00
Use configuration values for arena directly instead of values cached in local variables. This should fix reloading arena configuration in runtime.
Signed-off-by: ApoC <apoc@nymfe.net>
This commit is contained in:
parent
a5e948280b
commit
c4dba30b51
2 changed files with 10 additions and 21 deletions
|
|
@ -37,7 +37,6 @@
|
|||
#include "MapInstanced.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "ProgressBar.h"
|
||||
#include "World.h"
|
||||
#include "Chat.h"
|
||||
#include "ArenaTeam.h"
|
||||
|
||||
|
|
@ -1075,16 +1074,10 @@ void BGQueueRemoveEvent::Abort(uint64 /*e_time*/)
|
|||
/*** BATTLEGROUND MANAGER ***/
|
||||
/*********************************************************/
|
||||
|
||||
BattleGroundMgr::BattleGroundMgr()
|
||||
BattleGroundMgr::BattleGroundMgr() : m_AutoDistributionTimeChecker(0), m_ArenaTesting(false)
|
||||
{
|
||||
m_BattleGrounds.clear();
|
||||
m_AutoDistributePoints = (bool)sWorld.getConfig(CONFIG_ARENA_AUTO_DISTRIBUTE_POINTS);
|
||||
m_MaxRatingDifference = sWorld.getConfig(CONFIG_ARENA_MAX_RATING_DIFFERENCE);
|
||||
m_RatingDiscardTimer = sWorld.getConfig(CONFIG_ARENA_RATING_DISCARD_TIMER);
|
||||
m_PrematureFinishTimer = sWorld.getConfig(CONFIG_BATTLEGROUND_PREMATURE_FINISH_TIMER);
|
||||
m_NextRatingDiscardUpdate = m_RatingDiscardTimer;
|
||||
m_AutoDistributionTimeChecker = 0;
|
||||
m_ArenaTesting = false;
|
||||
m_NextRatingDiscardUpdate = sWorld.getConfig(CONFIG_ARENA_RATING_DISCARD_TIMER);
|
||||
}
|
||||
|
||||
BattleGroundMgr::~BattleGroundMgr()
|
||||
|
|
@ -1120,7 +1113,7 @@ void BattleGroundMgr::Update(time_t diff)
|
|||
}
|
||||
}
|
||||
// if rating difference counts, maybe force-update queues
|
||||
if(m_MaxRatingDifference)
|
||||
if(sWorld.getConfig(CONFIG_ARENA_MAX_RATING_DIFFERENCE))
|
||||
{
|
||||
// it's time to force update
|
||||
if(m_NextRatingDiscardUpdate < diff)
|
||||
|
|
@ -1129,12 +1122,12 @@ void BattleGroundMgr::Update(time_t diff)
|
|||
m_BattleGroundQueues[BATTLEGROUND_QUEUE_2v2].Update(BATTLEGROUND_AA,6,ARENA_TYPE_2v2,true,0);
|
||||
m_BattleGroundQueues[BATTLEGROUND_QUEUE_3v3].Update(BATTLEGROUND_AA,6,ARENA_TYPE_3v3,true,0);
|
||||
m_BattleGroundQueues[BATTLEGROUND_QUEUE_5v5].Update(BATTLEGROUND_AA,6,ARENA_TYPE_5v5,true,0);
|
||||
m_NextRatingDiscardUpdate = m_RatingDiscardTimer;
|
||||
m_NextRatingDiscardUpdate = sWorld.getConfig(CONFIG_ARENA_RATING_DISCARD_TIMER);
|
||||
}
|
||||
else
|
||||
m_NextRatingDiscardUpdate -= diff;
|
||||
}
|
||||
if(m_AutoDistributePoints)
|
||||
if(sWorld.getConfig(CONFIG_ARENA_AUTO_DISTRIBUTE_POINTS))
|
||||
{
|
||||
if(m_AutoDistributionTimeChecker < diff)
|
||||
{
|
||||
|
|
@ -1692,7 +1685,7 @@ void BattleGroundMgr::CreateInitialBattleGrounds()
|
|||
|
||||
void BattleGroundMgr::InitAutomaticArenaPointDistribution()
|
||||
{
|
||||
if(m_AutoDistributePoints)
|
||||
if(sWorld.getConfig(CONFIG_ARENA_AUTO_DISTRIBUTE_POINTS))
|
||||
{
|
||||
sLog.outDebug("Initializing Automatic Arena Point Distribution");
|
||||
QueryResult * result = CharacterDatabase.Query("SELECT NextArenaPointDistributionTime FROM saved_variables");
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@
|
|||
#define __BATTLEGROUNDMGR_H
|
||||
|
||||
#include "BattleGround.h"
|
||||
#include "Policies/Singleton.h"
|
||||
#include "World.h"
|
||||
|
||||
class BattleGround;
|
||||
|
||||
|
|
@ -225,12 +225,12 @@ class BattleGroundMgr
|
|||
uint32 BGTemplateId(uint32 bgQueueTypeId) const;
|
||||
uint8 BGArenaType(uint32 bgQueueTypeId) const;
|
||||
|
||||
uint32 GetMaxRatingDifference() const {return m_MaxRatingDifference;}
|
||||
uint32 GetRatingDiscardTimer() const {return m_RatingDiscardTimer;}
|
||||
uint32 GetMaxRatingDifference() const {return sWorld.getConfig(CONFIG_ARENA_MAX_RATING_DIFFERENCE);}
|
||||
uint32 GetRatingDiscardTimer() const {return sWorld.getConfig(CONFIG_ARENA_RATING_DISCARD_TIMER);}
|
||||
|
||||
void InitAutomaticArenaPointDistribution();
|
||||
void DistributeArenaPoints();
|
||||
uint32 GetPrematureFinishTime() const {return m_PrematureFinishTimer;}
|
||||
uint32 GetPrematureFinishTime() const {return sWorld.getConfig(CONFIG_BATTLEGROUND_PREMATURE_FINISH_TIMER);}
|
||||
void ToggleArenaTesting();
|
||||
const bool isArenaTesting() const { return m_ArenaTesting; }
|
||||
|
||||
|
|
@ -238,13 +238,9 @@ class BattleGroundMgr
|
|||
|
||||
/* Battlegrounds */
|
||||
BattleGroundSet m_BattleGrounds;
|
||||
uint32 m_MaxRatingDifference;
|
||||
uint32 m_RatingDiscardTimer;
|
||||
uint32 m_NextRatingDiscardUpdate;
|
||||
bool m_AutoDistributePoints;
|
||||
uint64 m_NextAutoDistributionTime;
|
||||
uint32 m_AutoDistributionTimeChecker;
|
||||
uint32 m_PrematureFinishTimer;
|
||||
bool m_ArenaTesting;
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue