mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 13:37:05 +00:00
Weather system changed to that of the previous cores.
Weather system changed to that of the previous cores. This is part of the current build errors fixes.
This commit is contained in:
parent
9e94234bdf
commit
165cfba9c4
28 changed files with 1650 additions and 859 deletions
|
|
@ -1131,10 +1131,12 @@ void BGQueueRemoveEvent::Abort(uint64 /*e_time*/)
|
|||
/*** BATTLEGROUND MANAGER ***/
|
||||
/*********************************************************/
|
||||
|
||||
BattleGroundMgr::BattleGroundMgr() : m_ArenaTesting(false)
|
||||
BattleGroundMgr::BattleGroundMgr() : m_AutoDistributionTimeChecker(0), m_ArenaTesting(false)
|
||||
{
|
||||
for (uint8 i = BATTLEGROUND_TYPE_NONE; i < MAX_BATTLEGROUND_TYPE_ID; ++i)
|
||||
{
|
||||
m_BattleGrounds[i].clear();
|
||||
}
|
||||
m_NextRatingDiscardUpdate = sWorld.getConfig(CONFIG_UINT32_ARENA_RATING_DISCARD_TIMER);
|
||||
m_Testing = false;
|
||||
}
|
||||
|
|
@ -1973,6 +1975,80 @@ void BattleGroundMgr::CreateInitialBattleGrounds()
|
|||
sLog.outString(">> Loaded %u battlegrounds", count);
|
||||
}
|
||||
|
||||
void BattleGroundMgr::InitAutomaticArenaPointDistribution()
|
||||
{
|
||||
if (sWorld.getConfig(CONFIG_BOOL_ARENA_AUTO_DISTRIBUTE_POINTS))
|
||||
{
|
||||
DEBUG_LOG("Initializing Automatic Arena Point Distribution");
|
||||
QueryResult* result = CharacterDatabase.Query("SELECT NextArenaPointDistributionTime FROM saved_variables");
|
||||
if (!result)
|
||||
{
|
||||
DEBUG_LOG("Battleground: Next arena point distribution time not found in SavedVariables, reseting it now.");
|
||||
m_NextAutoDistributionTime = time_t(sWorld.GetGameTime() + BATTLEGROUND_ARENA_POINT_DISTRIBUTION_DAY * sWorld.getConfig(CONFIG_UINT32_ARENA_AUTO_DISTRIBUTE_INTERVAL_DAYS));
|
||||
CharacterDatabase.PExecute("INSERT INTO saved_variables (NextArenaPointDistributionTime) VALUES ('" UI64FMTD "')", uint64(m_NextAutoDistributionTime));
|
||||
}
|
||||
else
|
||||
{
|
||||
m_NextAutoDistributionTime = time_t((*result)[0].GetUInt64());
|
||||
delete result;
|
||||
}
|
||||
DEBUG_LOG("Automatic Arena Point Distribution initialized.");
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* there does not appear to be a way to do this in Three
|
||||
void BattleGroundMgr::DistributeArenaPoints()
|
||||
{
|
||||
// used to distribute arena points based on last week's stats
|
||||
sWorld.SendWorldText(LANG_DIST_ARENA_POINTS_START);
|
||||
|
||||
sWorld.SendWorldText(LANG_DIST_ARENA_POINTS_ONLINE_START);
|
||||
|
||||
// temporary structure for storing maximum points to add values for all players
|
||||
std::map<uint32, uint32> PlayerPoints;
|
||||
|
||||
// at first update all points for all team members
|
||||
for (ObjectMgr::ArenaTeamMap::iterator team_itr = sObjectMgr.GetArenaTeamMapBegin(); team_itr != sObjectMgr.GetArenaTeamMapEnd(); ++team_itr)
|
||||
{
|
||||
if (ArenaTeam* at = team_itr->second)
|
||||
{
|
||||
at->UpdateArenaPointsHelper(PlayerPoints);
|
||||
}
|
||||
}
|
||||
|
||||
// cycle that gives points to all players
|
||||
for (std::map<uint32, uint32>::iterator plr_itr = PlayerPoints.begin(); plr_itr != PlayerPoints.end(); ++plr_itr)
|
||||
{
|
||||
// update to database
|
||||
CharacterDatabase.PExecute("UPDATE characters SET arenaPoints = arenaPoints + '%u' WHERE guid = '%u'", plr_itr->second, plr_itr->first);
|
||||
// add points if player is online
|
||||
if (Player* pl = sObjectMgr.GetPlayer(ObjectGuid(HIGHGUID_PLAYER, plr_itr->first)))
|
||||
pl->ModifyArenaPoints(plr_itr->second);
|
||||
}
|
||||
|
||||
PlayerPoints.clear();
|
||||
|
||||
sWorld.SendWorldText(LANG_DIST_ARENA_POINTS_ONLINE_END);
|
||||
|
||||
sWorld.SendWorldText(LANG_DIST_ARENA_POINTS_TEAM_START);
|
||||
for (ObjectMgr::ArenaTeamMap::iterator titr = sObjectMgr.GetArenaTeamMapBegin(); titr != sObjectMgr.GetArenaTeamMapEnd(); ++titr)
|
||||
{
|
||||
if (ArenaTeam* at = titr->second)
|
||||
{
|
||||
at->FinishWeek(); // set played this week etc values to 0 in memory, too
|
||||
at->SaveToDB(); // save changes
|
||||
at->NotifyStatsChanged(); // notify the players of the changes
|
||||
}
|
||||
}
|
||||
|
||||
sWorld.SendWorldText(LANG_DIST_ARENA_POINTS_TEAM_END);
|
||||
|
||||
sWorld.SendWorldText(LANG_DIST_ARENA_POINTS_END);
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
void BattleGroundMgr::BuildBattleGroundListPacket(WorldPacket* data, ObjectGuid guid, Player* plr, BattleGroundTypeId bgTypeId)
|
||||
{
|
||||
if (!plr)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue