Core/Battlegrounds: implement rated battleground world state allow queueing up for rated BGs

This will allow to toggle the rated battleground UI for the player, the RBG system is yet to be implemented.
This commit is contained in:
Kenneth P. Barquero
2020-10-31 05:54:53 -06:00
committed by GitHub
parent b5f765986f
commit cfecdc0fe5
5 changed files with 39 additions and 3 deletions

View File

@@ -234,6 +234,7 @@ enum BGHonorMode
#define BG_AWARD_ARENA_POINTS_MIN_LEVEL 71
#define ARENA_TIMELIMIT_POINTS_LOSS -16
#define WS_RATED_BATTLEGROUND_STATE_ACTIVE 5508
/*
This class is used to:

View File

@@ -872,8 +872,11 @@ void WorldSession::HandleRequestRatedBgStats(WorldPacket& /*recvData*/)
{
TC_LOG_DEBUG("network", "WORLD: CMSG_REQUEST_RATED_BG_STATS");
uint8 ratedBattlegroundActive = sWorld->getBoolConfig(CONFIG_RATED_BATTLEGROUND_ENABLE);
uint8 ratedBattlegroundReward = sWorld->getIntConfig(CONFIG_RATED_BATTLEGROUND_REWARD) / CURRENCY_PRECISION;
WorldPacket data(SMSG_BATTLEFIELD_RATED_INFO, 29);
data << uint32(0); // Reward
data << uint32(ratedBattlegroundReward); // Reward
data << uint8(3); // unk
data << uint32(0); // unk
data << uint32(0); // unk
@@ -883,6 +886,9 @@ void WorldSession::HandleRequestRatedBgStats(WorldPacket& /*recvData*/)
data << _player->GetCurrency(CURRENCY_TYPE_CONQUEST_POINTS, true);
SendPacket(&data);
// update the rated battleground state
_player->SendUpdateWorldState(WS_RATED_BATTLEGROUND_STATE_ACTIVE, ratedBattlegroundActive);
}
void WorldSession::HandleBattlegroundStateQuery(WorldPacket& /*recvData*/)

View File

@@ -1254,6 +1254,10 @@ void World::LoadConfigSettings(bool reload)
m_int_configs[CONFIG_BATTLEGROUND_PREMATURE_FINISH_TIMER] = sConfigMgr->GetIntDefault ("Battleground.PrematureFinishTimer", 5 * MINUTE * IN_MILLISECONDS);
m_int_configs[CONFIG_BATTLEGROUND_PREMADE_GROUP_WAIT_FOR_MATCH] = sConfigMgr->GetIntDefault ("Battleground.PremadeGroupWaitForMatch", 30 * MINUTE * IN_MILLISECONDS);
m_bool_configs[CONFIG_BG_XP_FOR_KILL] = sConfigMgr->GetBoolDefault("Battleground.GiveXPForKills", false);
m_bool_configs[CONFIG_RATED_BATTLEGROUND_ENABLE] = sConfigMgr->GetIntDefault ("RatedBattleground.Enable", 0);
m_int_configs[CONFIG_RATED_BATTLEGROUND_REWARD] = sConfigMgr->GetIntDefault ("RatedBattleground.Reward", 40000);
m_int_configs[CONFIG_ARENA_MAX_RATING_DIFFERENCE] = sConfigMgr->GetIntDefault ("Arena.MaxRatingDifference", 150);
m_int_configs[CONFIG_ARENA_RATING_DISCARD_TIMER] = sConfigMgr->GetIntDefault ("Arena.RatingDiscardTimer", 10 * MINUTE * IN_MILLISECONDS);
m_int_configs[CONFIG_ARENA_RATED_UPDATE_TIMER] = sConfigMgr->GetIntDefault ("Arena.RatedUpdateTimer", 5 * IN_MILLISECONDS);

View File

@@ -134,6 +134,7 @@ enum WorldBoolConfigs
CONFIG_BATTLEGROUND_STORE_STATISTICS_ENABLE,
CONFIG_BATTLEGROUND_TRACK_DESERTERS,
CONFIG_BG_XP_FOR_KILL,
CONFIG_RATED_BATTLEGROUND_ENABLE,
CONFIG_ARENA_QUEUE_ANNOUNCER_ENABLE,
CONFIG_ARENA_SEASON_IN_PROGRESS,
CONFIG_ARENA_LOG_EXTENDED_INFO,
@@ -324,6 +325,7 @@ enum WorldIntConfigs
CONFIG_BATTLEGROUND_PREMATURE_FINISH_TIMER,
CONFIG_BATTLEGROUND_PREMADE_GROUP_WAIT_FOR_MATCH,
CONFIG_BATTLEGROUND_REPORT_AFK,
CONFIG_RATED_BATTLEGROUND_REWARD,
CONFIG_ARENA_MAX_RATING_DIFFERENCE,
CONFIG_ARENA_RATING_DISCARD_TIMER,
CONFIG_ARENA_RATED_UPDATE_TIMER,

View File

@@ -24,6 +24,7 @@
# STATS LIMITS
# AUTO BROADCAST
# BATTLEGROUND CONFIG
# RATED BATTLEGROUND CONFIG
# BATTLEFIELD CONFIG
# ARENA CONFIG
# NETWORK CONFIG
@@ -1093,7 +1094,7 @@ MinQuestScaledXPRatio = 0
#
# MinCreatureScaledXPRatio
# Description: Min ratio of experience that a creature kill can grant when player level scaling is factored. This
# Description: Min ratio of experience that a creature kill can grant when player level scaling is factored. This
# will also allow spell procs to trigger, such as Drain Soul, if > 0 and exp is grantable.
# Example: 50 (No less than 50% experience granted from a lower leveled creature kill)
# 100 (Creature kills always grant full experience upon kill)
@@ -1279,7 +1280,7 @@ BirthdayTime = 1222964635
#
# CacheDataQueries
# Description: Server caches data queries at startup.
# Description: Server caches data queries at startup.
# Can be disabled if not enough memory is available.
# Default: 1 - (Enabled)
# 0 - (Disabled)
@@ -2662,6 +2663,28 @@ Battleground.ReportAFK = 3
#
###################################################################################################
###################################################################################################
# RATED BATTLEGROUND CONFIG
#
# RatedBattleground.Enable
# Description: Enable or disable the rated battleground system.
# Default: 0 - (Disabled)
# 1 - (10v10 Enabled, Experimental as in not implemented)
# 2 - (15v15 Enabled, Experimental as in not implemented)
# 3 - (25v25 Enabled, Experimental as in not implemented)
RatedBattleground.Enable = 0
#
# RatedBattleground.Reward
# Description: The conquest points reward after winning a rated battleground.
# Default: 40000
RatedBattleground.Reward = 40000
#
###################################################################################################
###################################################################################################
# BATTLEFIELD CONFIG
#