diff options
Diffstat (limited to 'src/game/MiscHandler.cpp')
-rw-r--r-- | src/game/MiscHandler.cpp | 150 |
1 files changed, 29 insertions, 121 deletions
diff --git a/src/game/MiscHandler.cpp b/src/game/MiscHandler.cpp index e52afcb80a9..f5ee5dbcf4c 100644 --- a/src/game/MiscHandler.cpp +++ b/src/game/MiscHandler.cpp @@ -45,7 +45,6 @@ #include "Pet.h" #include "SocialMgr.h" #include "CellImpl.h" -#include "Tools.h" void WorldSession::HandleRepopRequestOpcode( WorldPacket & /*recv_data*/ ) { @@ -313,7 +312,7 @@ void WorldSession::HandleLogoutRequestOpcode( WorldPacket & /*recv_data*/ ) data.append(GetPlayer()->GetPackGUID()); data << (uint32)2; SendPacket( &data ); - GetPlayer()->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED); + GetPlayer()->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_ROTATE); } WorldPacket data( SMSG_LOGOUT_RESPONSE, 5 ); @@ -350,7 +349,7 @@ void WorldSession::HandleLogoutCancelOpcode( WorldPacket & /*recv_data*/ ) GetPlayer()->SetStandState(PLAYER_STATE_NONE); //! DISABLE_ROTATE - GetPlayer()->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED); + GetPlayer()->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_ROTATE); } sLog.outDebug( "WORLD: sent SMSG_LOGOUT_CANCEL_ACK Message" ); @@ -364,12 +363,10 @@ void WorldSession::HandleTogglePvP( WorldPacket & recv_data ) bool newPvPStatus; recv_data >> newPvPStatus; GetPlayer()->ApplyModFlag(PLAYER_FLAGS, PLAYER_FLAGS_IN_PVP, newPvPStatus); - GetPlayer()->ApplyModFlag(PLAYER_FLAGS, PLAYER_FLAGS_PVP_TIMER, !newPvPStatus); } else { GetPlayer()->ToggleFlag(PLAYER_FLAGS, PLAYER_FLAGS_IN_PVP); - GetPlayer()->ToggleFlag(PLAYER_FLAGS, PLAYER_FLAGS_PVP_TIMER); } if(GetPlayer()->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_IN_PVP)) @@ -885,7 +882,7 @@ void WorldSession::HandleAreaTriggerOpcode(WorldPacket & recv_data) if(missingItem) SendAreaTriggerMessage(GetTrinityString(LANG_LEVEL_MINREQUIRED_AND_ITEM), at->requiredLevel, objmgr.GetItemPrototype(missingItem)->Name1); else if(missingKey) - GetPlayer()->SendTransferAborted(at->target_mapId, TRANSFER_ABORT_DIFFICULTY, DIFFICULTY_HEROIC); + GetPlayer()->SendTransferAborted(at->target_mapId, TRANSFER_ABORT_DIFFICULTY2); else if(missingQuest) SendAreaTriggerMessage(at->requiredFailedText.c_str()); else if(missingLevel) @@ -897,96 +894,16 @@ void WorldSession::HandleAreaTriggerOpcode(WorldPacket & recv_data) GetPlayer()->TeleportTo(at->target_mapId,at->target_X,at->target_Y,at->target_Z,at->target_Orientation,TELE_TO_NOT_LEAVE_TRANSPORT); } -void WorldSession::HandleUpdateAccountData(WorldPacket &recv_data) +void WorldSession::HandleUpdateAccountData(WorldPacket &/*recv_data*/) { sLog.outDetail("WORLD: Received CMSG_UPDATE_ACCOUNT_DATA"); - - CHECK_PACKET_SIZE(recv_data, 4+4+4); - - uint32 type, timestamp, decompressedSize; - recv_data >> type >> timestamp >> decompressedSize; - - sLog.outDebug("UAD: type %u, time %u, decompressedSize %u", type, timestamp, decompressedSize); - - if(type > NUM_ACCOUNT_DATA_TYPES) - return; - - if(decompressedSize == 0) // erase - { - SetAccountData(type, timestamp, ""); - - WorldPacket data(SMSG_UPDATE_ACCOUNT_DATA_COMPLETE, 4+4); - data << uint32(type); - data << uint32(0); - SendPacket(&data); - - return; - } - - if(decompressedSize > 0xFFFF) - { - sLog.outError("UAD: Account data packet too big, size %u", decompressedSize); - return; - } - - ByteBuffer dest; - dest.resize(decompressedSize); - - uLongf realSize = decompressedSize; - if(uncompress(const_cast<uint8*>(dest.contents()), &realSize, const_cast<uint8*>(recv_data.contents() + recv_data.rpos()), recv_data.size() - recv_data.rpos()) != Z_OK) - { - sLog.outError("UAD: Failed to decompress account data"); - return; - } - - std::string adata; - dest >> adata; - - SetAccountData(type, timestamp, adata); - - WorldPacket data(SMSG_UPDATE_ACCOUNT_DATA_COMPLETE, 4+4); - data << uint32(type); - data << uint32(0); - SendPacket(&data); + //recv_data.hexlike(); } -void WorldSession::HandleRequestAccountData(WorldPacket& recv_data) +void WorldSession::HandleRequestAccountData(WorldPacket& /*recv_data*/) { sLog.outDetail("WORLD: Received CMSG_REQUEST_ACCOUNT_DATA"); - - CHECK_PACKET_SIZE(recv_data, 4); - - uint32 type; - recv_data >> type; - - sLog.outDebug("RAD: type %u", type); - - if(type > NUM_ACCOUNT_DATA_TYPES) - return; - - AccountData *adata = GetAccountData(type); - - uint32 size = adata->Data.size(); - - ByteBuffer dest; - dest.resize(size); - - uLongf destSize = size; - if(compress(const_cast<uint8*>(dest.contents()), &destSize, (uint8*)adata->Data.c_str(), size) != Z_OK) - { - sLog.outDebug("RAD: Failed to compress account data"); - return; - } - - dest.resize(destSize); - - WorldPacket data (SMSG_UPDATE_ACCOUNT_DATA, 8+4+4+4+destSize); - data << uint64(_player->GetGUID()); // player guid - data << uint32(type); // type (0-7) - data << uint32(adata->Time); // unix time - data << uint32(size); // decompressed length - data.append(dest); // compressed data - SendPacket(&data); + //recv_data.hexlike(); } void WorldSession::HandleSetActionButtonOpcode(WorldPacket& recv_data) @@ -1517,11 +1434,11 @@ void WorldSession::HandleChooseTitleOpcode( WorldPacket & recv_data ) GetPlayer()->SetUInt32Value(PLAYER_CHOSEN_TITLE, title); } -void WorldSession::HandleTimeSyncResp( WorldPacket & recv_data ) +void WorldSession::HandleAllowMoveAckOpcode( WorldPacket & recv_data ) { CHECK_PACKET_SIZE(recv_data, 4+4); - sLog.outDebug("CMSG_TIME_SYNC_RESP"); + sLog.outDebug("CMSG_ALLOW_MOVE_ACK"); uint32 counter, time_; recv_data >> counter >> time_; @@ -1591,6 +1508,26 @@ void WorldSession::HandleDungeonDifficultyOpcode( WorldPacket & recv_data ) } } +void WorldSession::HandleNewUnknownOpcode( WorldPacket & recv_data ) +{ + sLog.outDebug("New Unknown Opcode %u", recv_data.GetOpcode()); + recv_data.hexlike(); + /* + New Unknown Opcode 837 + STORAGE_SIZE: 60 + 02 00 00 00 00 00 00 00 | 00 00 00 00 01 20 00 00 + 89 EB 33 01 71 5C 24 C4 | 15 03 35 45 74 47 8B 42 + BA B8 1B 40 00 00 00 00 | 00 00 00 00 77 66 42 BF + 23 91 26 3F 00 00 60 41 | 00 00 00 00 + + New Unknown Opcode 837 + STORAGE_SIZE: 44 + 02 00 00 00 00 00 00 00 | 00 00 00 00 00 00 80 00 + 7B 80 34 01 84 EA 2B C4 | 5F A1 36 45 C9 39 1C 42 + BA B8 1B 40 CE 06 00 00 | 00 00 80 3F + */ +} + void WorldSession::HandleDismountOpcode( WorldPacket & /*recv_data*/ ) { sLog.outDebug("WORLD: CMSG_CANCEL_MOUNT_AURA"); @@ -1657,32 +1594,3 @@ void WorldSession::HandleSetTaxiBenchmarkOpcode( WorldPacket & recv_data ) sLog.outDebug("Client used \"/timetest %d\" command", mode); } - -void WorldSession::HandleSpellClick( WorldPacket & recv_data ) -{ - CHECK_PACKET_SIZE(recv_data, 8); - - uint64 guid; - recv_data >> guid; - - Vehicle *vehicle = ObjectAccessor::GetVehicle(guid); - - if(!vehicle) - return; - - _player->EnterVehicle(vehicle); -} - -void WorldSession::HandleInspectAchievements( WorldPacket & recv_data ) -{ - CHECK_PACKET_SIZE(recv_data, 1); - uint64 guid; - if(!readGUID(recv_data, guid)) - return; - - Player *player = objmgr.GetPlayer(guid); - if(!player) - return; - - player->GetAchievementMgr().SendRespondInspectAchievements(_player); -} |