diff options
| author | Shauren <shauren.trinity@gmail.com> | 2015-04-18 00:04:56 +0200 |
|---|---|---|
| committer | Shauren <shauren.trinity@gmail.com> | 2015-04-18 00:04:56 +0200 |
| commit | 4703169116d0417456742343cbed55c30be04666 (patch) | |
| tree | 773263f8f4c09f9e7844467ce16a3aca67410f30 /src/server/game/Handlers/BattleGroundHandler.cpp | |
| parent | 48b855a3b00930cb415da9f482fe6bc5dcad70b6 (diff) | |
Core/PacketIO: Updated and enabled more battleground packets
Diffstat (limited to 'src/server/game/Handlers/BattleGroundHandler.cpp')
| -rw-r--r-- | src/server/game/Handlers/BattleGroundHandler.cpp | 98 |
1 files changed, 2 insertions, 96 deletions
diff --git a/src/server/game/Handlers/BattleGroundHandler.cpp b/src/server/game/Handlers/BattleGroundHandler.cpp index 2b49b4673bf..ced3265a31c 100644 --- a/src/server/game/Handlers/BattleGroundHandler.cpp +++ b/src/server/game/Handlers/BattleGroundHandler.cpp @@ -37,7 +37,6 @@ #include "Battlefield.h" #include "BattlefieldMgr.h" #include "NPCPackets.h" -#include "BattlegroundPackets.h" void WorldSession::HandleBattlemasterHelloOpcode(WorldPackets::NPC::Hello& hello) { @@ -221,96 +220,6 @@ void WorldSession::HandleBattlemasterJoinOpcode(WorldPackets::Battleground::Batt sBattlegroundMgr->ScheduleQueueUpdate(0, 0, bgQueueTypeId, bgTypeId, bracketEntry->GetBracketId()); } -void WorldSession::HandleBattlegroundPlayerPositionsOpcode(WorldPacket& /*recvData*/) -{ - Battleground* bg = _player->GetBattleground(); - if (!bg) // can't be received if player not in battleground - return; - - uint32 acount = 0; - uint32 hcount = 0; - Player* aplr = NULL; - Player* hplr = NULL; - ObjectGuid guid = bg->GetFlagPickerGUID(TEAM_ALLIANCE); - if (!guid.IsEmpty()) - { - aplr = ObjectAccessor::FindPlayer(guid); - if (aplr) - ++acount; - } - - guid = bg->GetFlagPickerGUID(TEAM_HORDE); - if (!guid.IsEmpty()) - { - hplr = ObjectAccessor::FindPlayer(guid); - if (hplr) - ++hcount; - } - - ObjectGuid aguid = aplr ? aplr->GetGUID() : ObjectGuid::Empty; - ObjectGuid hguid = hplr ? hplr->GetGUID() : ObjectGuid::Empty; - - WorldPacket data(SMSG_BATTLEGROUND_PLAYER_POSITIONS); - - data.WriteBits(acount, 22); - for (uint8 i = 0; i < acount; i++) - { - data.WriteBit(aguid[3]); - data.WriteBit(aguid[5]); - data.WriteBit(aguid[1]); - data.WriteBit(aguid[6]); - data.WriteBit(aguid[7]); - data.WriteBit(aguid[0]); - data.WriteBit(aguid[2]); - data.WriteBit(aguid[4]); - } - - data.WriteBits(hcount, 22); - for (uint8 i = 0; i < hcount; i++) - { - data.WriteBit(hguid[6]); - data.WriteBit(hguid[5]); - data.WriteBit(hguid[4]); - data.WriteBit(hguid[7]); - data.WriteBit(hguid[2]); - data.WriteBit(hguid[1]); - data.WriteBit(hguid[0]); - data.WriteBit(hguid[3]); - } - - data.FlushBits(); - - for (uint8 i = 0; i < hcount; i++) - { - data.WriteByteSeq(hguid[2]); - data.WriteByteSeq(hguid[1]); - data << float(hplr->GetPositionY()); - data.WriteByteSeq(hguid[5]); - data.WriteByteSeq(hguid[4]); - data.WriteByteSeq(hguid[7]); - data.WriteByteSeq(hguid[0]); - data.WriteByteSeq(hguid[6]); - data.WriteByteSeq(hguid[3]); - data << float(hplr->GetPositionX()); - } - - for (uint8 i = 0; i < acount; i++) - { - data.WriteByteSeq(aguid[6]); - data << float(aplr->GetPositionX()); - data.WriteByteSeq(aguid[5]); - data.WriteByteSeq(aguid[3]); - data << float(aplr->GetPositionY()); - data.WriteByteSeq(aguid[1]); - data.WriteByteSeq(aguid[7]); - data.WriteByteSeq(aguid[0]); - data.WriteByteSeq(aguid[2]); - data.WriteByteSeq(aguid[4]); - } - - SendPacket(&data); -} - void WorldSession::HandlePVPLogDataOpcode(WorldPackets::Battleground::PVPLogDataRequest& /*pvpLogDataRequest*/) { Battleground* bg = _player->GetBattleground(); @@ -673,12 +582,9 @@ void WorldSession::HandleBattlemasterJoinArena(WorldPacket& recvData) sBattlegroundMgr->ScheduleQueueUpdate(matchmakerRating, arenatype, bgQueueTypeId, bgTypeId, bracketEntry->GetBracketId()); } -void WorldSession::HandleReportPvPAFK(WorldPacket& recvData) +void WorldSession::HandleReportPvPAFK(WorldPackets::Battleground::ReportPvPPlayerAFK& reportPvPPlayerAFK) { - ObjectGuid playerGuid; - recvData >> playerGuid; - Player* reportedPlayer = ObjectAccessor::FindPlayer(playerGuid); - + Player* reportedPlayer = ObjectAccessor::FindPlayer(reportPvPPlayerAFK.Offender); if (!reportedPlayer) { TC_LOG_DEBUG("bg.battleground", "WorldSession::HandleReportPvPAFK: player not found"); |
