[7336] Implemented new BattleGroundQueue invitation system. Now it supports premade group versus premade group matches.

Added 2 new config options - InvitationType and PremadeGroupWaitForMatch - you can find more info in default config file.
    This patch can cause crashes.

Author: Triply

[7338] Little cleanup in battleground queues code. Author: ApoC

--HG--
branch : trunk
This commit is contained in:
megamage
2009-02-27 12:13:59 -06:00
parent d3a6900667
commit 472f897b0a
14 changed files with 872 additions and 896 deletions
+43 -22
View File
@@ -89,6 +89,7 @@ enum BattleGroundTimeIntervals
{
RESURRECTION_INTERVAL = 30000, // ms
REMIND_INTERVAL = 30000, // ms
INVITATION_REMIND_TIME = 60000, // ms
INVITE_ACCEPT_WAIT_TIME = 80000, // ms
TIME_TO_AUTOREMOVE = 120000, // ms
MAX_OFFLINE_TIME = 300000, // ms
@@ -138,16 +139,30 @@ struct BattleGroundObjectInfo
// handle the queue types and bg types separately to enable joining queue for different sized arenas at the same time
enum BattleGroundQueueTypeId
{
BATTLEGROUND_QUEUE_NONE = 0,
BATTLEGROUND_QUEUE_AV = 1,
BATTLEGROUND_QUEUE_WS = 2,
BATTLEGROUND_QUEUE_AB = 3,
BATTLEGROUND_QUEUE_EY = 4,
BATTLEGROUND_QUEUE_SA = 5,
BATTLEGROUND_QUEUE_2v2 = 6,
BATTLEGROUND_QUEUE_3v3 = 7,
BATTLEGROUND_QUEUE_5v5 = 8,
BATTLEGROUND_QUEUE_NONE = 0,
BATTLEGROUND_QUEUE_AV = 1,
BATTLEGROUND_QUEUE_WS = 2,
BATTLEGROUND_QUEUE_AB = 3,
BATTLEGROUND_QUEUE_EY = 4,
BATTLEGROUND_QUEUE_SA = 5,
BATTLEGROUND_QUEUE_2v2 = 6,
BATTLEGROUND_QUEUE_3v3 = 7,
BATTLEGROUND_QUEUE_5v5 = 8
};
#define MAX_BATTLEGROUND_QUEUE_TYPES 9
enum BGQueueIdBasedOnLevel // queue_id for level ranges
{
QUEUE_ID_MAX_LEVEL_19 = 0,
QUEUE_ID_MAX_LEVEL_29 = 1,
QUEUE_ID_MAX_LEVEL_39 = 2,
QUEUE_ID_MAX_LEVEL_49 = 3,
QUEUE_ID_MAX_LEVEL_59 = 4,
QUEUE_ID_MAX_LEVEL_69 = 5,
QUEUE_ID_MAX_LEVEL_79 = 6,
QUEUE_ID_MAX_LEVEL_80 = 7
};
#define MAX_BATTLEGROUND_QUEUES 8
enum ScoreType
{
@@ -198,7 +213,8 @@ enum BattleGroundWinner
enum BattleGroundTeamId
{
BG_TEAM_ALLIANCE = 0,
BG_TEAM_HORDE = 1
BG_TEAM_HORDE = 1,
BG_TEAMS_COUNT = 2
};
enum BattleGroundJoinError
@@ -265,7 +281,7 @@ class BattleGround
// Get methods:
char const* GetName() const { return m_Name; }
BattleGroundTypeId GetTypeID() const { return m_TypeID; }
uint32 GetQueueId() const { return m_QueueId; }
BGQueueIdBasedOnLevel GetQueueId() const { return m_QueueId; }
uint32 GetInstanceID() const { return m_InstanceID; }
uint32 GetStatus() const { return m_Status; }
uint32 GetStartTime() const { return m_StartTime; }
@@ -288,7 +304,13 @@ class BattleGround
// Set methods:
void SetName(char const* Name) { m_Name = Name; }
void SetTypeID(BattleGroundTypeId TypeID) { m_TypeID = TypeID; }
void SetQueueId(uint32 ID) { m_QueueId = ID; }
//here we can count minlevel and maxlevel for players
void SetQueueId(BGQueueIdBasedOnLevel ID)
{
m_QueueId = ID;
uint8 diff = (m_TypeID == BATTLEGROUND_AV) ? 1 : 0;
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 SetStartTime(uint32 Time) { m_StartTime = Time; }
@@ -320,7 +342,6 @@ class BattleGround
else
return m_InvitedHorde;
}
bool HasFreeSlotsForTeam(uint32 Team) const;
bool HasFreeSlots() const;
uint32 GetFreeSlotsForTeam(uint32 Team) const;
@@ -489,7 +510,7 @@ class BattleGround
uint32 m_StartTime;
uint32 m_EndTime;
uint32 m_LastResurrectTime;
uint32 m_QueueId;
BGQueueIdBasedOnLevel m_QueueId;
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
@@ -515,15 +536,15 @@ class BattleGround
uint32 m_InvitedHorde;
/* Raid Group */
Group *m_BgRaids[2]; // 0 - alliance, 1 - horde
Group *m_BgRaids[BG_TEAMS_COUNT]; // 0 - alliance, 1 - horde
/* Players count by team */
uint32 m_PlayersCount[2];
uint32 m_PlayersCount[BG_TEAMS_COUNT];
/* Arena team ids by team */
uint32 m_ArenaTeamIds[2];
uint32 m_ArenaTeamIds[BG_TEAMS_COUNT];
int32 m_ArenaTeamRatingChanges[2];
int32 m_ArenaTeamRatingChanges[BG_TEAMS_COUNT];
/* Limits */
uint32 m_LevelMin;
@@ -535,10 +556,10 @@ class BattleGround
/* Location */
uint32 m_MapId;
float m_TeamStartLocX[2];
float m_TeamStartLocY[2];
float m_TeamStartLocZ[2];
float m_TeamStartLocO[2];
float m_TeamStartLocX[BG_TEAMS_COUNT];
float m_TeamStartLocY[BG_TEAMS_COUNT];
float m_TeamStartLocZ[BG_TEAMS_COUNT];
float m_TeamStartLocO[BG_TEAMS_COUNT];
};
#endif