Skip to content
This repository has been archived by the owner on Feb 29, 2024. It is now read-only.

Commit

Permalink
Server/Arena: Part2 ArenaTeamId's
Browse files Browse the repository at this point in the history
Signed-off-by: AriDEV <aridev666@gmail.com>
  • Loading branch information
AriDEV committed May 6, 2019
1 parent 570987a commit 37626c8
Showing 1 changed file with 1 addition and 20 deletions.
21 changes: 1 addition & 20 deletions src/server/game/Battlegrounds/BattlegroundQueue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -159,14 +159,6 @@ GroupQueueInfo* BattlegroundQueue::AddGroup(Player* leader, Group* grp, Battlegr

uint32 lastOnlineTime = getMSTime();

//announce world (this don't need mutex)
if (isRated && sWorld->getBoolConfig(CONFIG_ARENA_QUEUE_ANNOUNCER_ENABLE))
{
ArenaTeam* Team = sArenaTeamMgr->GetArenaTeamById(arenateamid);
if (Team)
sWorld->SendWorldText(LANG_ARENA_QUEUE_ANNOUNCE_WORLD_JOIN, Team->GetName().c_str(), ginfo->ArenaType, ginfo->ArenaType, ginfo->ArenaTeamRating);
}

//add players from group to ginfo
if (grp)
{
Expand Down Expand Up @@ -354,11 +346,6 @@ void BattlegroundQueue::RemovePlayer(uint64 guid, bool decreaseInvitedCount)
// remove player queue info
m_QueuedPlayers.erase(itr);

// announce to world if arena team left queue for rated match, show only once
if (group->ArenaType && group->IsRated && group->Players.empty() && sWorld->getBoolConfig(CONFIG_ARENA_QUEUE_ANNOUNCER_ENABLE))
if (ArenaTeam* Team = sArenaTeamMgr->GetArenaTeamById(group->ArenaTeamId))
sWorld->SendWorldText(LANG_ARENA_QUEUE_ANNOUNCE_WORLD_EXIT, Team->GetName().c_str(), group->ArenaType, group->ArenaType, group->ArenaTeamRating);

// if player leaves queue and he is invited to rated arena match, then he have to lose
if (group->IsInvitedToBGInstanceGUID && group->IsRated && decreaseInvitedCount)
{
Expand Down Expand Up @@ -445,10 +432,6 @@ bool BattlegroundQueue::InviteGroupToBG(GroupQueueInfo* ginfo, Battleground* bg,
BattlegroundQueueTypeId bgQueueTypeId = BattlegroundMgr::BGQueueTypeId(bgTypeId, bg->GetArenaType());
BattlegroundBracketId bracket_id = bg->GetBracketId();

// set ArenaTeamId for rated matches
if (bg->isArena() && bg->isRated())
bg->SetArenaTeamIdForTeam(ginfo->Team, ginfo->ArenaTeamId);

ginfo->RemoveInviteTime = getMSTime() + INVITE_ACCEPT_WAIT_TIME;

// loop through the players
Expand Down Expand Up @@ -930,7 +913,7 @@ void BattlegroundQueue::BattlegroundQueueUpdate(uint32 /*diff*/, BattlegroundTyp
if (!(*itr3)->IsInvitedToBGInstanceGUID
&& (((*itr3)->ArenaMatchmakerRating >= arenaMinRating && (*itr3)->ArenaMatchmakerRating <= arenaMaxRating)
|| (*itr3)->JoinTime < discardTime)
&& (*itr_teams[0])->ArenaTeamId != (*itr3)->ArenaTeamId)
&& (*itr_teams[0])->ArenaGroup != (*itr3)->ArenaGroup)
{
itr_teams[found++] = itr3;
break;
Expand All @@ -954,8 +937,6 @@ void BattlegroundQueue::BattlegroundQueueUpdate(uint32 /*diff*/, BattlegroundTyp
hTeam->OpponentsTeamRating = aTeam->ArenaTeamRating;
aTeam->OpponentsMatchmakerRating = hTeam->ArenaMatchmakerRating;
hTeam->OpponentsMatchmakerRating = aTeam->ArenaMatchmakerRating;
SF_LOG_DEBUG("bg.battleground", "setting oposite teamrating for team %u to %u", aTeam->ArenaTeamId, aTeam->OpponentsTeamRating);
SF_LOG_DEBUG("bg.battleground", "setting oposite teamrating for team %u to %u", hTeam->ArenaTeamId, hTeam->OpponentsTeamRating);

// now we must move team if we changed its faction to another faction queue, because then we will spam log by errors in Queue::RemovePlayer
if (aTeam->Team != ALLIANCE)
Expand Down

0 comments on commit 37626c8

Please sign in to comment.