mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-24 19:06:49 +01:00
[7383] Changed some comments in config file, changed default MaxRatingDifference from 100 to 150 in default config.
[7384] Removed some comments.
Fixed problem that queues doesn't invite new players to already running battlegrounds.
Some other fixes for announce system will be soon.
Author: Triply
--HG--
branch : trunk
This commit is contained in:
@@ -38,7 +38,7 @@ BattleGround::BattleGround()
|
||||
{
|
||||
m_TypeID = BattleGroundTypeId(0);
|
||||
m_InstanceID = 0;
|
||||
m_Status = 0;
|
||||
m_Status = STATUS_NONE;
|
||||
m_EndTime = 0;
|
||||
m_LastResurrectTime = 0;
|
||||
m_QueueId = QUEUE_ID_MAX_LEVEL_19;
|
||||
|
||||
@@ -114,11 +114,11 @@ const uint32 Buff_Entries[3] = { BG_OBJECTID_SPEEDBUFF_ENTRY, BG_OBJECTID_REGENB
|
||||
|
||||
enum BattleGroundStatus
|
||||
{
|
||||
STATUS_NONE = 0,
|
||||
STATUS_WAIT_QUEUE = 1,
|
||||
STATUS_WAIT_JOIN = 2,
|
||||
STATUS_IN_PROGRESS = 3,
|
||||
STATUS_WAIT_LEAVE = 4 // custom
|
||||
STATUS_NONE = 0, // first status, should mean bg is not instance
|
||||
STATUS_WAIT_QUEUE = 1, // means bg is empty and waiting for queue
|
||||
STATUS_WAIT_JOIN = 2, // this means, that BG has already started and it is waiting for more players
|
||||
STATUS_IN_PROGRESS = 3, // means bg is running
|
||||
STATUS_WAIT_LEAVE = 4 // means some faction has won BG and it is ending
|
||||
};
|
||||
|
||||
struct BattleGroundPlayer
|
||||
@@ -283,7 +283,7 @@ class BattleGround
|
||||
BattleGroundTypeId GetTypeID() const { return m_TypeID; }
|
||||
BGQueueIdBasedOnLevel GetQueueId() const { return m_QueueId; }
|
||||
uint32 GetInstanceID() const { return m_InstanceID; }
|
||||
uint32 GetStatus() const { return m_Status; }
|
||||
BattleGroundStatus GetStatus() const { return m_Status; }
|
||||
uint32 GetStartTime() const { return m_StartTime; }
|
||||
uint32 GetEndTime() const { return m_EndTime; }
|
||||
uint32 GetLastResurrectTime() const { return m_LastResurrectTime; }
|
||||
@@ -296,7 +296,7 @@ class BattleGround
|
||||
uint32 GetMaxPlayersPerTeam() const { return m_MaxPlayersPerTeam; }
|
||||
uint32 GetMinPlayersPerTeam() const { return m_MinPlayersPerTeam; }
|
||||
|
||||
int GetStartDelayTime() const { return m_StartDelayTime; }
|
||||
int32 GetStartDelayTime() const { return m_StartDelayTime; }
|
||||
uint8 GetArenaType() const { return m_ArenaType; }
|
||||
uint8 GetWinner() const { return m_Winner; }
|
||||
uint32 GetBattlemasterEntry() const;
|
||||
@@ -312,7 +312,7 @@ class BattleGround
|
||||
this->SetLevelRange((ID + 1) * 10 + diff, (ID + 2) * 10 - ((diff + 1) % 2));
|
||||
}
|
||||
void SetInstanceID(uint32 InstanceID) { m_InstanceID = InstanceID; }
|
||||
void SetStatus(uint32 Status) { m_Status = Status; }
|
||||
void SetStatus(BattleGroundStatus Status) { m_Status = Status; }
|
||||
void SetStartTime(uint32 Time) { m_StartTime = Time; }
|
||||
void SetEndTime(uint32 Time) { m_EndTime = Time; }
|
||||
void SetLastResurrectTime(uint32 Time) { m_LastResurrectTime = Time; }
|
||||
@@ -506,7 +506,7 @@ class BattleGround
|
||||
/* Battleground */
|
||||
BattleGroundTypeId m_TypeID;
|
||||
uint32 m_InstanceID; //BattleGround Instance's GUID!
|
||||
uint32 m_Status;
|
||||
BattleGroundStatus m_Status;
|
||||
uint32 m_StartTime;
|
||||
uint32 m_EndTime;
|
||||
uint32 m_LastResurrectTime;
|
||||
@@ -514,9 +514,6 @@ class BattleGround
|
||||
uint8 m_ArenaType; // 2=2v2, 3=3v3, 5=5v5
|
||||
bool m_InBGFreeSlotQueue; // used to make sure that BG is only once inserted into the BattleGroundMgr.BGFreeSlotQueue[bgTypeId] deque
|
||||
bool m_SetDeleteThis; // used for safe deletion of the bg after end / all players leave
|
||||
// this variable is not used .... it can be found in many other ways... but to store it in BG object instance is useless
|
||||
//uint8 m_BattleGroundType; // 3=BG, 4=arena
|
||||
//instead of uint8 (in previous line) is bool used
|
||||
bool m_IsArena;
|
||||
uint8 m_Winner; // 0=alliance, 1=horde, 2=none
|
||||
int32 m_StartDelayTime;
|
||||
@@ -554,7 +551,7 @@ class BattleGround
|
||||
uint32 m_MinPlayersPerTeam;
|
||||
uint32 m_MinPlayers;
|
||||
|
||||
/* Location */
|
||||
/* Start location */
|
||||
uint32 m_MapId;
|
||||
float m_TeamStartLocX[BG_TEAMS_COUNT];
|
||||
float m_TeamStartLocY[BG_TEAMS_COUNT];
|
||||
|
||||
@@ -372,7 +372,7 @@ void WorldSession::HandleBattleGroundPlayerPortOpcode( WorldPacket &recv_data )
|
||||
|
||||
BattleGroundQueueTypeId bgQueueTypeId = BATTLEGROUND_QUEUE_NONE;
|
||||
// get the bg what we were invited to
|
||||
bgQueueTypeId = BattleGroundMgr::BGQueueTypeId(bgTypeId,type);
|
||||
bgQueueTypeId = BattleGroundMgr::BGQueueTypeId(bgTypeId, type);
|
||||
BattleGroundQueue::QueuedPlayersMap& qpMap = sBattleGroundMgr.m_BattleGroundQueues[bgQueueTypeId].m_QueuedPlayers;
|
||||
BattleGroundQueue::QueuedPlayersMap::iterator itrPlayerStatus = qpMap.find(_player->GetGUID());
|
||||
if(itrPlayerStatus == qpMap.end())
|
||||
|
||||
@@ -115,17 +115,18 @@ bool BattleGroundQueue::SelectionPool::KickGroup(uint32 size)
|
||||
|
||||
// add group to selection pool
|
||||
// used when building selection pools
|
||||
// returns true if we can invite more players, otherwise return false - (selection pool is set that time)
|
||||
// returns true if we can invite more players
|
||||
// returns false when selection pool is set
|
||||
bool BattleGroundQueue::SelectionPool::AddGroup(GroupQueueInfo *ginfo, uint32 desiredCount)
|
||||
{
|
||||
//if group is larger than desired count - don't allow to add it to pool
|
||||
if (!ginfo->IsInvitedToBGInstanceGUID && desiredCount >= PlayerCount + ginfo->Players.size())
|
||||
if( !ginfo->IsInvitedToBGInstanceGUID && desiredCount >= PlayerCount + ginfo->Players.size() )
|
||||
{
|
||||
SelectedGroups.push_back(ginfo);
|
||||
// increase selected players count
|
||||
PlayerCount += ginfo->Players.size();
|
||||
}
|
||||
if (PlayerCount == desiredCount)
|
||||
if( PlayerCount < desiredCount )
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
@@ -555,7 +556,8 @@ bool BattleGroundQueue::CheckPremadeMatch(BGQueueIdBasedOnLevel queue_id, uint32
|
||||
{
|
||||
for(itr = m_QueuedGroups[queue_id][BG_QUEUE_NORMAL_ALLIANCE + i].begin(); itr != m_QueuedGroups[queue_id][BG_QUEUE_NORMAL_ALLIANCE + i].end(); ++itr)
|
||||
{
|
||||
if( !(*itr)->IsInvitedToBGInstanceGUID && m_SelectionPools[i].AddGroup((*itr), maxPlayers) )
|
||||
//if itr can join BG and player count is less that maxPlayers, then add group to selectionpool
|
||||
if( !(*itr)->IsInvitedToBGInstanceGUID && !m_SelectionPools[i].AddGroup((*itr), maxPlayers) )
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -577,7 +579,7 @@ bool BattleGroundQueue::CheckPremadeMatch(BGQueueIdBasedOnLevel queue_id, uint32
|
||||
{
|
||||
//we must insert group to normal queue and erase pointer from premade queue
|
||||
m_QueuedGroups[queue_id][BG_QUEUE_NORMAL_ALLIANCE + i].push_front((*itr));
|
||||
m_QueuedGroups[queue_id][BG_QUEUE_PREMADE_ALLIANCE + i].erase(itr); //pop_front();
|
||||
m_QueuedGroups[queue_id][BG_QUEUE_PREMADE_ALLIANCE + i].erase(itr);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -614,7 +616,7 @@ bool BattleGroundQueue::CheckNormalMatch(BattleGround* bg_template, BGQueueIdBas
|
||||
for(; itr_team[j] != m_QueuedGroups[queue_id][BG_QUEUE_NORMAL_ALLIANCE + j].end(); ++(itr_team[j]))
|
||||
{
|
||||
if( !(*(itr_team[j]))->IsInvitedToBGInstanceGUID )
|
||||
if( m_SelectionPools[j].AddGroup(*(itr_team[j]), m_SelectionPools[(j + 1) % BG_TEAMS_COUNT].GetPlayerCount()) )
|
||||
if( !m_SelectionPools[j].AddGroup(*(itr_team[j]), m_SelectionPools[(j + 1) % BG_TEAMS_COUNT].GetPlayerCount()) )
|
||||
break;
|
||||
}
|
||||
// do not allow to start bg with more than 2 players more on 1 faction
|
||||
@@ -658,12 +660,9 @@ bool BattleGroundQueue::CheckSkirmishForSameFaction(BGQueueIdBasedOnLevel queue_
|
||||
//invite players to other selection pool
|
||||
for(; itr_team2 != m_QueuedGroups[queue_id][BG_QUEUE_NORMAL_ALLIANCE + teamIndex].end(); ++itr_team2)
|
||||
{
|
||||
if( !(*itr_team2)->IsInvitedToBGInstanceGUID )
|
||||
{
|
||||
m_SelectionPools[otherTeam].AddGroup(*itr_team2, minPlayersPerTeam);
|
||||
if( m_SelectionPools[otherTeam].GetPlayerCount() == minPlayersPerTeam )
|
||||
break;
|
||||
}
|
||||
//if selection pool is full then break;
|
||||
if( !(*itr_team2)->IsInvitedToBGInstanceGUID && !m_SelectionPools[otherTeam].AddGroup(*itr_team2, minPlayersPerTeam) )
|
||||
break;
|
||||
}
|
||||
if( m_SelectionPools[otherTeam].GetPlayerCount() != minPlayersPerTeam )
|
||||
return false;
|
||||
@@ -1535,11 +1534,6 @@ BattleGround * BattleGroundMgr::CreateNewBattleGround(BattleGroundTypeId bgTypeI
|
||||
// reset the new bg (set status to status_wait_queue from status_none)
|
||||
bg->Reset();
|
||||
|
||||
if( bg->isBattleGround() && sWorld.getConfig(CONFIG_BATTLEGROUND_QUEUE_ANNOUNCER_ENABLE) )
|
||||
{
|
||||
sWorld.SendWorldText(LANG_BG_STARTED_ANNOUNCE_WORLD, bg->GetName(), bg->GetMinLevel(), bg->GetMaxLevel());
|
||||
}
|
||||
|
||||
// start the joining of the bg
|
||||
bg->SetStatus(STATUS_WAIT_JOIN);
|
||||
bg->SetQueueId(queue_id);
|
||||
|
||||
@@ -563,10 +563,10 @@ void World::LoadConfigSettings(bool reload)
|
||||
}
|
||||
m_configs[CONFIG_ADDON_CHANNEL] = sConfig.GetBoolDefault("AddonChannel", true);
|
||||
m_configs[CONFIG_GRID_UNLOAD] = sConfig.GetBoolDefault("GridUnload", true);
|
||||
m_configs[CONFIG_INTERVAL_SAVE] = sConfig.GetIntDefault("PlayerSaveInterval", 900000);
|
||||
m_configs[CONFIG_INTERVAL_SAVE] = sConfig.GetIntDefault("PlayerSaveInterval", 15 * MINUTE * IN_MILISECONDS);
|
||||
m_configs[CONFIG_INTERVAL_DISCONNECT_TOLERANCE] = sConfig.GetIntDefault("DisconnectToleranceInterval", 0);
|
||||
|
||||
m_configs[CONFIG_INTERVAL_GRIDCLEAN] = sConfig.GetIntDefault("GridCleanUpDelay", 300000);
|
||||
m_configs[CONFIG_INTERVAL_GRIDCLEAN] = sConfig.GetIntDefault("GridCleanUpDelay", 5 * MINUTE * IN_MILISECONDS);
|
||||
if(m_configs[CONFIG_INTERVAL_GRIDCLEAN] < MIN_GRID_DELAY)
|
||||
{
|
||||
sLog.outError("GridCleanUpDelay (%i) must be greater %u. Use this minimal value.",m_configs[CONFIG_INTERVAL_GRIDCLEAN],MIN_GRID_DELAY);
|
||||
@@ -584,7 +584,7 @@ void World::LoadConfigSettings(bool reload)
|
||||
if(reload)
|
||||
MapManager::Instance().SetMapUpdateInterval(m_configs[CONFIG_INTERVAL_MAPUPDATE]);
|
||||
|
||||
m_configs[CONFIG_INTERVAL_CHANGEWEATHER] = sConfig.GetIntDefault("ChangeWeatherInterval", 600000);
|
||||
m_configs[CONFIG_INTERVAL_CHANGEWEATHER] = sConfig.GetIntDefault("ChangeWeatherInterval", 10 * MINUTE * IN_MILISECONDS);
|
||||
|
||||
if(reload)
|
||||
{
|
||||
@@ -777,7 +777,7 @@ void World::LoadConfigSettings(bool reload)
|
||||
|
||||
m_configs[CONFIG_CAST_UNSTUCK] = sConfig.GetBoolDefault("CastUnstuck", true);
|
||||
m_configs[CONFIG_INSTANCE_RESET_TIME_HOUR] = sConfig.GetIntDefault("Instance.ResetTimeHour", 4);
|
||||
m_configs[CONFIG_INSTANCE_UNLOAD_DELAY] = sConfig.GetIntDefault("Instance.UnloadDelay", 1800000);
|
||||
m_configs[CONFIG_INSTANCE_UNLOAD_DELAY] = sConfig.GetIntDefault("Instance.UnloadDelay", 30 * MINUTE * IN_MILISECONDS);
|
||||
|
||||
m_configs[CONFIG_MAX_PRIMARY_TRADE_SKILL] = sConfig.GetIntDefault("MaxPrimaryTradeSkill", 2);
|
||||
m_configs[CONFIG_MIN_PETITION_SIGNS] = sConfig.GetIntDefault("MinPetitionSigns", 9);
|
||||
@@ -943,7 +943,7 @@ void World::LoadConfigSettings(bool reload)
|
||||
m_configs[CONFIG_BATTLEGROUND_INVITATION_TYPE] = sConfig.GetIntDefault ("Battleground.InvitationType", 0);
|
||||
m_configs[CONFIG_BATTLEGROUND_PREMATURE_FINISH_TIMER] = sConfig.GetIntDefault ("BattleGround.PrematureFinishTimer", 5 * MINUTE * IN_MILISECONDS);
|
||||
m_configs[CONFIG_BATTLEGROUND_PREMADE_GROUP_WAIT_FOR_MATCH] = sConfig.GetIntDefault ("BattleGround.PremadeGroupWaitForMatch", 30 * MINUTE * IN_MILISECONDS);
|
||||
m_configs[CONFIG_ARENA_MAX_RATING_DIFFERENCE] = sConfig.GetIntDefault ("Arena.MaxRatingDifference", 100);
|
||||
m_configs[CONFIG_ARENA_MAX_RATING_DIFFERENCE] = sConfig.GetIntDefault ("Arena.MaxRatingDifference", 150);
|
||||
m_configs[CONFIG_ARENA_RATING_DISCARD_TIMER] = sConfig.GetIntDefault ("Arena.RatingDiscardTimer", 10 * MINUTE * IN_MILISECONDS);
|
||||
m_configs[CONFIG_ARENA_AUTO_DISTRIBUTE_POINTS] = sConfig.GetBoolDefault("Arena.AutoDistributePoints", false);
|
||||
m_configs[CONFIG_ARENA_AUTO_DISTRIBUTE_INTERVAL_DAYS] = sConfig.GetIntDefault ("Arena.AutoDistributeInterval", 7);
|
||||
|
||||
@@ -109,7 +109,7 @@ EAIErrorLevel = 2
|
||||
#
|
||||
# SocketSelectTime
|
||||
# Socket select time (in milliseconds)
|
||||
# Default: 10000
|
||||
# Default: 10000 (10 secs)
|
||||
#
|
||||
# GridCleanUpDelay
|
||||
# Grid clean up delay (in milliseconds)
|
||||
@@ -130,8 +130,8 @@ EAIErrorLevel = 2
|
||||
# vmap.enableLOS
|
||||
# vmap.enableHeight
|
||||
# Enable/Disable VMmap support for line of sight and height calculation
|
||||
# Default: 1 (true)
|
||||
# 0 (false)
|
||||
# Default: 0 (disable)
|
||||
# 1 (enable)
|
||||
#
|
||||
# vmap.ignoreMapIds
|
||||
# Map id that will be ignored by VMaps
|
||||
@@ -524,7 +524,7 @@ LogColors = ""
|
||||
#
|
||||
# Instance.UnloadDelay
|
||||
# Unload the instance map from memory after some time if no players are inside.
|
||||
# Default: 1800000 (miliseconds, i.e 30 minutes)
|
||||
# Default: 1800000 (miliseconds 30 minutes)
|
||||
# 0 (instance maps are kept in memory until they are reset)
|
||||
#
|
||||
# Quests.LowLevelHideDiff
|
||||
@@ -874,7 +874,7 @@ Channel.SilentlyGMJoin = 0
|
||||
# 1 (enable)
|
||||
#
|
||||
# GM.InGMList
|
||||
# Is GM showed in GM list (if visible) in non-GM state (.gmoff)
|
||||
# Is GM showed in GM list (if visible) in non-GM state (.gm off)
|
||||
# Default: 0 (false)
|
||||
# 1 (true)
|
||||
#
|
||||
@@ -899,8 +899,8 @@ Channel.SilentlyGMJoin = 0
|
||||
#
|
||||
# GM.AllowAchievementGain
|
||||
# If enabled it allows gaining achievements for GM characters
|
||||
# Default: 0 (disable)
|
||||
# 1 (enable) (default)
|
||||
# Default: 1 (enable)
|
||||
# 0 (disable)
|
||||
#
|
||||
###################################################################################################################
|
||||
|
||||
@@ -1090,7 +1090,7 @@ Visibility.Distance.Grey.Object = 10
|
||||
#
|
||||
# Death.Bones.World
|
||||
# Death.Bones.BattlegroundOrArena
|
||||
# Enabled/disabled creating bones instead corpse at resurrection (in normal zones/instacnes, or battleground/arenas)
|
||||
# Enable/disable creating bones instead corpse at resurrection (in normal zones/instacnes, or battleground/arenas)
|
||||
# Default: 1 (enabled)
|
||||
# 0 (disabled)
|
||||
#
|
||||
@@ -1156,19 +1156,19 @@ Death.Bones.BattlegroundOrArena = 1
|
||||
# BATTLEGROUND CONFIG
|
||||
#
|
||||
# Battleground.CastDeserter
|
||||
# Cast or not Deserter spell at player who leave battleground in progress
|
||||
# Default: 1 (true)
|
||||
# 0 (false)
|
||||
# Cast Deserter spell at player who leave battleground in progress
|
||||
# Default: 1 (enable)
|
||||
# 0 (disable)
|
||||
#
|
||||
# Battleground.QueueAnnouncer.Enable
|
||||
# Enable queue announcer posting to chat
|
||||
# Default: 0 (false)
|
||||
# 1 (true)
|
||||
# Default: 0 (disable)
|
||||
# 1 (enable)
|
||||
#
|
||||
# Battleground.QueueAnnouncer.PlayerOnly
|
||||
# Enable queue announcer posting to chat
|
||||
# Default: 0 (false)
|
||||
# 1 (true)
|
||||
# Default: 0 (disable)
|
||||
# 1 (enable)
|
||||
#
|
||||
# Battleground.InvitationType
|
||||
# Set Battleground invitation type
|
||||
@@ -1200,7 +1200,7 @@ BattleGround.PremadeGroupWaitForMatch = 1800000
|
||||
#
|
||||
# Arena.MaxRatingDifference
|
||||
# The maximum rating difference between two groups in rated matches
|
||||
# Default: 100 (enable, recommended)
|
||||
# Default: 150 (enable, recommended)
|
||||
# 0 (disable, rating difference is discarded)
|
||||
#
|
||||
# Arena.RatingDiscardTimer
|
||||
@@ -1208,7 +1208,7 @@ BattleGround.PremadeGroupWaitForMatch = 1800000
|
||||
# rating information will be discarded when selecting teams for matches
|
||||
# also initiates an update by this timer
|
||||
# Default: 600000 (10 minutes, recommended)
|
||||
# 0 (disable, DO NOT USE - it will cause lags)
|
||||
# 0 (disable)
|
||||
#
|
||||
# Arena.AutoDistributePoints
|
||||
# Set if arena points should be distributed automatically, or by GM command
|
||||
@@ -1222,8 +1222,8 @@ BattleGround.PremadeGroupWaitForMatch = 1800000
|
||||
#
|
||||
# Arena.QueueAnnouncer.Enable
|
||||
# Enable bg queue announcer posting to chat
|
||||
# Default: 0 (false)
|
||||
# 1 (true)
|
||||
# Default: 0 (disable)
|
||||
# 1 (enable)
|
||||
#
|
||||
# Arena.ArenaSeason.ID
|
||||
# Current area season id show in client
|
||||
@@ -1236,7 +1236,7 @@ BattleGround.PremadeGroupWaitForMatch = 1800000
|
||||
#
|
||||
###################################################################################################################
|
||||
|
||||
Arena.MaxRatingDifference = 100
|
||||
Arena.MaxRatingDifference = 150
|
||||
Arena.RatingDiscardTimer = 600000
|
||||
Arena.AutoDistributePoints = 0
|
||||
Arena.AutoDistributeInterval = 7
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#ifndef __REVISION_NR_H__
|
||||
#define __REVISION_NR_H__
|
||||
#define REVISION_NR "7382"
|
||||
#define REVISION_NR "7384"
|
||||
#endif // __REVISION_NR_H__
|
||||
|
||||
Reference in New Issue
Block a user