mirror of
https://github.com/mangosfour/server.git
synced 2025-12-26 07:37:02 +00:00
Various Cleanups (game A-B)
This commit is contained in:
parent
2a4b8f2cb0
commit
f80629e307
47 changed files with 1359 additions and 1337 deletions
|
|
@ -34,14 +34,14 @@
|
|||
#include "ScriptMgr.h"
|
||||
#include "World.h"
|
||||
|
||||
void WorldSession::HandleBattlemasterHelloOpcode(WorldPacket & recv_data)
|
||||
void WorldSession::HandleBattlemasterHelloOpcode(WorldPacket& recv_data)
|
||||
{
|
||||
ObjectGuid guid;
|
||||
recv_data >> guid;
|
||||
|
||||
DEBUG_LOG("WORLD: Recvd CMSG_BATTLEMASTER_HELLO Message from %s", guid.GetString().c_str());
|
||||
|
||||
Creature *pCreature = GetPlayer()->GetMap()->GetCreature(guid);
|
||||
Creature* pCreature = GetPlayer()->GetMap()->GetCreature(guid);
|
||||
|
||||
if (!pCreature)
|
||||
return;
|
||||
|
|
@ -68,21 +68,21 @@ void WorldSession::HandleBattlemasterHelloOpcode(WorldPacket & recv_data)
|
|||
SendBattlegGroundList(guid, bgTypeId);
|
||||
}
|
||||
|
||||
void WorldSession::SendBattlegGroundList( ObjectGuid guid, BattleGroundTypeId bgTypeId )
|
||||
void WorldSession::SendBattlegGroundList(ObjectGuid guid, BattleGroundTypeId bgTypeId)
|
||||
{
|
||||
WorldPacket data;
|
||||
sBattleGroundMgr.BuildBattleGroundListPacket(&data, guid, _player, bgTypeId, 0);
|
||||
SendPacket( &data );
|
||||
SendPacket(&data);
|
||||
}
|
||||
|
||||
void WorldSession::HandleBattlemasterJoinOpcode( WorldPacket & recv_data )
|
||||
void WorldSession::HandleBattlemasterJoinOpcode(WorldPacket& recv_data)
|
||||
{
|
||||
ObjectGuid guid;
|
||||
uint32 bgTypeId_;
|
||||
uint32 instanceId;
|
||||
uint8 joinAsGroup;
|
||||
bool isPremade = false;
|
||||
Group * grp;
|
||||
Group* grp;
|
||||
|
||||
recv_data >> guid; // battlemaster guid
|
||||
recv_data >> bgTypeId_; // battleground type id (DBC id)
|
||||
|
|
@ -97,7 +97,7 @@ void WorldSession::HandleBattlemasterJoinOpcode( WorldPacket & recv_data )
|
|||
|
||||
BattleGroundTypeId bgTypeId = BattleGroundTypeId(bgTypeId_);
|
||||
|
||||
DEBUG_LOG( "WORLD: Recvd CMSG_BATTLEMASTER_JOIN Message from %s", guid.GetString().c_str());
|
||||
DEBUG_LOG("WORLD: Recvd CMSG_BATTLEMASTER_JOIN Message from %s", guid.GetString().c_str());
|
||||
|
||||
// can do this, since it's battleground, not arena
|
||||
BattleGroundQueueTypeId bgQueueTypeId = BattleGroundMgr::BGQueueTypeId(bgTypeId, ARENA_TYPE_NONE);
|
||||
|
|
@ -107,7 +107,7 @@ void WorldSession::HandleBattlemasterJoinOpcode( WorldPacket & recv_data )
|
|||
return;
|
||||
|
||||
// get bg instance or bg template if instance not found
|
||||
BattleGround *bg = NULL;
|
||||
BattleGround* bg = NULL;
|
||||
if (instanceId)
|
||||
bg = sBattleGroundMgr.GetBattleGroundThroughClientInstance(instanceId, bgTypeId);
|
||||
|
||||
|
|
@ -153,7 +153,7 @@ void WorldSession::HandleBattlemasterJoinOpcode( WorldPacket & recv_data )
|
|||
return;
|
||||
err = grp->CanJoinBattleGroundQueue(bg, bgQueueTypeId, 0, bg->GetMaxPlayersPerTeam(), false, 0);
|
||||
isPremade = sWorld.getConfig(CONFIG_UINT32_BATTLEGROUND_PREMADE_GROUP_WAIT_FOR_MATCH) &&
|
||||
(grp->GetMembersCount() >= bg->GetMinPlayersPerTeam());
|
||||
(grp->GetMembersCount() >= bg->GetMinPlayersPerTeam());
|
||||
}
|
||||
// if we're here, then the conditions to join a bg are met. We can proceed in joining.
|
||||
|
||||
|
|
@ -164,22 +164,22 @@ void WorldSession::HandleBattlemasterJoinOpcode( WorldPacket & recv_data )
|
|||
GroupQueueInfo* ginfo = NULL;
|
||||
uint32 avgTime = 0;
|
||||
|
||||
if(err > 0)
|
||||
if (err > 0)
|
||||
{
|
||||
DEBUG_LOG("Battleground: the following players are joining as group:");
|
||||
ginfo = bgQueue.AddGroup(_player, grp, bgTypeId, bracketEntry, ARENA_TYPE_NONE, false, isPremade, 0);
|
||||
avgTime = bgQueue.GetAverageQueueWaitTime(ginfo, bracketEntry->GetBracketId());
|
||||
}
|
||||
|
||||
for(GroupReference *itr = grp->GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
for (GroupReference* itr = grp->GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
{
|
||||
Player *member = itr->getSource();
|
||||
if(!member)
|
||||
Player* member = itr->getSource();
|
||||
if (!member)
|
||||
continue; // this should never happen
|
||||
|
||||
WorldPacket data;
|
||||
|
||||
if(err <= 0)
|
||||
if (err <= 0)
|
||||
{
|
||||
sBattleGroundMgr.BuildGroupJoinedBattlegroundPacket(&data, err);
|
||||
member->GetSession()->SendPacket(&data);
|
||||
|
|
@ -200,13 +200,13 @@ void WorldSession::HandleBattlemasterJoinOpcode( WorldPacket & recv_data )
|
|||
}
|
||||
else
|
||||
{
|
||||
GroupQueueInfo * ginfo = bgQueue.AddGroup(_player, NULL, bgTypeId, bracketEntry, ARENA_TYPE_NONE, false, isPremade, 0);
|
||||
GroupQueueInfo* ginfo = bgQueue.AddGroup(_player, NULL, bgTypeId, bracketEntry, ARENA_TYPE_NONE, false, isPremade, 0);
|
||||
uint32 avgTime = bgQueue.GetAverageQueueWaitTime(ginfo, bracketEntry->GetBracketId());
|
||||
// already checked if queueSlot is valid, now just get it
|
||||
uint32 queueSlot = _player->AddBattleGroundQueueId(bgQueueTypeId);
|
||||
|
||||
WorldPacket data;
|
||||
// send status packet (in queue)
|
||||
// send status packet (in queue)
|
||||
sBattleGroundMgr.BuildBattleGroundStatusPacket(&data, bg, queueSlot, STATUS_WAIT_QUEUE, avgTime, 0, ginfo->arenaType);
|
||||
SendPacket(&data);
|
||||
DEBUG_LOG("Battleground: player joined queue for bg queue type %u bg type %u: GUID %u, NAME %s",bgQueueTypeId,bgTypeId,_player->GetGUIDLow(), _player->GetName());
|
||||
|
|
@ -214,79 +214,79 @@ void WorldSession::HandleBattlemasterJoinOpcode( WorldPacket & recv_data )
|
|||
sBattleGroundMgr.ScheduleQueueUpdate(0, ARENA_TYPE_NONE, bgQueueTypeId, bgTypeId, bracketEntry->GetBracketId());
|
||||
}
|
||||
|
||||
void WorldSession::HandleBattleGroundPlayerPositionsOpcode( WorldPacket & /*recv_data*/ )
|
||||
void WorldSession::HandleBattleGroundPlayerPositionsOpcode(WorldPacket& /*recv_data*/)
|
||||
{
|
||||
// empty opcode
|
||||
// empty opcode
|
||||
DEBUG_LOG("WORLD: Recvd MSG_BATTLEGROUND_PLAYER_POSITIONS Message");
|
||||
|
||||
BattleGround *bg = _player->GetBattleGround();
|
||||
if(!bg) // can't be received if player not in battleground
|
||||
BattleGround* bg = _player->GetBattleGround();
|
||||
if (!bg) // can't be received if player not in battleground
|
||||
return;
|
||||
|
||||
switch( bg->GetTypeID() )
|
||||
switch (bg->GetTypeID())
|
||||
{
|
||||
case BATTLEGROUND_WS:
|
||||
{
|
||||
uint32 count1 = 0; // always constant zero?
|
||||
uint32 count2 = 0; // count of next fields
|
||||
|
||||
Player* ali_plr = sObjectMgr.GetPlayer(((BattleGroundWS*)bg)->GetAllianceFlagPickerGuid());
|
||||
if (ali_plr)
|
||||
++count2;
|
||||
|
||||
Player* horde_plr = sObjectMgr.GetPlayer(((BattleGroundWS*)bg)->GetHordeFlagPickerGuid());
|
||||
if (horde_plr)
|
||||
++count2;
|
||||
|
||||
WorldPacket data(MSG_BATTLEGROUND_PLAYER_POSITIONS, (4+4+16*count1+16*count2));
|
||||
data << count1; // alliance flag holders count - obsolete, now always 0
|
||||
/*for(uint8 i = 0; i < count1; ++i)
|
||||
{
|
||||
uint32 count1 = 0; // always constant zero?
|
||||
uint32 count2 = 0; // count of next fields
|
||||
|
||||
Player *ali_plr = sObjectMgr.GetPlayer(((BattleGroundWS*)bg)->GetAllianceFlagPickerGuid());
|
||||
if (ali_plr)
|
||||
++count2;
|
||||
|
||||
Player *horde_plr = sObjectMgr.GetPlayer(((BattleGroundWS*)bg)->GetHordeFlagPickerGuid());
|
||||
if (horde_plr)
|
||||
++count2;
|
||||
|
||||
WorldPacket data(MSG_BATTLEGROUND_PLAYER_POSITIONS, (4+4+16*count1+16*count2));
|
||||
data << count1; // alliance flag holders count - obsolete, now always 0
|
||||
/*for(uint8 i = 0; i < count1; ++i)
|
||||
{
|
||||
data << ObjectGuid(0); // guid
|
||||
data << (float)0; // x
|
||||
data << (float)0; // y
|
||||
}*/
|
||||
data << count2; // horde flag holders count - obsolete, now count of next fields
|
||||
if (ali_plr)
|
||||
{
|
||||
data << ObjectGuid(ali_plr->GetObjectGuid());
|
||||
data << float(ali_plr->GetPositionX());
|
||||
data << float(ali_plr->GetPositionY());
|
||||
}
|
||||
if (horde_plr)
|
||||
{
|
||||
data << ObjectGuid(horde_plr->GetObjectGuid());
|
||||
data << float(horde_plr->GetPositionX());
|
||||
data << float(horde_plr->GetPositionY());
|
||||
}
|
||||
|
||||
SendPacket(&data);
|
||||
data << ObjectGuid(0); // guid
|
||||
data << (float)0; // x
|
||||
data << (float)0; // y
|
||||
}*/
|
||||
data << count2; // horde flag holders count - obsolete, now count of next fields
|
||||
if (ali_plr)
|
||||
{
|
||||
data << ObjectGuid(ali_plr->GetObjectGuid());
|
||||
data << float(ali_plr->GetPositionX());
|
||||
data << float(ali_plr->GetPositionY());
|
||||
}
|
||||
break;
|
||||
if (horde_plr)
|
||||
{
|
||||
data << ObjectGuid(horde_plr->GetObjectGuid());
|
||||
data << float(horde_plr->GetPositionX());
|
||||
data << float(horde_plr->GetPositionY());
|
||||
}
|
||||
|
||||
SendPacket(&data);
|
||||
}
|
||||
break;
|
||||
case BATTLEGROUND_EY:
|
||||
//TODO : fix me!
|
||||
break;
|
||||
case BATTLEGROUND_AB:
|
||||
case BATTLEGROUND_AV:
|
||||
{
|
||||
//for other BG types - send default
|
||||
WorldPacket data(MSG_BATTLEGROUND_PLAYER_POSITIONS, (4+4));
|
||||
data << uint32(0);
|
||||
data << uint32(0);
|
||||
SendPacket(&data);
|
||||
}
|
||||
break;
|
||||
{
|
||||
//for other BG types - send default
|
||||
WorldPacket data(MSG_BATTLEGROUND_PLAYER_POSITIONS, (4+4));
|
||||
data << uint32(0);
|
||||
data << uint32(0);
|
||||
SendPacket(&data);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
//maybe it is sent also in arena - do nothing
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void WorldSession::HandlePVPLogDataOpcode( WorldPacket & /*recv_data*/ )
|
||||
void WorldSession::HandlePVPLogDataOpcode(WorldPacket& /*recv_data*/)
|
||||
{
|
||||
DEBUG_LOG( "WORLD: Recvd MSG_PVP_LOG_DATA Message");
|
||||
DEBUG_LOG("WORLD: Recvd MSG_PVP_LOG_DATA Message");
|
||||
|
||||
BattleGround *bg = _player->GetBattleGround();
|
||||
BattleGround* bg = _player->GetBattleGround();
|
||||
if (!bg)
|
||||
return;
|
||||
|
||||
|
|
@ -298,12 +298,12 @@ void WorldSession::HandlePVPLogDataOpcode( WorldPacket & /*recv_data*/ )
|
|||
sBattleGroundMgr.BuildPvpLogDataPacket(&data, bg);
|
||||
SendPacket(&data);
|
||||
|
||||
DEBUG_LOG( "WORLD: Sent MSG_PVP_LOG_DATA Message");
|
||||
DEBUG_LOG("WORLD: Sent MSG_PVP_LOG_DATA Message");
|
||||
}
|
||||
|
||||
void WorldSession::HandleBattlefieldListOpcode( WorldPacket &recv_data )
|
||||
void WorldSession::HandleBattlefieldListOpcode(WorldPacket& recv_data)
|
||||
{
|
||||
DEBUG_LOG( "WORLD: Recvd CMSG_BATTLEFIELD_LIST Message");
|
||||
DEBUG_LOG("WORLD: Recvd CMSG_BATTLEFIELD_LIST Message");
|
||||
|
||||
uint32 bgTypeId;
|
||||
recv_data >> bgTypeId; // id from DBC
|
||||
|
|
@ -323,12 +323,12 @@ void WorldSession::HandleBattlefieldListOpcode( WorldPacket &recv_data )
|
|||
|
||||
WorldPacket data;
|
||||
sBattleGroundMgr.BuildBattleGroundListPacket(&data, ObjectGuid(), _player, BattleGroundTypeId(bgTypeId), fromWhere);
|
||||
SendPacket( &data );
|
||||
SendPacket(&data);
|
||||
}
|
||||
|
||||
void WorldSession::HandleBattleFieldPortOpcode( WorldPacket &recv_data )
|
||||
void WorldSession::HandleBattleFieldPortOpcode(WorldPacket& recv_data)
|
||||
{
|
||||
DEBUG_LOG( "WORLD: Recvd CMSG_BATTLEFIELD_PORT Message");
|
||||
DEBUG_LOG("WORLD: Recvd CMSG_BATTLEFIELD_PORT Message");
|
||||
|
||||
uint8 type; // arenatype if arena
|
||||
uint8 unk2; // unk, can be 0x0 (may be if was invited?) and 0x1
|
||||
|
|
@ -374,7 +374,7 @@ void WorldSession::HandleBattleFieldPortOpcode( WorldPacket &recv_data )
|
|||
return;
|
||||
}
|
||||
|
||||
BattleGround *bg = sBattleGroundMgr.GetBattleGround(ginfo.IsInvitedToBGInstanceGUID, bgTypeId);
|
||||
BattleGround* bg = sBattleGroundMgr.GetBattleGround(ginfo.IsInvitedToBGInstanceGUID, bgTypeId);
|
||||
|
||||
// bg template might and must be used in case of leaving queue, when instance is not created yet
|
||||
if (!bg && action == 0)
|
||||
|
|
@ -407,13 +407,13 @@ void WorldSession::HandleBattleFieldPortOpcode( WorldPacket &recv_data )
|
|||
if (_player->getLevel() > bg->GetMaxLevel())
|
||||
{
|
||||
sLog.outError("Battleground: Player %s (%u) has level (%u) higher than maxlevel (%u) of battleground (%u)! Do not port him to battleground!",
|
||||
_player->GetName(), _player->GetGUIDLow(), _player->getLevel(), bg->GetMaxLevel(), bg->GetTypeID());
|
||||
_player->GetName(), _player->GetGUIDLow(), _player->getLevel(), bg->GetMaxLevel(), bg->GetTypeID());
|
||||
action = 0;
|
||||
}
|
||||
}
|
||||
uint32 queueSlot = _player->GetBattleGroundQueueIndex(bgQueueTypeId);
|
||||
WorldPacket data;
|
||||
switch( action )
|
||||
switch (action)
|
||||
{
|
||||
case 1: // port to battleground
|
||||
if (!_player->IsInvitedForBattleGroundQueueType(bgQueueTypeId))
|
||||
|
|
@ -441,7 +441,7 @@ void WorldSession::HandleBattleFieldPortOpcode( WorldPacket &recv_data )
|
|||
bgQueue.RemovePlayer(_player->GetObjectGuid(), false);
|
||||
// this is still needed here if battleground "jumping" shouldn't add deserter debuff
|
||||
// also this is required to prevent stuck at old battleground after SetBattleGroundId set to new
|
||||
if (BattleGround *currentBg = _player->GetBattleGround())
|
||||
if (BattleGround* currentBg = _player->GetBattleGround())
|
||||
currentBg->RemovePlayerAtLeave(_player->GetObjectGuid(), false, true);
|
||||
|
||||
// set the destination instance id
|
||||
|
|
@ -458,7 +458,7 @@ void WorldSession::HandleBattleFieldPortOpcode( WorldPacket &recv_data )
|
|||
// if player leaves rated arena match before match start, it is counted as he played but he lost
|
||||
if (ginfo.IsRated && ginfo.IsInvitedToBGInstanceGUID)
|
||||
{
|
||||
ArenaTeam * at = sObjectMgr.GetArenaTeamById(ginfo.ArenaTeamId);
|
||||
ArenaTeam* at = sObjectMgr.GetArenaTeamById(ginfo.ArenaTeamId);
|
||||
if (at)
|
||||
{
|
||||
DEBUG_LOG("UPDATING memberLost's personal arena rating for %s by opponents rating: %u, because he has left queue!", _player->GetGuidStr().c_str(), ginfo.OpponentsTeamRating);
|
||||
|
|
@ -481,9 +481,9 @@ void WorldSession::HandleBattleFieldPortOpcode( WorldPacket &recv_data )
|
|||
}
|
||||
}
|
||||
|
||||
void WorldSession::HandleLeaveBattlefieldOpcode( WorldPacket& recv_data )
|
||||
void WorldSession::HandleLeaveBattlefieldOpcode(WorldPacket& recv_data)
|
||||
{
|
||||
DEBUG_LOG( "WORLD: Recvd CMSG_LEAVE_BATTLEFIELD Message");
|
||||
DEBUG_LOG("WORLD: Recvd CMSG_LEAVE_BATTLEFIELD Message");
|
||||
|
||||
recv_data.read_skip<uint8>(); // unk1
|
||||
recv_data.read_skip<uint8>(); // unk2
|
||||
|
|
@ -502,14 +502,14 @@ void WorldSession::HandleLeaveBattlefieldOpcode( WorldPacket& recv_data )
|
|||
_player->LeaveBattleground();
|
||||
}
|
||||
|
||||
void WorldSession::HandleBattlefieldStatusOpcode( WorldPacket & /*recv_data*/ )
|
||||
void WorldSession::HandleBattlefieldStatusOpcode(WorldPacket& /*recv_data*/)
|
||||
{
|
||||
// empty opcode
|
||||
DEBUG_LOG( "WORLD: Battleground status" );
|
||||
DEBUG_LOG("WORLD: Battleground status");
|
||||
|
||||
WorldPacket data;
|
||||
// we must update all queues here
|
||||
BattleGround *bg = NULL;
|
||||
BattleGround* bg = NULL;
|
||||
for (uint8 i = 0; i < PLAYER_MAX_BATTLEGROUND_QUEUES; ++i)
|
||||
{
|
||||
BattleGroundQueueTypeId bgQueueTypeId = _player->GetBattleGroundQueueTypeId(i);
|
||||
|
|
@ -567,49 +567,49 @@ void WorldSession::HandleBattlefieldStatusOpcode( WorldPacket & /*recv_data*/ )
|
|||
}
|
||||
}
|
||||
|
||||
void WorldSession::HandleAreaSpiritHealerQueryOpcode( WorldPacket & recv_data )
|
||||
void WorldSession::HandleAreaSpiritHealerQueryOpcode(WorldPacket& recv_data)
|
||||
{
|
||||
DEBUG_LOG("WORLD: CMSG_AREA_SPIRIT_HEALER_QUERY");
|
||||
|
||||
BattleGround *bg = _player->GetBattleGround();
|
||||
BattleGround* bg = _player->GetBattleGround();
|
||||
if (!bg)
|
||||
return;
|
||||
|
||||
ObjectGuid guid;
|
||||
recv_data >> guid;
|
||||
|
||||
Creature *unit = GetPlayer()->GetMap()->GetCreature(guid);
|
||||
Creature* unit = GetPlayer()->GetMap()->GetCreature(guid);
|
||||
if (!unit)
|
||||
return;
|
||||
|
||||
if(!unit->isSpiritService()) // it's not spirit service
|
||||
if (!unit->isSpiritService()) // it's not spirit service
|
||||
return;
|
||||
|
||||
unit->SendAreaSpiritHealerQueryOpcode(GetPlayer());
|
||||
}
|
||||
|
||||
void WorldSession::HandleAreaSpiritHealerQueueOpcode( WorldPacket & recv_data )
|
||||
void WorldSession::HandleAreaSpiritHealerQueueOpcode(WorldPacket& recv_data)
|
||||
{
|
||||
DEBUG_LOG("WORLD: CMSG_AREA_SPIRIT_HEALER_QUEUE");
|
||||
|
||||
BattleGround *bg = _player->GetBattleGround();
|
||||
BattleGround* bg = _player->GetBattleGround();
|
||||
if (!bg)
|
||||
return;
|
||||
|
||||
ObjectGuid guid;
|
||||
recv_data >> guid;
|
||||
|
||||
Creature *unit = GetPlayer()->GetMap()->GetCreature(guid);
|
||||
Creature* unit = GetPlayer()->GetMap()->GetCreature(guid);
|
||||
if (!unit)
|
||||
return;
|
||||
|
||||
if(!unit->isSpiritService()) // it's not spirit service
|
||||
if (!unit->isSpiritService()) // it's not spirit service
|
||||
return;
|
||||
|
||||
sScriptMgr.OnGossipHello(GetPlayer(), unit);
|
||||
}
|
||||
|
||||
void WorldSession::HandleBattlemasterJoinArena( WorldPacket & recv_data )
|
||||
void WorldSession::HandleBattlemasterJoinArena(WorldPacket& recv_data)
|
||||
{
|
||||
DEBUG_LOG("WORLD: CMSG_BATTLEMASTER_JOIN_ARENA");
|
||||
//recv_data.hexlike();
|
||||
|
|
@ -625,17 +625,17 @@ void WorldSession::HandleBattlemasterJoinArena( WorldPacket & recv_data )
|
|||
if (_player->InBattleGround())
|
||||
return;
|
||||
|
||||
Creature *unit = GetPlayer()->GetMap()->GetCreature(guid);
|
||||
Creature* unit = GetPlayer()->GetMap()->GetCreature(guid);
|
||||
if (!unit)
|
||||
return;
|
||||
|
||||
if(!unit->isBattleMaster()) // it's not battle master
|
||||
if (!unit->isBattleMaster()) // it's not battle master
|
||||
return;
|
||||
|
||||
ArenaType arenatype;
|
||||
uint32 arenaRating = 0;
|
||||
|
||||
switch(arenaslot)
|
||||
switch (arenaslot)
|
||||
{
|
||||
case 0:
|
||||
arenatype = ARENA_TYPE_2v2;
|
||||
|
|
@ -667,7 +667,7 @@ void WorldSession::HandleBattlemasterJoinArena( WorldPacket & recv_data )
|
|||
|
||||
GroupJoinBattlegroundResult err;
|
||||
|
||||
Group * grp = NULL;
|
||||
Group* grp = NULL;
|
||||
|
||||
// check queue conditions
|
||||
if (!asGroup)
|
||||
|
|
@ -702,7 +702,7 @@ void WorldSession::HandleBattlemasterJoinArena( WorldPacket & recv_data )
|
|||
{
|
||||
ateamId = _player->GetArenaTeamId(arenaslot);
|
||||
// check real arena team existence only here (if it was moved to group->CanJoin .. () then we would have to get it twice)
|
||||
ArenaTeam * at = sObjectMgr.GetArenaTeamById(ateamId);
|
||||
ArenaTeam* at = sObjectMgr.GetArenaTeamById(ateamId);
|
||||
if (!at)
|
||||
{
|
||||
_player->GetSession()->SendNotInArenaTeamPacket(arenatype);
|
||||
|
|
@ -714,7 +714,7 @@ void WorldSession::HandleBattlemasterJoinArena( WorldPacket & recv_data )
|
|||
// get the personal ratings for queue
|
||||
uint32 avg_pers_rating = 0;
|
||||
|
||||
for(Group::member_citerator citr = grp->GetMemberSlots().begin(); citr != grp->GetMemberSlots().end(); ++citr)
|
||||
for (Group::member_citerator citr = grp->GetMemberSlots().begin(); citr != grp->GetMemberSlots().end(); ++citr)
|
||||
{
|
||||
ArenaTeamMember const* at_member = at->GetMember(citr->guid);
|
||||
if (!at_member) // group member joining to arena must be in leader arena team
|
||||
|
|
@ -731,30 +731,30 @@ void WorldSession::HandleBattlemasterJoinArena( WorldPacket & recv_data )
|
|||
arenaRating = avg_pers_rating;
|
||||
}
|
||||
|
||||
BattleGroundQueue &bgQueue = sBattleGroundMgr.m_BattleGroundQueues[bgQueueTypeId];
|
||||
BattleGroundQueue& bgQueue = sBattleGroundMgr.m_BattleGroundQueues[bgQueueTypeId];
|
||||
if (asGroup)
|
||||
{
|
||||
uint32 avgTime = 0;
|
||||
|
||||
if(err > 0)
|
||||
if (err > 0)
|
||||
{
|
||||
DEBUG_LOG("Battleground: arena join as group start");
|
||||
if (isRated)
|
||||
DEBUG_LOG("Battleground: arena team id %u, leader %s queued with rating %u for type %u",_player->GetArenaTeamId(arenaslot),_player->GetName(),arenaRating,arenatype);
|
||||
|
||||
GroupQueueInfo * ginfo = bgQueue.AddGroup(_player, grp, bgTypeId, bracketEntry, arenatype, isRated, false, arenaRating, ateamId);
|
||||
GroupQueueInfo* ginfo = bgQueue.AddGroup(_player, grp, bgTypeId, bracketEntry, arenatype, isRated, false, arenaRating, ateamId);
|
||||
avgTime = bgQueue.GetAverageQueueWaitTime(ginfo, bracketEntry->GetBracketId());
|
||||
}
|
||||
|
||||
for(GroupReference *itr = grp->GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
for (GroupReference* itr = grp->GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
{
|
||||
Player *member = itr->getSource();
|
||||
if(!member)
|
||||
Player* member = itr->getSource();
|
||||
if (!member)
|
||||
continue;
|
||||
|
||||
WorldPacket data;
|
||||
|
||||
if(err <= 0)
|
||||
if (err <= 0)
|
||||
{
|
||||
sBattleGroundMgr.BuildGroupJoinedBattlegroundPacket(&data, err);
|
||||
member->GetSession()->SendPacket(&data);
|
||||
|
|
@ -775,7 +775,7 @@ void WorldSession::HandleBattlemasterJoinArena( WorldPacket & recv_data )
|
|||
}
|
||||
else
|
||||
{
|
||||
GroupQueueInfo * ginfo = bgQueue.AddGroup(_player, NULL, bgTypeId, bracketEntry, arenatype, isRated, false, arenaRating, ateamId);
|
||||
GroupQueueInfo* ginfo = bgQueue.AddGroup(_player, NULL, bgTypeId, bracketEntry, arenatype, isRated, false, arenaRating, ateamId);
|
||||
uint32 avgTime = bgQueue.GetAverageQueueWaitTime(ginfo, bracketEntry->GetBracketId());
|
||||
uint32 queueSlot = _player->AddBattleGroundQueueId(bgQueueTypeId);
|
||||
|
||||
|
|
@ -788,11 +788,11 @@ void WorldSession::HandleBattlemasterJoinArena( WorldPacket & recv_data )
|
|||
sBattleGroundMgr.ScheduleQueueUpdate(arenaRating, arenatype, bgQueueTypeId, bgTypeId, bracketEntry->GetBracketId());
|
||||
}
|
||||
|
||||
void WorldSession::HandleReportPvPAFK( WorldPacket & recv_data )
|
||||
void WorldSession::HandleReportPvPAFK(WorldPacket& recv_data)
|
||||
{
|
||||
ObjectGuid playerGuid;
|
||||
recv_data >> playerGuid;
|
||||
Player *reportedPlayer = sObjectMgr.GetPlayer(playerGuid);
|
||||
Player* reportedPlayer = sObjectMgr.GetPlayer(playerGuid);
|
||||
|
||||
if (!reportedPlayer)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue