[8378] Use exceptions instead of explicit size checking for each packet Author: arrai
CHECK_PACKET_SIZE was pretty error prone; once it was forgotten mangosd
could crash due to the asserts in ByteBuffer.h. That was exploitable by
malicious players.
Furthermore, there were duplicate checks: Additionally to
CHECK_PACKET_SIZE, the ByteBuffer assertions keept an eye
on not exceeding the packet boundaries - just to crash the server for
sure in such a case.
To prevent memory leaks or other undesirable states, please read in
every handler all variables _before_ doing any concrete handling.
--HG--
branch : trunk
This commit is contained in:
@@ -33,8 +33,6 @@ void WorldSession::HandleInspectArenaTeamsOpcode(WorldPacket & recv_data)
|
||||
{
|
||||
sLog.outDebug("MSG_INSPECT_ARENA_TEAMS");
|
||||
|
||||
CHECK_PACKET_SIZE(recv_data, 8);
|
||||
|
||||
uint64 guid;
|
||||
recv_data >> guid;
|
||||
sLog.outDebug("Inspect Arena stats (GUID: %u TypeId: %u)", GUID_LOPART(guid),GuidHigh2TypeId(GUID_HIPART(guid)));
|
||||
@@ -56,8 +54,6 @@ void WorldSession::HandleArenaTeamQueryOpcode(WorldPacket & recv_data)
|
||||
{
|
||||
sLog.outDebug( "WORLD: Received CMSG_ARENA_TEAM_QUERY" );
|
||||
|
||||
CHECK_PACKET_SIZE(recv_data, 4);
|
||||
|
||||
uint32 ArenaTeamId;
|
||||
recv_data >> ArenaTeamId;
|
||||
|
||||
@@ -73,8 +69,6 @@ void WorldSession::HandleArenaTeamRosterOpcode(WorldPacket & recv_data)
|
||||
{
|
||||
sLog.outDebug( "WORLD: Received CMSG_ARENA_TEAM_ROSTER" );
|
||||
|
||||
CHECK_PACKET_SIZE(recv_data, 4);
|
||||
|
||||
uint32 ArenaTeamId; // arena team id
|
||||
recv_data >> ArenaTeamId;
|
||||
|
||||
@@ -89,8 +83,6 @@ void WorldSession::HandleArenaTeamInviteOpcode(WorldPacket & recv_data)
|
||||
{
|
||||
sLog.outDebug("CMSG_ARENA_TEAM_INVITE");
|
||||
|
||||
CHECK_PACKET_SIZE(recv_data, 4+1);
|
||||
|
||||
uint32 ArenaTeamId; // arena team id
|
||||
std::string Invitedname;
|
||||
|
||||
@@ -208,8 +200,6 @@ void WorldSession::HandleArenaTeamLeaveOpcode(WorldPacket & recv_data)
|
||||
{
|
||||
sLog.outDebug("CMSG_ARENA_TEAM_LEAVE");
|
||||
|
||||
CHECK_PACKET_SIZE(recv_data, 4);
|
||||
|
||||
uint32 ArenaTeamId; // arena team id
|
||||
recv_data >> ArenaTeamId;
|
||||
|
||||
@@ -245,8 +235,6 @@ void WorldSession::HandleArenaTeamDisbandOpcode(WorldPacket & recv_data)
|
||||
{
|
||||
sLog.outDebug("CMSG_ARENA_TEAM_DISBAND");
|
||||
|
||||
CHECK_PACKET_SIZE(recv_data, 4);
|
||||
|
||||
uint32 ArenaTeamId; // arena team id
|
||||
recv_data >> ArenaTeamId;
|
||||
|
||||
@@ -268,8 +256,6 @@ void WorldSession::HandleArenaTeamRemoveOpcode(WorldPacket & recv_data)
|
||||
{
|
||||
sLog.outDebug("CMSG_ARENA_TEAM_REMOVE");
|
||||
|
||||
CHECK_PACKET_SIZE(recv_data, 4+1);
|
||||
|
||||
uint32 ArenaTeamId;
|
||||
std::string name;
|
||||
|
||||
@@ -314,8 +300,6 @@ void WorldSession::HandleArenaTeamLeaderOpcode(WorldPacket & recv_data)
|
||||
{
|
||||
sLog.outDebug("CMSG_ARENA_TEAM_LEADER");
|
||||
|
||||
CHECK_PACKET_SIZE(recv_data, 4+1);
|
||||
|
||||
uint32 ArenaTeamId;
|
||||
std::string name;
|
||||
|
||||
|
||||
@@ -38,8 +38,6 @@
|
||||
//void called when player click on auctioneer npc
|
||||
void WorldSession::HandleAuctionHelloOpcode( WorldPacket & recv_data )
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data,8);
|
||||
|
||||
uint64 guid; //NPC guid
|
||||
recv_data >> guid;
|
||||
|
||||
@@ -159,8 +157,6 @@ void WorldSession::SendAuctionCancelledToBidderMail( AuctionEntry* auction )
|
||||
//this void creates new auction and adds auction to some auctionhouse
|
||||
void WorldSession::HandleAuctionSellItem( WorldPacket & recv_data )
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data,8+8+4+4+4);
|
||||
|
||||
uint64 auctioneer, item;
|
||||
uint32 etime, bid, buyout;
|
||||
recv_data >> auctioneer >> item;
|
||||
@@ -286,8 +282,6 @@ void WorldSession::HandleAuctionSellItem( WorldPacket & recv_data )
|
||||
//this function is called when client bids or buys out auction
|
||||
void WorldSession::HandleAuctionPlaceBid( WorldPacket & recv_data )
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data,8+4+4);
|
||||
|
||||
uint64 auctioneer;
|
||||
uint32 auctionId;
|
||||
uint32 price;
|
||||
@@ -415,8 +409,6 @@ void WorldSession::HandleAuctionPlaceBid( WorldPacket & recv_data )
|
||||
//this void is called when auction_owner cancels his auction
|
||||
void WorldSession::HandleAuctionRemoveItem( WorldPacket & recv_data )
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data,8+4);
|
||||
|
||||
uint64 auctioneer;
|
||||
uint32 auctionId;
|
||||
recv_data >> auctioneer;
|
||||
@@ -493,8 +485,6 @@ void WorldSession::HandleAuctionRemoveItem( WorldPacket & recv_data )
|
||||
//called when player lists his bids
|
||||
void WorldSession::HandleAuctionListBidderItems( WorldPacket & recv_data )
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data,8+4+4);
|
||||
|
||||
uint64 guid; //NPC guid
|
||||
uint32 listfrom; //page of auctions
|
||||
uint32 outbiddedCount; //count of outbidded auctions
|
||||
@@ -549,8 +539,6 @@ void WorldSession::HandleAuctionListBidderItems( WorldPacket & recv_data )
|
||||
//this void sends player info about his auctions
|
||||
void WorldSession::HandleAuctionListOwnerItems( WorldPacket & recv_data )
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data,8+4);
|
||||
|
||||
uint32 listfrom;
|
||||
uint64 guid;
|
||||
|
||||
@@ -586,8 +574,6 @@ void WorldSession::HandleAuctionListOwnerItems( WorldPacket & recv_data )
|
||||
//this void is called when player clicks on search button
|
||||
void WorldSession::HandleAuctionListItems( WorldPacket & recv_data )
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data,8+4+1+1+1+4+4+4+4+1);
|
||||
|
||||
std::string searchedname;
|
||||
uint8 levelmin, levelmax, usable;
|
||||
uint32 listfrom, auctionSlotID, auctionMainCategory, auctionSubCategory, quality;
|
||||
@@ -597,9 +583,6 @@ void WorldSession::HandleAuctionListItems( WorldPacket & recv_data )
|
||||
recv_data >> listfrom; // start, used for page control listing by 50 elements
|
||||
recv_data >> searchedname;
|
||||
|
||||
// recheck with known string size
|
||||
CHECK_PACKET_SIZE(recv_data,8+4+(searchedname.size()+1)+1+1+4+4+4+4+1);
|
||||
|
||||
recv_data >> levelmin >> levelmax;
|
||||
recv_data >> auctionSlotID >> auctionMainCategory >> auctionSubCategory;
|
||||
recv_data >> quality >> usable;
|
||||
|
||||
@@ -37,8 +37,6 @@
|
||||
|
||||
void WorldSession::HandleBattlemasterHelloOpcode( WorldPacket & recv_data )
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data, 8);
|
||||
|
||||
uint64 guid;
|
||||
recv_data >> guid;
|
||||
sLog.outDebug( "WORLD: Recvd CMSG_BATTLEMASTER_HELLO Message from (GUID: %u TypeId:%u)", GUID_LOPART(guid),GuidHigh2TypeId(GUID_HIPART(guid)));
|
||||
@@ -74,8 +72,6 @@ void WorldSession::SendBattlegGroundList( uint64 guid, BattleGroundTypeId bgType
|
||||
|
||||
void WorldSession::HandleBattlemasterJoinOpcode( WorldPacket & recv_data )
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data, 8+4+4+1);
|
||||
|
||||
uint64 guid;
|
||||
uint32 bgTypeId_;
|
||||
uint32 instanceId;
|
||||
@@ -278,8 +274,6 @@ void WorldSession::HandlePVPLogDataOpcode( WorldPacket & /*recv_data*/ )
|
||||
|
||||
void WorldSession::HandleBattlefieldListOpcode( WorldPacket &recv_data )
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data, 4 + 1);
|
||||
|
||||
sLog.outDebug( "WORLD: Recvd CMSG_BATTLEFIELD_LIST Message");
|
||||
|
||||
uint32 bgTypeId;
|
||||
@@ -302,8 +296,6 @@ void WorldSession::HandleBattlefieldListOpcode( WorldPacket &recv_data )
|
||||
|
||||
void WorldSession::HandleBattleFieldPortOpcode( WorldPacket &recv_data )
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data, 1+1+4+2+1);
|
||||
|
||||
sLog.outDebug( "WORLD: Recvd CMSG_BATTLEFIELD_PORT Message");
|
||||
|
||||
uint8 type; // arenatype if arena
|
||||
@@ -502,8 +494,6 @@ void WorldSession::HandleBattleFieldPortOpcode( WorldPacket &recv_data )
|
||||
|
||||
void WorldSession::HandleLeaveBattlefieldOpcode( WorldPacket & /*recv_data*/ )
|
||||
{
|
||||
//CHECK_PACKET_SIZE(recv_data, 1+1+4+2);
|
||||
|
||||
sLog.outDebug( "WORLD: Recvd CMSG_LEAVE_BATTLEFIELD Message");
|
||||
|
||||
//uint8 unk1, unk2;
|
||||
@@ -586,8 +576,6 @@ void WorldSession::HandleAreaSpiritHealerQueryOpcode( WorldPacket & recv_data )
|
||||
{
|
||||
sLog.outDebug("WORLD: CMSG_AREA_SPIRIT_HEALER_QUERY");
|
||||
|
||||
CHECK_PACKET_SIZE(recv_data, 8);
|
||||
|
||||
BattleGround *bg = _player->GetBattleGround();
|
||||
if (!bg)
|
||||
return;
|
||||
@@ -609,8 +597,6 @@ void WorldSession::HandleAreaSpiritHealerQueueOpcode( WorldPacket & recv_data )
|
||||
{
|
||||
sLog.outDebug("WORLD: CMSG_AREA_SPIRIT_HEALER_QUEUE");
|
||||
|
||||
CHECK_PACKET_SIZE(recv_data, 8);
|
||||
|
||||
BattleGround *bg = _player->GetBattleGround();
|
||||
if (!bg)
|
||||
return;
|
||||
@@ -630,8 +616,6 @@ void WorldSession::HandleAreaSpiritHealerQueueOpcode( WorldPacket & recv_data )
|
||||
|
||||
void WorldSession::HandleBattlemasterJoinArena( WorldPacket & recv_data )
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data, 8+1+1+1);
|
||||
|
||||
sLog.outDebug("WORLD: CMSG_BATTLEMASTER_JOIN_ARENA");
|
||||
recv_data.hexlike();
|
||||
|
||||
@@ -785,8 +769,6 @@ void WorldSession::HandleBattlemasterJoinArena( WorldPacket & recv_data )
|
||||
|
||||
void WorldSession::HandleReportPvPAFK( WorldPacket & recv_data )
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data, 8);
|
||||
|
||||
uint64 playerGuid;
|
||||
recv_data >> playerGuid;
|
||||
Player *reportedPlayer = objmgr.GetPlayer(playerGuid);
|
||||
|
||||
@@ -27,8 +27,6 @@
|
||||
void WorldSession::HandleJoinChannel(WorldPacket& recvPacket)
|
||||
{
|
||||
sLog.outDebug("Opcode %u", recvPacket.GetOpcode());
|
||||
//recvPacket.hexlike();
|
||||
CHECK_PACKET_SIZE(recvPacket, 4+1+1+1);
|
||||
|
||||
uint32 channel_id;
|
||||
uint8 unknown1, unknown2;
|
||||
@@ -40,9 +38,6 @@ void WorldSession::HandleJoinChannel(WorldPacket& recvPacket)
|
||||
if(channelname.empty())
|
||||
return;
|
||||
|
||||
// recheck
|
||||
CHECK_PACKET_SIZE(recvPacket, 4+1+1+(channelname.size()+1)+1);
|
||||
|
||||
recvPacket >> pass;
|
||||
if(ChannelMgr* cMgr = channelMgr(_player->GetTeam()))
|
||||
{
|
||||
@@ -56,7 +51,6 @@ void WorldSession::HandleLeaveChannel(WorldPacket& recvPacket)
|
||||
{
|
||||
sLog.outDebug("Opcode %u", recvPacket.GetOpcode());
|
||||
//recvPacket.hexlike();
|
||||
CHECK_PACKET_SIZE(recvPacket, 4+1);
|
||||
|
||||
uint32 unk;
|
||||
std::string channelname;
|
||||
@@ -78,8 +72,6 @@ void WorldSession::HandleChannelList(WorldPacket& recvPacket)
|
||||
{
|
||||
sLog.outDebug("Opcode %u", recvPacket.GetOpcode());
|
||||
//recvPacket.hexlike();
|
||||
CHECK_PACKET_SIZE(recvPacket, 1);
|
||||
|
||||
std::string channelname;
|
||||
recvPacket >> channelname;
|
||||
|
||||
@@ -92,14 +84,9 @@ void WorldSession::HandleChannelPassword(WorldPacket& recvPacket)
|
||||
{
|
||||
sLog.outDebug("Opcode %u", recvPacket.GetOpcode());
|
||||
//recvPacket.hexlike();
|
||||
CHECK_PACKET_SIZE(recvPacket, 1+1);
|
||||
|
||||
std::string channelname, pass;
|
||||
recvPacket >> channelname;
|
||||
|
||||
// recheck
|
||||
CHECK_PACKET_SIZE(recvPacket, (channelname.size()+1)+1);
|
||||
|
||||
recvPacket >> pass;
|
||||
|
||||
if(ChannelMgr* cMgr = channelMgr(_player->GetTeam()))
|
||||
@@ -111,14 +98,9 @@ void WorldSession::HandleChannelSetOwner(WorldPacket& recvPacket)
|
||||
{
|
||||
sLog.outDebug("Opcode %u", recvPacket.GetOpcode());
|
||||
//recvPacket.hexlike();
|
||||
CHECK_PACKET_SIZE(recvPacket, 1+1);
|
||||
|
||||
std::string channelname, newp;
|
||||
recvPacket >> channelname;
|
||||
|
||||
// recheck
|
||||
CHECK_PACKET_SIZE(recvPacket, (channelname.size()+1)+1);
|
||||
|
||||
recvPacket >> newp;
|
||||
|
||||
if(!normalizePlayerName(newp))
|
||||
@@ -133,8 +115,6 @@ void WorldSession::HandleChannelOwner(WorldPacket& recvPacket)
|
||||
{
|
||||
sLog.outDebug("Opcode %u", recvPacket.GetOpcode());
|
||||
//recvPacket.hexlike();
|
||||
CHECK_PACKET_SIZE(recvPacket, 1);
|
||||
|
||||
std::string channelname;
|
||||
recvPacket >> channelname;
|
||||
if(ChannelMgr* cMgr = channelMgr(_player->GetTeam()))
|
||||
@@ -146,14 +126,9 @@ void WorldSession::HandleChannelModerator(WorldPacket& recvPacket)
|
||||
{
|
||||
sLog.outDebug("Opcode %u", recvPacket.GetOpcode());
|
||||
//recvPacket.hexlike();
|
||||
CHECK_PACKET_SIZE(recvPacket, 1+1);
|
||||
|
||||
std::string channelname, otp;
|
||||
recvPacket >> channelname;
|
||||
|
||||
// recheck
|
||||
CHECK_PACKET_SIZE(recvPacket, (channelname.size()+1)+1);
|
||||
|
||||
recvPacket >> otp;
|
||||
|
||||
if(!normalizePlayerName(otp))
|
||||
@@ -168,14 +143,9 @@ void WorldSession::HandleChannelUnmoderator(WorldPacket& recvPacket)
|
||||
{
|
||||
sLog.outDebug("Opcode %u", recvPacket.GetOpcode());
|
||||
//recvPacket.hexlike();
|
||||
CHECK_PACKET_SIZE(recvPacket, 1+1);
|
||||
|
||||
std::string channelname, otp;
|
||||
recvPacket >> channelname;
|
||||
|
||||
// recheck
|
||||
CHECK_PACKET_SIZE(recvPacket, (channelname.size()+1)+1);
|
||||
|
||||
recvPacket >> otp;
|
||||
|
||||
if(!normalizePlayerName(otp))
|
||||
@@ -190,14 +160,9 @@ void WorldSession::HandleChannelMute(WorldPacket& recvPacket)
|
||||
{
|
||||
sLog.outDebug("Opcode %u", recvPacket.GetOpcode());
|
||||
//recvPacket.hexlike();
|
||||
CHECK_PACKET_SIZE(recvPacket, 1+1);
|
||||
|
||||
std::string channelname, otp;
|
||||
recvPacket >> channelname;
|
||||
|
||||
// recheck
|
||||
CHECK_PACKET_SIZE(recvPacket, (channelname.size()+1)+1);
|
||||
|
||||
recvPacket >> otp;
|
||||
|
||||
if(!normalizePlayerName(otp))
|
||||
@@ -212,14 +177,10 @@ void WorldSession::HandleChannelUnmute(WorldPacket& recvPacket)
|
||||
{
|
||||
sLog.outDebug("Opcode %u", recvPacket.GetOpcode());
|
||||
//recvPacket.hexlike();
|
||||
CHECK_PACKET_SIZE(recvPacket, 1+1);
|
||||
|
||||
std::string channelname, otp;
|
||||
recvPacket >> channelname;
|
||||
|
||||
// recheck
|
||||
CHECK_PACKET_SIZE(recvPacket, (channelname.size()+1)+1);
|
||||
|
||||
recvPacket >> otp;
|
||||
|
||||
if(!normalizePlayerName(otp))
|
||||
@@ -234,14 +195,9 @@ void WorldSession::HandleChannelInvite(WorldPacket& recvPacket)
|
||||
{
|
||||
sLog.outDebug("Opcode %u", recvPacket.GetOpcode());
|
||||
//recvPacket.hexlike();
|
||||
CHECK_PACKET_SIZE(recvPacket, 1+1);
|
||||
|
||||
std::string channelname, otp;
|
||||
recvPacket >> channelname;
|
||||
|
||||
// recheck
|
||||
CHECK_PACKET_SIZE(recvPacket, (channelname.size()+1)+1);
|
||||
|
||||
recvPacket >> otp;
|
||||
|
||||
if(!normalizePlayerName(otp))
|
||||
@@ -256,14 +212,9 @@ void WorldSession::HandleChannelKick(WorldPacket& recvPacket)
|
||||
{
|
||||
sLog.outDebug("Opcode %u", recvPacket.GetOpcode());
|
||||
//recvPacket.hexlike();
|
||||
CHECK_PACKET_SIZE(recvPacket, 1+1);
|
||||
|
||||
std::string channelname, otp;
|
||||
recvPacket >> channelname;
|
||||
|
||||
// recheck
|
||||
CHECK_PACKET_SIZE(recvPacket, (channelname.size()+1)+1);
|
||||
|
||||
recvPacket >> otp;
|
||||
if(!normalizePlayerName(otp))
|
||||
return;
|
||||
@@ -277,14 +228,9 @@ void WorldSession::HandleChannelBan(WorldPacket& recvPacket)
|
||||
{
|
||||
sLog.outDebug("Opcode %u", recvPacket.GetOpcode());
|
||||
//recvPacket.hexlike();
|
||||
CHECK_PACKET_SIZE(recvPacket, 1+1);
|
||||
|
||||
std::string channelname, otp;
|
||||
recvPacket >> channelname;
|
||||
|
||||
// recheck
|
||||
CHECK_PACKET_SIZE(recvPacket, (channelname.size()+1)+1);
|
||||
|
||||
recvPacket >> otp;
|
||||
|
||||
if(!normalizePlayerName(otp))
|
||||
@@ -299,14 +245,10 @@ void WorldSession::HandleChannelUnban(WorldPacket& recvPacket)
|
||||
{
|
||||
sLog.outDebug("Opcode %u", recvPacket.GetOpcode());
|
||||
//recvPacket.hexlike();
|
||||
CHECK_PACKET_SIZE(recvPacket, 1+1);
|
||||
|
||||
std::string channelname, otp;
|
||||
recvPacket >> channelname;
|
||||
|
||||
// recheck
|
||||
CHECK_PACKET_SIZE(recvPacket, (channelname.size()+1)+1);
|
||||
|
||||
recvPacket >> otp;
|
||||
|
||||
if(!normalizePlayerName(otp))
|
||||
@@ -321,8 +263,6 @@ void WorldSession::HandleChannelAnnouncements(WorldPacket& recvPacket)
|
||||
{
|
||||
sLog.outDebug("Opcode %u", recvPacket.GetOpcode());
|
||||
//recvPacket.hexlike();
|
||||
CHECK_PACKET_SIZE(recvPacket, 1);
|
||||
|
||||
std::string channelname;
|
||||
recvPacket >> channelname;
|
||||
if(ChannelMgr* cMgr = channelMgr(_player->GetTeam()))
|
||||
@@ -334,8 +274,6 @@ void WorldSession::HandleChannelModerate(WorldPacket& recvPacket)
|
||||
{
|
||||
sLog.outDebug("Opcode %u", recvPacket.GetOpcode());
|
||||
//recvPacket.hexlike();
|
||||
CHECK_PACKET_SIZE(recvPacket, 1);
|
||||
|
||||
std::string channelname;
|
||||
recvPacket >> channelname;
|
||||
if(ChannelMgr* cMgr = channelMgr(_player->GetTeam()))
|
||||
@@ -347,8 +285,6 @@ void WorldSession::HandleChannelDisplayListQuery(WorldPacket &recvPacket)
|
||||
{
|
||||
sLog.outDebug("Opcode %u", recvPacket.GetOpcode());
|
||||
//recvPacket.hexlike();
|
||||
CHECK_PACKET_SIZE(recvPacket, 1);
|
||||
|
||||
std::string channelname;
|
||||
recvPacket >> channelname;
|
||||
if(ChannelMgr* cMgr = channelMgr(_player->GetTeam()))
|
||||
@@ -360,8 +296,6 @@ void WorldSession::HandleGetChannelMemberCount(WorldPacket &recvPacket)
|
||||
{
|
||||
sLog.outDebug("Opcode %u", recvPacket.GetOpcode());
|
||||
//recvPacket.hexlike();
|
||||
CHECK_PACKET_SIZE(recvPacket, 1);
|
||||
|
||||
std::string channelname;
|
||||
recvPacket >> channelname;
|
||||
if(ChannelMgr* cMgr = channelMgr(_player->GetTeam()))
|
||||
@@ -381,8 +315,6 @@ void WorldSession::HandleSetChannelWatch(WorldPacket &recvPacket)
|
||||
{
|
||||
sLog.outDebug("Opcode %u", recvPacket.GetOpcode());
|
||||
//recvPacket.hexlike();
|
||||
CHECK_PACKET_SIZE(recvPacket, 1);
|
||||
|
||||
std::string channelname;
|
||||
recvPacket >> channelname;
|
||||
/*if(ChannelMgr* cMgr = channelMgr(_player->GetTeam()))
|
||||
|
||||
@@ -185,16 +185,11 @@ void WorldSession::HandleCharEnumOpcode( WorldPacket & /*recv_data*/ )
|
||||
|
||||
void WorldSession::HandleCharCreateOpcode( WorldPacket & recv_data )
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data,1+1+1+1+1+1+1+1+1+1);
|
||||
|
||||
std::string name;
|
||||
uint8 race_,class_;
|
||||
|
||||
recv_data >> name;
|
||||
|
||||
// recheck with known string size
|
||||
CHECK_PACKET_SIZE(recv_data,(name.size()+1)+1+1+1+1+1+1+1+1+1);
|
||||
|
||||
recv_data >> race_;
|
||||
recv_data >> class_;
|
||||
|
||||
@@ -479,8 +474,6 @@ void WorldSession::HandleCharCreateOpcode( WorldPacket & recv_data )
|
||||
|
||||
void WorldSession::HandleCharDeleteOpcode( WorldPacket & recv_data )
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data,8);
|
||||
|
||||
uint64 guid;
|
||||
recv_data >> guid;
|
||||
|
||||
@@ -541,8 +534,6 @@ void WorldSession::HandleCharDeleteOpcode( WorldPacket & recv_data )
|
||||
|
||||
void WorldSession::HandlePlayerLoginOpcode( WorldPacket & recv_data )
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data,8);
|
||||
|
||||
if(PlayerLoading() || GetPlayer() != NULL)
|
||||
{
|
||||
sLog.outError("Player tryes to login again, AccountId = %d",GetAccountId());
|
||||
@@ -819,8 +810,6 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder * holder)
|
||||
|
||||
void WorldSession::HandleSetFactionAtWar( WorldPacket & recv_data )
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data,4+1);
|
||||
|
||||
DEBUG_LOG( "WORLD: Received CMSG_SET_FACTION_ATWAR" );
|
||||
|
||||
uint32 repListID;
|
||||
@@ -835,8 +824,6 @@ void WorldSession::HandleSetFactionAtWar( WorldPacket & recv_data )
|
||||
//I think this function is never used :/ I dunno, but i guess this opcode not exists
|
||||
void WorldSession::HandleSetFactionCheat( WorldPacket & /*recv_data*/ )
|
||||
{
|
||||
//CHECK_PACKET_SIZE(recv_data,4+4);
|
||||
|
||||
sLog.outError("WORLD SESSION: HandleSetFactionCheat, not expected call, please report.");
|
||||
/*
|
||||
uint32 FactionID;
|
||||
@@ -869,8 +856,6 @@ void WorldSession::HandleMeetingStoneInfo( WorldPacket & /*recv_data*/ )
|
||||
|
||||
void WorldSession::HandleTutorialFlag( WorldPacket & recv_data )
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data,4);
|
||||
|
||||
uint32 iFlag;
|
||||
recv_data >> iFlag;
|
||||
|
||||
@@ -903,8 +888,6 @@ void WorldSession::HandleTutorialReset( WorldPacket & /*recv_data*/ )
|
||||
|
||||
void WorldSession::HandleSetWatchedFactionOpcode(WorldPacket & recv_data)
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data,4);
|
||||
|
||||
DEBUG_LOG("WORLD: Received CMSG_SET_WATCHED_FACTION");
|
||||
uint32 fact;
|
||||
recv_data >> fact;
|
||||
@@ -913,8 +896,6 @@ void WorldSession::HandleSetWatchedFactionOpcode(WorldPacket & recv_data)
|
||||
|
||||
void WorldSession::HandleSetFactionInactiveOpcode(WorldPacket & recv_data)
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data,4+1);
|
||||
|
||||
DEBUG_LOG("WORLD: Received CMSG_SET_FACTION_INACTIVE");
|
||||
uint32 replistid;
|
||||
uint8 inactive;
|
||||
@@ -937,8 +918,6 @@ void WorldSession::HandleShowingCloakOpcode( WorldPacket & /*recv_data*/ )
|
||||
|
||||
void WorldSession::HandleCharRenameOpcode(WorldPacket& recv_data)
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data, 8+1);
|
||||
|
||||
uint64 guid;
|
||||
std::string newname;
|
||||
|
||||
@@ -1023,7 +1002,6 @@ void WorldSession::HandleSetPlayerDeclinedNames(WorldPacket& recv_data)
|
||||
{
|
||||
uint64 guid;
|
||||
|
||||
CHECK_PACKET_SIZE(recv_data, 8);
|
||||
recv_data >> guid;
|
||||
|
||||
// not accept declined names for unsupported languages
|
||||
@@ -1059,7 +1037,6 @@ void WorldSession::HandleSetPlayerDeclinedNames(WorldPacket& recv_data)
|
||||
std::string name2;
|
||||
DeclinedName declinedname;
|
||||
|
||||
CHECK_PACKET_SIZE(recv_data, recv_data.rpos() + 1);
|
||||
recv_data >> name2;
|
||||
|
||||
if(name2 != name) // character have different name
|
||||
@@ -1073,7 +1050,6 @@ void WorldSession::HandleSetPlayerDeclinedNames(WorldPacket& recv_data)
|
||||
|
||||
for(int i = 0; i < MAX_DECLINED_NAME_CASES; ++i)
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data, recv_data.rpos() + 1);
|
||||
recv_data >> declinedname.name[i];
|
||||
if(!normalizePlayerName(declinedname.name[i]))
|
||||
{
|
||||
@@ -1113,8 +1089,6 @@ void WorldSession::HandleAlterAppearance( WorldPacket & recv_data )
|
||||
{
|
||||
sLog.outDebug("CMSG_ALTER_APPEARANCE");
|
||||
|
||||
CHECK_PACKET_SIZE(recv_data, 4+4+4);
|
||||
|
||||
uint32 Hair, Color, FacialHair;
|
||||
recv_data >> Hair >> Color >> FacialHair;
|
||||
|
||||
@@ -1161,8 +1135,6 @@ void WorldSession::HandleAlterAppearance( WorldPacket & recv_data )
|
||||
|
||||
void WorldSession::HandleRemoveGlyph( WorldPacket & recv_data )
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data, 4);
|
||||
|
||||
uint32 slot;
|
||||
recv_data >> slot;
|
||||
|
||||
@@ -1185,16 +1157,12 @@ void WorldSession::HandleRemoveGlyph( WorldPacket & recv_data )
|
||||
|
||||
void WorldSession::HandleCharCustomize(WorldPacket& recv_data)
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data, 8+1);
|
||||
|
||||
uint64 guid;
|
||||
std::string newname;
|
||||
|
||||
recv_data >> guid;
|
||||
recv_data >> newname;
|
||||
|
||||
CHECK_PACKET_SIZE(recv_data, recv_data.rpos()+1+1+1+1+1+1);
|
||||
|
||||
uint8 gender, skin, face, hairStyle, hairColor, facialHair;
|
||||
recv_data >> gender >> skin >> hairColor >> hairStyle >> facialHair >> face;
|
||||
|
||||
@@ -1290,18 +1258,14 @@ void WorldSession::HandleEquipmentSetSave(WorldPacket &recv_data)
|
||||
if(!recv_data.readPackGUID(setGuid))
|
||||
return;
|
||||
|
||||
CHECK_PACKET_SIZE(recv_data, recv_data.rpos() + 4);
|
||||
|
||||
uint32 index;
|
||||
recv_data >> index;
|
||||
if(index >= MAX_EQUIPMENT_SET_INDEX) // client set slots amount
|
||||
return;
|
||||
|
||||
CHECK_PACKET_SIZE(recv_data, recv_data.rpos() + 1);
|
||||
std::string name;
|
||||
recv_data >> name;
|
||||
|
||||
CHECK_PACKET_SIZE(recv_data, recv_data.rpos() + 1);
|
||||
std::string iconName;
|
||||
recv_data >> iconName;
|
||||
|
||||
@@ -1354,8 +1318,6 @@ void WorldSession::HandleEquipmentSetUse(WorldPacket &recv_data)
|
||||
if(!recv_data.readPackGUID(itemGuid))
|
||||
return;
|
||||
|
||||
CHECK_PACKET_SIZE(recv_data, recv_data.rpos()+1+1);
|
||||
|
||||
uint8 srcbag, srcslot;
|
||||
recv_data >> srcbag >> srcslot;
|
||||
|
||||
|
||||
@@ -42,8 +42,6 @@
|
||||
|
||||
void WorldSession::HandleMessagechatOpcode( WorldPacket & recv_data )
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data,4+4+1);
|
||||
|
||||
uint32 type;
|
||||
uint32 lang;
|
||||
|
||||
@@ -198,7 +196,6 @@ void WorldSession::HandleMessagechatOpcode( WorldPacket & recv_data )
|
||||
{
|
||||
std::string to, msg;
|
||||
recv_data >> to;
|
||||
CHECK_PACKET_SIZE(recv_data,4+4+(to.size()+1)+1);
|
||||
recv_data >> msg;
|
||||
|
||||
// strip invisible characters for non-addon messages
|
||||
@@ -496,9 +493,6 @@ void WorldSession::HandleMessagechatOpcode( WorldPacket & recv_data )
|
||||
std::string channel = "", msg = "";
|
||||
recv_data >> channel;
|
||||
|
||||
// recheck
|
||||
CHECK_PACKET_SIZE(recv_data,4+4+(channel.size()+1)+1);
|
||||
|
||||
recv_data >> msg;
|
||||
|
||||
// strip invisible characters for non-addon messages
|
||||
@@ -577,7 +571,6 @@ void WorldSession::HandleEmoteOpcode( WorldPacket & recv_data )
|
||||
{
|
||||
if(!GetPlayer()->isAlive())
|
||||
return;
|
||||
CHECK_PACKET_SIZE(recv_data,4);
|
||||
|
||||
uint32 emote;
|
||||
recv_data >> emote;
|
||||
@@ -628,8 +621,6 @@ void WorldSession::HandleTextEmoteOpcode( WorldPacket & recv_data )
|
||||
return;
|
||||
}
|
||||
|
||||
CHECK_PACKET_SIZE(recv_data,4+4+8);
|
||||
|
||||
uint32 text_emote, emoteNum;
|
||||
uint64 guid;
|
||||
|
||||
@@ -679,8 +670,6 @@ void WorldSession::HandleTextEmoteOpcode( WorldPacket & recv_data )
|
||||
|
||||
void WorldSession::HandleChatIgnoredOpcode(WorldPacket& recv_data )
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data, 8+1);
|
||||
|
||||
uint64 iguid;
|
||||
uint8 unk;
|
||||
//sLog.outDebug("WORLD: Received CMSG_CHAT_IGNORED");
|
||||
|
||||
@@ -28,8 +28,6 @@
|
||||
|
||||
void WorldSession::HandleAttackSwingOpcode( WorldPacket & recv_data )
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data,8);
|
||||
|
||||
uint64 guid;
|
||||
recv_data >> guid;
|
||||
|
||||
@@ -68,8 +66,6 @@ void WorldSession::HandleAttackStopOpcode( WorldPacket & /*recv_data*/ )
|
||||
|
||||
void WorldSession::HandleSetSheathedOpcode( WorldPacket & recv_data )
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data,4);
|
||||
|
||||
uint32 sheathed;
|
||||
recv_data >> sheathed;
|
||||
|
||||
|
||||
@@ -28,8 +28,6 @@
|
||||
|
||||
void WorldSession::HandleDuelAcceptedOpcode(WorldPacket& recvPacket)
|
||||
{
|
||||
CHECK_PACKET_SIZE(recvPacket,8);
|
||||
|
||||
uint64 guid;
|
||||
Player *pl;
|
||||
Player *plTarget;
|
||||
@@ -61,8 +59,6 @@ void WorldSession::HandleDuelAcceptedOpcode(WorldPacket& recvPacket)
|
||||
|
||||
void WorldSession::HandleDuelCancelledOpcode(WorldPacket& recvPacket)
|
||||
{
|
||||
CHECK_PACKET_SIZE(recvPacket,8);
|
||||
|
||||
//sLog.outDebug( "WORLD: received CMSG_DUEL_CANCELLED" );
|
||||
|
||||
// no duel requested
|
||||
|
||||
@@ -238,8 +238,6 @@ void WorldSession::HandleGroupDeclineOpcode( WorldPacket & /*recv_data*/ )
|
||||
|
||||
void WorldSession::HandleGroupUninviteGuidOpcode(WorldPacket & recv_data)
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data,8);
|
||||
|
||||
uint64 guid;
|
||||
recv_data >> guid;
|
||||
|
||||
@@ -278,8 +276,6 @@ void WorldSession::HandleGroupUninviteGuidOpcode(WorldPacket & recv_data)
|
||||
|
||||
void WorldSession::HandleGroupUninviteOpcode(WorldPacket & recv_data)
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data,1);
|
||||
|
||||
std::string membername;
|
||||
recv_data >> membername;
|
||||
|
||||
@@ -322,8 +318,6 @@ void WorldSession::HandleGroupUninviteOpcode(WorldPacket & recv_data)
|
||||
|
||||
void WorldSession::HandleGroupSetLeaderOpcode( WorldPacket & recv_data )
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data,8);
|
||||
|
||||
Group *group = GetPlayer()->GetGroup();
|
||||
if(!group)
|
||||
return;
|
||||
@@ -364,8 +358,6 @@ void WorldSession::HandleGroupDisbandOpcode( WorldPacket & /*recv_data*/ )
|
||||
|
||||
void WorldSession::HandleLootMethodOpcode( WorldPacket & recv_data )
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data,4+8+4);
|
||||
|
||||
Group *group = GetPlayer()->GetGroup();
|
||||
if(!group)
|
||||
return;
|
||||
@@ -389,8 +381,6 @@ void WorldSession::HandleLootMethodOpcode( WorldPacket & recv_data )
|
||||
|
||||
void WorldSession::HandleLootRoll( WorldPacket &recv_data )
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data,8+4+1);
|
||||
|
||||
if(!GetPlayer()->GetGroup())
|
||||
return;
|
||||
|
||||
@@ -423,8 +413,6 @@ void WorldSession::HandleLootRoll( WorldPacket &recv_data )
|
||||
|
||||
void WorldSession::HandleMinimapPingOpcode(WorldPacket& recv_data)
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data,4+4);
|
||||
|
||||
if(!GetPlayer()->GetGroup())
|
||||
return;
|
||||
|
||||
@@ -447,8 +435,6 @@ void WorldSession::HandleMinimapPingOpcode(WorldPacket& recv_data)
|
||||
|
||||
void WorldSession::HandleRandomRollOpcode(WorldPacket& recv_data)
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data,4+4);
|
||||
|
||||
uint32 minimum, maximum, roll;
|
||||
recv_data >> minimum;
|
||||
recv_data >> maximum;
|
||||
@@ -476,8 +462,6 @@ void WorldSession::HandleRandomRollOpcode(WorldPacket& recv_data)
|
||||
|
||||
void WorldSession::HandleRaidTargetUpdateOpcode( WorldPacket & recv_data )
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data,1);
|
||||
|
||||
Group *group = GetPlayer()->GetGroup();
|
||||
if(!group)
|
||||
return;
|
||||
@@ -495,9 +479,6 @@ void WorldSession::HandleRaidTargetUpdateOpcode( WorldPacket & recv_data )
|
||||
}
|
||||
else // target icon update
|
||||
{
|
||||
// recheck
|
||||
CHECK_PACKET_SIZE(recv_data,1+8);
|
||||
|
||||
if(!group->IsLeader(GetPlayer()->GetGUID()) && !group->IsAssistant(GetPlayer()->GetGUID()))
|
||||
return;
|
||||
|
||||
@@ -528,8 +509,6 @@ void WorldSession::HandleGroupRaidConvertOpcode( WorldPacket & /*recv_data*/ )
|
||||
|
||||
void WorldSession::HandleGroupChangeSubGroupOpcode( WorldPacket & recv_data )
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data,1+1);
|
||||
|
||||
// we will get correct pointer for group here, so we don't have to check if group is BG raid
|
||||
Group *group = GetPlayer()->GetGroup();
|
||||
if(!group)
|
||||
@@ -539,9 +518,6 @@ void WorldSession::HandleGroupChangeSubGroupOpcode( WorldPacket & recv_data )
|
||||
uint8 groupNr;
|
||||
recv_data >> name;
|
||||
|
||||
// recheck
|
||||
CHECK_PACKET_SIZE(recv_data,(name.size()+1)+1);
|
||||
|
||||
recv_data >> groupNr;
|
||||
|
||||
/** error handling **/
|
||||
@@ -570,8 +546,6 @@ void WorldSession::HandleGroupChangeSubGroupOpcode( WorldPacket & recv_data )
|
||||
|
||||
void WorldSession::HandleGroupAssistantLeaderOpcode( WorldPacket & recv_data )
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data,8+1);
|
||||
|
||||
Group *group = GetPlayer()->GetGroup();
|
||||
if(!group)
|
||||
return;
|
||||
@@ -592,7 +566,6 @@ void WorldSession::HandleGroupAssistantLeaderOpcode( WorldPacket & recv_data )
|
||||
|
||||
void WorldSession::HandlePartyAssignmentOpcode( WorldPacket & recv_data )
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data, 1+1+8);
|
||||
sLog.outDebug("MSG_PARTY_ASSIGNMENT");
|
||||
|
||||
Group *group = GetPlayer()->GetGroup();
|
||||
@@ -829,8 +802,6 @@ void WorldSession::BuildPartyMemberStatsChangedPacket(Player *player, WorldPacke
|
||||
/*this procedure handles clients CMSG_REQUEST_PARTY_MEMBER_STATS request*/
|
||||
void WorldSession::HandleRequestPartyMemberStatsOpcode( WorldPacket &recv_data )
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data, 8);
|
||||
|
||||
sLog.outDebug("WORLD: Received CMSG_REQUEST_PARTY_MEMBER_STATS");
|
||||
uint64 Guid;
|
||||
recv_data >> Guid;
|
||||
@@ -932,8 +903,6 @@ void WorldSession::HandleRequestPartyMemberStatsOpcode( WorldPacket &recv_data )
|
||||
|
||||
void WorldSession::HandleOptOutOfLootOpcode( WorldPacket & recv_data )
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data, 4);
|
||||
|
||||
sLog.outDebug("WORLD: Received CMSG_OPT_OUT_OF_LOOT");
|
||||
|
||||
uint32 unkn;
|
||||
|
||||
@@ -31,8 +31,6 @@
|
||||
|
||||
void WorldSession::HandleGuildQueryOpcode(WorldPacket& recvPacket)
|
||||
{
|
||||
CHECK_PACKET_SIZE(recvPacket, 4);
|
||||
|
||||
uint32 guildId;
|
||||
Guild *guild;
|
||||
|
||||
@@ -52,8 +50,6 @@ void WorldSession::HandleGuildQueryOpcode(WorldPacket& recvPacket)
|
||||
|
||||
void WorldSession::HandleGuildCreateOpcode(WorldPacket& recvPacket)
|
||||
{
|
||||
CHECK_PACKET_SIZE(recvPacket, 1);
|
||||
|
||||
std::string gname;
|
||||
|
||||
//sLog.outDebug("WORLD: Received CMSG_GUILD_CREATE");
|
||||
@@ -75,8 +71,6 @@ void WorldSession::HandleGuildCreateOpcode(WorldPacket& recvPacket)
|
||||
|
||||
void WorldSession::HandleGuildInviteOpcode(WorldPacket& recvPacket)
|
||||
{
|
||||
CHECK_PACKET_SIZE(recvPacket, 1);
|
||||
|
||||
std::string Invitedname, plname;
|
||||
|
||||
//sLog.outDebug("WORLD: Received CMSG_GUILD_INVITE");
|
||||
@@ -148,8 +142,6 @@ void WorldSession::HandleGuildInviteOpcode(WorldPacket& recvPacket)
|
||||
|
||||
void WorldSession::HandleGuildRemoveOpcode(WorldPacket& recvPacket)
|
||||
{
|
||||
CHECK_PACKET_SIZE(recvPacket, 1);
|
||||
|
||||
std::string plName;
|
||||
|
||||
//sLog.outDebug("WORLD: Received CMSG_GUILD_REMOVE");
|
||||
@@ -271,8 +263,6 @@ void WorldSession::HandleGuildRosterOpcode(WorldPacket& /*recvPacket*/)
|
||||
|
||||
void WorldSession::HandleGuildPromoteOpcode(WorldPacket& recvPacket)
|
||||
{
|
||||
CHECK_PACKET_SIZE(recvPacket, 1);
|
||||
|
||||
std::string plName;
|
||||
|
||||
//sLog.outDebug("WORLD: Received CMSG_GUILD_PROMOTE");
|
||||
@@ -329,8 +319,6 @@ void WorldSession::HandleGuildPromoteOpcode(WorldPacket& recvPacket)
|
||||
|
||||
void WorldSession::HandleGuildDemoteOpcode(WorldPacket& recvPacket)
|
||||
{
|
||||
CHECK_PACKET_SIZE(recvPacket, 1);
|
||||
|
||||
std::string plName;
|
||||
|
||||
//sLog.outDebug("WORLD: Received CMSG_GUILD_DEMOTE");
|
||||
@@ -453,8 +441,6 @@ void WorldSession::HandleGuildDisbandOpcode(WorldPacket& /*recvPacket*/)
|
||||
|
||||
void WorldSession::HandleGuildLeaderOpcode(WorldPacket& recvPacket)
|
||||
{
|
||||
CHECK_PACKET_SIZE(recvPacket, 1);
|
||||
|
||||
std::string name;
|
||||
Player *oldLeader = GetPlayer();
|
||||
Guild *guild;
|
||||
@@ -539,8 +525,6 @@ void WorldSession::HandleGuildMOTDOpcode(WorldPacket& recvPacket)
|
||||
|
||||
void WorldSession::HandleGuildSetPublicNoteOpcode(WorldPacket& recvPacket)
|
||||
{
|
||||
CHECK_PACKET_SIZE(recvPacket, 1);
|
||||
|
||||
std::string name,PNOTE;
|
||||
|
||||
//sLog.outDebug("WORLD: Received CMSG_GUILD_SET_PUBLIC_NOTE");
|
||||
@@ -580,8 +564,6 @@ void WorldSession::HandleGuildSetPublicNoteOpcode(WorldPacket& recvPacket)
|
||||
|
||||
void WorldSession::HandleGuildSetOfficerNoteOpcode(WorldPacket& recvPacket)
|
||||
{
|
||||
CHECK_PACKET_SIZE(recvPacket, 1);
|
||||
|
||||
std::string plName, OFFNOTE;
|
||||
|
||||
//sLog.outDebug("WORLD: Received CMSG_GUILD_SET_OFFICER_NOTE");
|
||||
@@ -620,7 +602,6 @@ void WorldSession::HandleGuildSetOfficerNoteOpcode(WorldPacket& recvPacket)
|
||||
|
||||
void WorldSession::HandleGuildRankOpcode(WorldPacket& recvPacket)
|
||||
{
|
||||
CHECK_PACKET_SIZE(recvPacket, 4+4+1+4*13);
|
||||
//recvPacket.hexlike();
|
||||
|
||||
Guild *guild;
|
||||
@@ -672,8 +653,6 @@ void WorldSession::HandleGuildRankOpcode(WorldPacket& recvPacket)
|
||||
|
||||
void WorldSession::HandleGuildAddRankOpcode(WorldPacket& recvPacket)
|
||||
{
|
||||
CHECK_PACKET_SIZE(recvPacket, 1);
|
||||
|
||||
Guild *guild;
|
||||
std::string rankname;
|
||||
|
||||
@@ -742,8 +721,6 @@ void WorldSession::SendGuildCommandResult(uint32 typecmd, const std::string& str
|
||||
|
||||
void WorldSession::HandleGuildChangeInfoTextOpcode(WorldPacket& recvPacket)
|
||||
{
|
||||
CHECK_PACKET_SIZE(recvPacket, 1);
|
||||
|
||||
//sLog.outDebug("WORLD: Received CMSG_GUILD_INFO_TEXT");
|
||||
|
||||
std::string GINFO;
|
||||
@@ -768,8 +745,6 @@ void WorldSession::HandleGuildChangeInfoTextOpcode(WorldPacket& recvPacket)
|
||||
|
||||
void WorldSession::HandleSaveGuildEmblemOpcode(WorldPacket& recvPacket)
|
||||
{
|
||||
CHECK_PACKET_SIZE(recvPacket, 8+4+4+4+4+4);
|
||||
|
||||
//sLog.outDebug("WORLD: Received MSG_SAVE_GUILD_EMBLEM");
|
||||
|
||||
uint64 vendorGuid;
|
||||
@@ -900,7 +875,6 @@ void WorldSession::HandleGuildPermissions( WorldPacket& /* recv_data */ )
|
||||
void WorldSession::HandleGuildBankerActivate( WorldPacket & recv_data )
|
||||
{
|
||||
sLog.outDebug("WORLD: Received (CMSG_GUILD_BANKER_ACTIVATE)");
|
||||
CHECK_PACKET_SIZE(recv_data,8+1);
|
||||
uint64 GoGuid;
|
||||
uint8 unk;
|
||||
recv_data >> GoGuid >> unk;
|
||||
@@ -924,7 +898,6 @@ void WorldSession::HandleGuildBankerActivate( WorldPacket & recv_data )
|
||||
void WorldSession::HandleGuildBankQueryTab( WorldPacket & recv_data )
|
||||
{
|
||||
sLog.outDebug("WORLD: Received (CMSG_GUILD_BANK_QUERY_TAB)");
|
||||
CHECK_PACKET_SIZE(recv_data,8+1+1);
|
||||
uint64 GoGuid;
|
||||
uint8 TabId,unk1;
|
||||
recv_data >> GoGuid >> TabId >> unk1;
|
||||
@@ -950,7 +923,6 @@ void WorldSession::HandleGuildBankQueryTab( WorldPacket & recv_data )
|
||||
void WorldSession::HandleGuildBankDepositMoney( WorldPacket & recv_data )
|
||||
{
|
||||
sLog.outDebug("WORLD: Received (CMSG_GUILD_BANK_DEPOSIT_MONEY)");
|
||||
CHECK_PACKET_SIZE(recv_data,8+4);
|
||||
uint64 GoGuid;
|
||||
uint32 money;
|
||||
recv_data >> GoGuid >> money;
|
||||
@@ -998,7 +970,6 @@ void WorldSession::HandleGuildBankDepositMoney( WorldPacket & recv_data )
|
||||
void WorldSession::HandleGuildBankWithdrawMoney( WorldPacket & recv_data )
|
||||
{
|
||||
sLog.outDebug("WORLD: Received (CMSG_GUILD_BANK_WITHDRAW_MONEY)");
|
||||
CHECK_PACKET_SIZE(recv_data,8+4);
|
||||
uint64 GoGuid;
|
||||
uint32 money;
|
||||
recv_data >> GoGuid >> money;
|
||||
@@ -1058,12 +1029,9 @@ void WorldSession::HandleGuildBankSwapItems( WorldPacket & recv_data )
|
||||
uint32 ItemEntry, unk1;
|
||||
bool BankToChar = false;
|
||||
|
||||
CHECK_PACKET_SIZE(recv_data,8+1);
|
||||
recv_data >> GoGuid >> BankToBank;
|
||||
if (BankToBank)
|
||||
{
|
||||
// recheck
|
||||
CHECK_PACKET_SIZE(recv_data, recv_data.rpos()+1+1+4+1+1+4+1+1);
|
||||
recv_data >> BankTabDst;
|
||||
recv_data >> BankTabSlotDst;
|
||||
recv_data >> unk1; // always 0
|
||||
@@ -1080,26 +1048,18 @@ void WorldSession::HandleGuildBankSwapItems( WorldPacket & recv_data )
|
||||
}
|
||||
else
|
||||
{
|
||||
// recheck
|
||||
CHECK_PACKET_SIZE(recv_data, recv_data.rpos()+1+1+4+1);
|
||||
recv_data >> BankTab;
|
||||
recv_data >> BankTabSlot;
|
||||
recv_data >> ItemEntry;
|
||||
recv_data >> AutoStore;
|
||||
if (AutoStore)
|
||||
{
|
||||
// recheck
|
||||
CHECK_PACKET_SIZE(recv_data, recv_data.rpos()+1);
|
||||
recv_data >> AutoStoreCount;
|
||||
}
|
||||
// recheck
|
||||
CHECK_PACKET_SIZE(recv_data, recv_data.rpos()+1+1);
|
||||
recv_data >> PlayerBag;
|
||||
recv_data >> PlayerSlot;
|
||||
if (!AutoStore)
|
||||
{
|
||||
// recheck
|
||||
CHECK_PACKET_SIZE(recv_data, recv_data.rpos()+1+1);
|
||||
recv_data >> ToChar;
|
||||
recv_data >> SplitedAmount;
|
||||
}
|
||||
@@ -1555,7 +1515,6 @@ void WorldSession::HandleGuildBankSwapItems( WorldPacket & recv_data )
|
||||
void WorldSession::HandleGuildBankBuyTab( WorldPacket & recv_data )
|
||||
{
|
||||
sLog.outDebug("WORLD: Received (CMSG_GUILD_BANK_BUY_TAB)");
|
||||
CHECK_PACKET_SIZE(recv_data, 8+1);
|
||||
//recv_data.hexlike();
|
||||
uint64 GoGuid;
|
||||
uint8 TabId;
|
||||
@@ -1603,7 +1562,6 @@ void WorldSession::HandleGuildBankUpdateTab( WorldPacket & recv_data )
|
||||
{
|
||||
sLog.outDebug("WORLD: Received (CMSG_GUILD_BANK_UPDATE_TAB)");
|
||||
//recv_data.hexlike();
|
||||
CHECK_PACKET_SIZE(recv_data, 8+1+1+1);
|
||||
uint64 GoGuid;
|
||||
uint8 TabId;
|
||||
std::string Name;
|
||||
@@ -1639,7 +1597,6 @@ void WorldSession::HandleGuildBankUpdateTab( WorldPacket & recv_data )
|
||||
void WorldSession::HandleGuildBankLogQuery( WorldPacket & recv_data )
|
||||
{
|
||||
sLog.outDebug("WORLD: Received (MSG_GUILD_BANK_LOG_QUERY)");
|
||||
CHECK_PACKET_SIZE(recv_data, 1);
|
||||
|
||||
uint32 GuildId = GetPlayer()->GetGuildId();
|
||||
if (GuildId == 0)
|
||||
@@ -1658,7 +1615,6 @@ void WorldSession::HandleGuildBankLogQuery( WorldPacket & recv_data )
|
||||
void WorldSession::HandleQueryGuildBankTabText(WorldPacket &recv_data)
|
||||
{
|
||||
sLog.outDebug("WORLD: Received MSG_QUERY_GUILD_BANK_TEXT");
|
||||
CHECK_PACKET_SIZE(recv_data, 1);
|
||||
|
||||
uint32 GuildId = GetPlayer()->GetGuildId();
|
||||
if (GuildId == 0)
|
||||
@@ -1677,8 +1633,6 @@ void WorldSession::HandleQueryGuildBankTabText(WorldPacket &recv_data)
|
||||
void WorldSession::HandleSetGuildBankTabText(WorldPacket &recv_data)
|
||||
{
|
||||
sLog.outDebug("WORLD: Received CMSG_SET_GUILD_BANK_TEXT");
|
||||
CHECK_PACKET_SIZE(recv_data, 1+1);
|
||||
|
||||
uint32 GuildId = GetPlayer()->GetGuildId();
|
||||
if (GuildId == 0)
|
||||
return;
|
||||
|
||||
@@ -31,8 +31,6 @@
|
||||
|
||||
void WorldSession::HandleSplitItemOpcode( WorldPacket & recv_data )
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data,1+1+1+1+1);
|
||||
|
||||
//sLog.outDebug("WORLD: CMSG_SPLIT_ITEM");
|
||||
uint8 srcbag, srcslot, dstbag, dstslot, count;
|
||||
|
||||
@@ -65,8 +63,6 @@ void WorldSession::HandleSplitItemOpcode( WorldPacket & recv_data )
|
||||
|
||||
void WorldSession::HandleSwapInvItemOpcode( WorldPacket & recv_data )
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data,1+1);
|
||||
|
||||
//sLog.outDebug("WORLD: CMSG_SWAP_INV_ITEM");
|
||||
uint8 srcslot, dstslot;
|
||||
|
||||
@@ -97,7 +93,6 @@ void WorldSession::HandleSwapInvItemOpcode( WorldPacket & recv_data )
|
||||
|
||||
void WorldSession::HandleAutoEquipItemSlotOpcode( WorldPacket & recv_data )
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data,8+1);
|
||||
uint64 itemguid;
|
||||
uint8 dstslot;
|
||||
recv_data >> itemguid >> dstslot;
|
||||
@@ -117,8 +112,6 @@ void WorldSession::HandleAutoEquipItemSlotOpcode( WorldPacket & recv_data )
|
||||
|
||||
void WorldSession::HandleSwapItem( WorldPacket & recv_data )
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data,1+1+1+1);
|
||||
|
||||
//sLog.outDebug("WORLD: CMSG_SWAP_ITEM");
|
||||
uint8 dstbag, dstslot, srcbag, srcslot;
|
||||
|
||||
@@ -149,8 +142,6 @@ void WorldSession::HandleSwapItem( WorldPacket & recv_data )
|
||||
|
||||
void WorldSession::HandleAutoEquipItemOpcode( WorldPacket & recv_data )
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data,1+1);
|
||||
|
||||
//sLog.outDebug("WORLD: CMSG_AUTOEQUIP_ITEM");
|
||||
uint8 srcbag, srcslot;
|
||||
|
||||
@@ -252,8 +243,6 @@ void WorldSession::HandleAutoEquipItemOpcode( WorldPacket & recv_data )
|
||||
|
||||
void WorldSession::HandleDestroyItemOpcode( WorldPacket & recv_data )
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data,1+1+1+1+1+1);
|
||||
|
||||
//sLog.outDebug("WORLD: CMSG_DESTROYITEM");
|
||||
uint8 bag, slot, count, data1, data2, data3;
|
||||
|
||||
@@ -292,8 +281,6 @@ void WorldSession::HandleDestroyItemOpcode( WorldPacket & recv_data )
|
||||
// Only _static_ data send in this packet !!!
|
||||
void WorldSession::HandleItemQuerySingleOpcode( WorldPacket & recv_data )
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data, 4);
|
||||
|
||||
//sLog.outDebug("WORLD: CMSG_ITEM_QUERY_SINGLE");
|
||||
uint32 item;
|
||||
recv_data >> item;
|
||||
@@ -455,8 +442,6 @@ void WorldSession::HandleItemQuerySingleOpcode( WorldPacket & recv_data )
|
||||
|
||||
void WorldSession::HandleReadItem( WorldPacket & recv_data )
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data,1+1);
|
||||
|
||||
//sLog.outDebug( "WORLD: CMSG_READ_ITEM");
|
||||
|
||||
uint8 bag, slot;
|
||||
@@ -490,8 +475,6 @@ void WorldSession::HandleReadItem( WorldPacket & recv_data )
|
||||
|
||||
void WorldSession::HandlePageQuerySkippedOpcode( WorldPacket & recv_data )
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data,4+8);
|
||||
|
||||
sLog.outDebug( "WORLD: Received CMSG_PAGE_TEXT_QUERY" );
|
||||
|
||||
uint32 itemid;
|
||||
@@ -505,8 +488,6 @@ void WorldSession::HandlePageQuerySkippedOpcode( WorldPacket & recv_data )
|
||||
|
||||
void WorldSession::HandleSellItemOpcode( WorldPacket & recv_data )
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data,8+8+1);
|
||||
|
||||
sLog.outDebug( "WORLD: Received CMSG_SELL_ITEM" );
|
||||
uint64 vendorguid, itemguid;
|
||||
uint8 _count;
|
||||
@@ -616,8 +597,6 @@ void WorldSession::HandleSellItemOpcode( WorldPacket & recv_data )
|
||||
|
||||
void WorldSession::HandleBuybackItem(WorldPacket & recv_data)
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data,8+4);
|
||||
|
||||
sLog.outDebug( "WORLD: Received CMSG_BUYBACK_ITEM" );
|
||||
uint64 vendorguid;
|
||||
uint32 slot;
|
||||
@@ -665,8 +644,6 @@ void WorldSession::HandleBuybackItem(WorldPacket & recv_data)
|
||||
|
||||
void WorldSession::HandleBuyItemInSlotOpcode( WorldPacket & recv_data )
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data,8+4+4+8+1+4);
|
||||
|
||||
sLog.outDebug( "WORLD: Received CMSG_BUY_ITEM_IN_SLOT" );
|
||||
uint64 vendorguid, bagguid;
|
||||
uint32 item, slot, count;
|
||||
@@ -703,8 +680,6 @@ void WorldSession::HandleBuyItemInSlotOpcode( WorldPacket & recv_data )
|
||||
|
||||
void WorldSession::HandleBuyItemOpcode( WorldPacket & recv_data )
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data,8+4+4+4+1);
|
||||
|
||||
sLog.outDebug( "WORLD: Received CMSG_BUY_ITEM" );
|
||||
uint64 vendorguid;
|
||||
uint32 item, slot, count;
|
||||
@@ -717,8 +692,6 @@ void WorldSession::HandleBuyItemOpcode( WorldPacket & recv_data )
|
||||
|
||||
void WorldSession::HandleListInventoryOpcode( WorldPacket & recv_data )
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data,8);
|
||||
|
||||
uint64 guid;
|
||||
|
||||
recv_data >> guid;
|
||||
@@ -801,8 +774,6 @@ void WorldSession::SendListInventory( uint64 vendorguid )
|
||||
|
||||
void WorldSession::HandleAutoStoreBagItemOpcode( WorldPacket & recv_data )
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data,1+1+1);
|
||||
|
||||
//sLog.outDebug("WORLD: CMSG_AUTOSTORE_BAG_ITEM");
|
||||
uint8 srcbag, srcslot, dstbag;
|
||||
|
||||
@@ -854,8 +825,6 @@ void WorldSession::HandleAutoStoreBagItemOpcode( WorldPacket & recv_data )
|
||||
|
||||
void WorldSession::HandleBuyBankSlotOpcode(WorldPacket& recvPacket)
|
||||
{
|
||||
CHECK_PACKET_SIZE(recvPacket, 8);
|
||||
|
||||
sLog.outDebug("WORLD: CMSG_BUY_BANK_SLOT");
|
||||
|
||||
uint64 guid;
|
||||
@@ -895,8 +864,6 @@ void WorldSession::HandleBuyBankSlotOpcode(WorldPacket& recvPacket)
|
||||
|
||||
void WorldSession::HandleAutoBankItemOpcode(WorldPacket& recvPacket)
|
||||
{
|
||||
CHECK_PACKET_SIZE(recvPacket,1+1);
|
||||
|
||||
sLog.outDebug("WORLD: CMSG_AUTOBANK_ITEM");
|
||||
uint8 srcbag, srcslot;
|
||||
|
||||
@@ -921,8 +888,6 @@ void WorldSession::HandleAutoBankItemOpcode(WorldPacket& recvPacket)
|
||||
|
||||
void WorldSession::HandleAutoStoreBankItemOpcode(WorldPacket& recvPacket)
|
||||
{
|
||||
CHECK_PACKET_SIZE(recvPacket,1+1);
|
||||
|
||||
sLog.outDebug("WORLD: CMSG_AUTOSTORE_BANK_ITEM");
|
||||
uint8 srcbag, srcslot;
|
||||
|
||||
@@ -963,8 +928,6 @@ void WorldSession::HandleAutoStoreBankItemOpcode(WorldPacket& recvPacket)
|
||||
|
||||
void WorldSession::HandleSetAmmoOpcode(WorldPacket & recv_data)
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data,4);
|
||||
|
||||
if(!GetPlayer()->isAlive())
|
||||
{
|
||||
GetPlayer()->SendEquipError( EQUIP_ERR_YOU_ARE_DEAD, NULL, NULL );
|
||||
@@ -1006,8 +969,6 @@ void WorldSession::SendItemEnchantTimeUpdate(uint64 Playerguid, uint64 Itemguid,
|
||||
|
||||
void WorldSession::HandleItemNameQueryOpcode(WorldPacket & recv_data)
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data,4);
|
||||
|
||||
uint32 itemid;
|
||||
recv_data >> itemid;
|
||||
sLog.outDebug("WORLD: CMSG_ITEM_NAME_QUERY %u", itemid);
|
||||
@@ -1047,8 +1008,6 @@ void WorldSession::HandleItemNameQueryOpcode(WorldPacket & recv_data)
|
||||
|
||||
void WorldSession::HandleWrapItemOpcode(WorldPacket& recv_data)
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data,1+1+1+1);
|
||||
|
||||
sLog.outDebug("Received opcode CMSG_WRAP_ITEM");
|
||||
|
||||
uint8 gift_bag, gift_slot, item_bag, item_slot;
|
||||
@@ -1156,8 +1115,6 @@ void WorldSession::HandleSocketOpcode(WorldPacket& recv_data)
|
||||
{
|
||||
sLog.outDebug("WORLD: CMSG_SOCKET_GEMS");
|
||||
|
||||
CHECK_PACKET_SIZE(recv_data,8+8*MAX_GEM_SOCKETS);
|
||||
|
||||
uint64 item_guid;
|
||||
uint64 gem_guids[MAX_GEM_SOCKETS];
|
||||
|
||||
@@ -1358,8 +1315,6 @@ void WorldSession::HandleCancelTempEnchantmentOpcode(WorldPacket& recv_data)
|
||||
{
|
||||
sLog.outDebug("WORLD: CMSG_CANCEL_TEMP_ENCHANTMENT");
|
||||
|
||||
CHECK_PACKET_SIZE(recv_data,4);
|
||||
|
||||
uint32 eslot;
|
||||
|
||||
recv_data >> eslot;
|
||||
|
||||
@@ -207,8 +207,6 @@ void WorldSession::HandleLfmClearOpcode( WorldPacket & /*recv_data */)
|
||||
|
||||
void WorldSession::HandleSetLfmOpcode( WorldPacket & recv_data )
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data, 4+1+1+1+1);
|
||||
|
||||
sLog.outDebug("CMSG_SET_LOOKING_FOR_MORE");
|
||||
//recv_data.hexlike();
|
||||
uint32 temp, entry, type;
|
||||
@@ -231,8 +229,6 @@ void WorldSession::HandleSetLfmOpcode( WorldPacket & recv_data )
|
||||
|
||||
void WorldSession::HandleSetLfgCommentOpcode( WorldPacket & recv_data )
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data, 1);
|
||||
|
||||
sLog.outDebug("CMSG_SET_LFG_COMMENT");
|
||||
//recv_data.hexlike();
|
||||
|
||||
@@ -245,8 +241,6 @@ void WorldSession::HandleSetLfgCommentOpcode( WorldPacket & recv_data )
|
||||
|
||||
void WorldSession::HandleLookingForGroup(WorldPacket& recv_data)
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data, 4+4+4);
|
||||
|
||||
sLog.outDebug("MSG_LOOKING_FOR_GROUP");
|
||||
//recv_data.hexlike();
|
||||
uint32 type, entry, unk;
|
||||
@@ -399,8 +393,6 @@ void WorldSession::SendLfgResult(uint32 type, uint32 entry, uint8 lfg_type)
|
||||
|
||||
void WorldSession::HandleSetLfgOpcode( WorldPacket & recv_data )
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data, 4+4+1+1);
|
||||
|
||||
sLog.outDebug("CMSG_SET_LOOKING_FOR_GROUP");
|
||||
recv_data.hexlike();
|
||||
uint32 slot, temp, entry, type;
|
||||
@@ -427,8 +419,6 @@ void WorldSession::HandleSetLfgOpcode( WorldPacket & recv_data )
|
||||
|
||||
void WorldSession::HandleLfgSetRoles(WorldPacket &recv_data)
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data, 1);
|
||||
|
||||
sLog.outDebug("CMSG_LFG_SET_ROLES");
|
||||
|
||||
uint8 roles;
|
||||
|
||||
@@ -34,8 +34,6 @@
|
||||
|
||||
void WorldSession::HandleAutostoreLootItemOpcode( WorldPacket & recv_data )
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data,1);
|
||||
|
||||
sLog.outDebug("WORLD: CMSG_AUTOSTORE_LOOT_ITEM");
|
||||
Player *player = GetPlayer();
|
||||
uint64 lguid = player->GetLootGUID();
|
||||
@@ -252,8 +250,6 @@ void WorldSession::HandleLootMoneyOpcode( WorldPacket & /*recv_data*/ )
|
||||
|
||||
void WorldSession::HandleLootOpcode( WorldPacket & recv_data )
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data,8);
|
||||
|
||||
sLog.outDebug("WORLD: CMSG_LOOT");
|
||||
|
||||
uint64 guid;
|
||||
@@ -268,8 +264,6 @@ void WorldSession::HandleLootOpcode( WorldPacket & recv_data )
|
||||
|
||||
void WorldSession::HandleLootReleaseOpcode( WorldPacket & recv_data )
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data,8);
|
||||
|
||||
sLog.outDebug("WORLD: CMSG_LOOT_RELEASE");
|
||||
|
||||
// cheaters can modify lguid to prevent correct apply loot release code and re-loot
|
||||
@@ -449,8 +443,6 @@ void WorldSession::DoLootRelease( uint64 lguid )
|
||||
|
||||
void WorldSession::HandleLootMasterGiveOpcode( WorldPacket & recv_data )
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data,8+1+8);
|
||||
|
||||
uint8 slotid;
|
||||
uint64 lootguid, target_playerguid;
|
||||
|
||||
|
||||
@@ -55,8 +55,6 @@ void MailItem::deleteItem( bool inDB )
|
||||
|
||||
void WorldSession::HandleSendMail(WorldPacket & recv_data )
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data,8+1+1+1+4+4+1+4+4+8+1);
|
||||
|
||||
uint64 mailbox, unk3;
|
||||
std::string receiver, subject, body;
|
||||
uint32 unk1, unk2, money, COD;
|
||||
@@ -67,19 +65,10 @@ void WorldSession::HandleSendMail(WorldPacket & recv_data )
|
||||
if (!GetPlayer()->GetGameObjectIfCanInteractWith(mailbox, GAMEOBJECT_TYPE_MAILBOX))
|
||||
return;
|
||||
|
||||
// recheck
|
||||
CHECK_PACKET_SIZE(recv_data, 8+(receiver.size()+1)+1+1+4+4+1+4+4+8+1);
|
||||
|
||||
recv_data >> subject;
|
||||
|
||||
// recheck
|
||||
CHECK_PACKET_SIZE(recv_data, 8+(receiver.size()+1)+(subject.size()+1)+1+4+4+1+4+4+8+1);
|
||||
|
||||
recv_data >> body;
|
||||
|
||||
// recheck
|
||||
CHECK_PACKET_SIZE(recv_data, 8+(receiver.size()+1)+(subject.size()+1)+(body.size()+1)+4+4+1+4+4+8+1);
|
||||
|
||||
recv_data >> unk1; // stationery?
|
||||
recv_data >> unk2; // 0x00000000
|
||||
|
||||
@@ -94,9 +83,6 @@ void WorldSession::HandleSendMail(WorldPacket & recv_data )
|
||||
return;
|
||||
}
|
||||
|
||||
// recheck
|
||||
CHECK_PACKET_SIZE(recv_data, 8+(receiver.size()+1)+(subject.size()+1)+(body.size()+1)+4+4+1+items_count*(1+8)+4+4+8+1);
|
||||
|
||||
if(items_count)
|
||||
{
|
||||
for(uint8 i = 0; i < items_count; ++i)
|
||||
@@ -300,8 +286,6 @@ void WorldSession::HandleSendMail(WorldPacket & recv_data )
|
||||
//called when mail is read
|
||||
void WorldSession::HandleMailMarkAsRead(WorldPacket & recv_data )
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data,8+4);
|
||||
|
||||
uint64 mailbox;
|
||||
uint32 mailId;
|
||||
recv_data >> mailbox;
|
||||
@@ -326,8 +310,6 @@ void WorldSession::HandleMailMarkAsRead(WorldPacket & recv_data )
|
||||
//called when client deletes mail
|
||||
void WorldSession::HandleMailDelete(WorldPacket & recv_data )
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data,8+4);
|
||||
|
||||
uint64 mailbox;
|
||||
uint32 mailId;
|
||||
recv_data >> mailbox;
|
||||
@@ -352,8 +334,6 @@ void WorldSession::HandleMailDelete(WorldPacket & recv_data )
|
||||
|
||||
void WorldSession::HandleMailReturnToSender(WorldPacket & recv_data )
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data,8+4);
|
||||
|
||||
uint64 mailbox;
|
||||
uint32 mailId;
|
||||
recv_data >> mailbox;
|
||||
@@ -459,8 +439,6 @@ void WorldSession::SendReturnToSender(uint8 messageType, uint32 sender_acc, uint
|
||||
//called when player takes item attached in mail
|
||||
void WorldSession::HandleMailTakeItem(WorldPacket & recv_data )
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data,8+4+4);
|
||||
|
||||
uint64 mailbox;
|
||||
uint32 mailId;
|
||||
uint32 itemId;
|
||||
@@ -554,8 +532,6 @@ void WorldSession::HandleMailTakeItem(WorldPacket & recv_data )
|
||||
|
||||
void WorldSession::HandleMailTakeMoney(WorldPacket & recv_data )
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data,8+4);
|
||||
|
||||
uint64 mailbox;
|
||||
uint32 mailId;
|
||||
recv_data >> mailbox;
|
||||
@@ -590,8 +566,6 @@ void WorldSession::HandleMailTakeMoney(WorldPacket & recv_data )
|
||||
//called when player lists his received mails
|
||||
void WorldSession::HandleGetMailList(WorldPacket & recv_data )
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data,8);
|
||||
|
||||
uint64 mailbox;
|
||||
recv_data >> mailbox;
|
||||
|
||||
@@ -712,8 +686,6 @@ void WorldSession::HandleGetMailList(WorldPacket & recv_data )
|
||||
///this function is called when client needs mail message body, or when player clicks on item which has ITEM_FIELD_ITEM_TEXT_ID > 0
|
||||
void WorldSession::HandleItemTextQuery(WorldPacket & recv_data )
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data,4+4+4);
|
||||
|
||||
uint32 itemTextId;
|
||||
uint32 mailId; //this value can be item id in bag, but it is also mail id
|
||||
uint32 unk; //maybe something like state - 0x70000000
|
||||
@@ -733,8 +705,6 @@ void WorldSession::HandleItemTextQuery(WorldPacket & recv_data )
|
||||
//used when player copies mail body to his inventory
|
||||
void WorldSession::HandleMailCreateTextItem(WorldPacket & recv_data )
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data,8+4);
|
||||
|
||||
uint64 mailbox;
|
||||
uint32 mailId;
|
||||
|
||||
|
||||
@@ -74,8 +74,6 @@ void WorldSession::HandleRepopRequestOpcode( WorldPacket & /*recv_data*/ )
|
||||
|
||||
void WorldSession::HandleGossipSelectOptionOpcode( WorldPacket & recv_data )
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data,8+4+4);
|
||||
|
||||
sLog.outDebug("WORLD: CMSG_GOSSIP_SELECT_OPTION");
|
||||
|
||||
uint32 option;
|
||||
@@ -88,7 +86,6 @@ void WorldSession::HandleGossipSelectOptionOpcode( WorldPacket & recv_data )
|
||||
if(_player->PlayerTalkClass->GossipOptionCoded( option ))
|
||||
{
|
||||
// recheck
|
||||
CHECK_PACKET_SIZE(recv_data,8+4+1);
|
||||
sLog.outBasic("reading string");
|
||||
recv_data >> code;
|
||||
sLog.outBasic("string read: %s", code.c_str());
|
||||
@@ -148,8 +145,6 @@ void WorldSession::HandleGossipSelectOptionOpcode( WorldPacket & recv_data )
|
||||
|
||||
void WorldSession::HandleWhoOpcode( WorldPacket & recv_data )
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data,4+4+1+1+4+4+4+4);
|
||||
|
||||
sLog.outDebug( "WORLD: Recvd CMSG_WHO Message" );
|
||||
//recv_data.hexlike();
|
||||
|
||||
@@ -163,14 +158,8 @@ void WorldSession::HandleWhoOpcode( WorldPacket & recv_data )
|
||||
recv_data >> level_max; // minimal player level, default 100 (MAX_LEVEL)
|
||||
recv_data >> player_name; // player name, case sensitive...
|
||||
|
||||
// recheck
|
||||
CHECK_PACKET_SIZE(recv_data,4+4+(player_name.size()+1)+1+4+4+4+4);
|
||||
|
||||
recv_data >> guild_name; // guild name, case sensitive...
|
||||
|
||||
// recheck
|
||||
CHECK_PACKET_SIZE(recv_data,4+4+(player_name.size()+1)+(guild_name.size()+1)+4+4+4+4);
|
||||
|
||||
recv_data >> racemask; // race mask
|
||||
recv_data >> classmask; // class mask
|
||||
recv_data >> zones_count; // zones count, client limit=10 (2.0.10)
|
||||
@@ -178,9 +167,6 @@ void WorldSession::HandleWhoOpcode( WorldPacket & recv_data )
|
||||
if(zones_count > 10)
|
||||
return; // can't be received from real client or broken packet
|
||||
|
||||
// recheck
|
||||
CHECK_PACKET_SIZE(recv_data,4+4+(player_name.size()+1)+(guild_name.size()+1)+4+4+4+(4*zones_count)+4);
|
||||
|
||||
for(uint32 i = 0; i < zones_count; ++i)
|
||||
{
|
||||
uint32 temp;
|
||||
@@ -194,17 +180,11 @@ void WorldSession::HandleWhoOpcode( WorldPacket & recv_data )
|
||||
if(str_count > 4)
|
||||
return; // can't be received from real client or broken packet
|
||||
|
||||
// recheck
|
||||
CHECK_PACKET_SIZE(recv_data,4+4+(player_name.size()+1)+(guild_name.size()+1)+4+4+4+(4*zones_count)+4+(1*str_count));
|
||||
|
||||
sLog.outDebug("Minlvl %u, maxlvl %u, name %s, guild %s, racemask %u, classmask %u, zones %u, strings %u", level_min, level_max, player_name.c_str(), guild_name.c_str(), racemask, classmask, zones_count, str_count);
|
||||
|
||||
std::wstring str[4]; // 4 is client limit
|
||||
for(uint32 i = 0; i < str_count; ++i)
|
||||
{
|
||||
// recheck (have one more byte)
|
||||
CHECK_PACKET_SIZE(recv_data,recv_data.rpos());
|
||||
|
||||
std::string temp;
|
||||
recv_data >> temp; // user entered string, it used as universal search pattern(guild+player name)?
|
||||
|
||||
@@ -468,8 +448,6 @@ void WorldSession::HandleTogglePvP( WorldPacket & recv_data )
|
||||
|
||||
void WorldSession::HandleZoneUpdateOpcode( WorldPacket & recv_data )
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data,4);
|
||||
|
||||
uint32 newZone;
|
||||
recv_data >> newZone;
|
||||
|
||||
@@ -485,8 +463,6 @@ void WorldSession::HandleZoneUpdateOpcode( WorldPacket & recv_data )
|
||||
void WorldSession::HandleSetTargetOpcode( WorldPacket & recv_data )
|
||||
{
|
||||
// When this packet send?
|
||||
CHECK_PACKET_SIZE(recv_data,8);
|
||||
|
||||
uint64 guid ;
|
||||
recv_data >> guid;
|
||||
|
||||
@@ -503,8 +479,6 @@ void WorldSession::HandleSetTargetOpcode( WorldPacket & recv_data )
|
||||
|
||||
void WorldSession::HandleSetSelectionOpcode( WorldPacket & recv_data )
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data,8);
|
||||
|
||||
uint64 guid;
|
||||
recv_data >> guid;
|
||||
|
||||
@@ -521,8 +495,6 @@ void WorldSession::HandleSetSelectionOpcode( WorldPacket & recv_data )
|
||||
|
||||
void WorldSession::HandleStandStateChangeOpcode( WorldPacket & recv_data )
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data,1);
|
||||
|
||||
sLog.outDebug( "WORLD: Received CMSG_STAND_STATE_CHANGE" );
|
||||
uint8 animstate;
|
||||
recv_data >> animstate;
|
||||
@@ -532,7 +504,6 @@ void WorldSession::HandleStandStateChangeOpcode( WorldPacket & recv_data )
|
||||
|
||||
void WorldSession::HandleContactListOpcode( WorldPacket & recv_data )
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data, 4);
|
||||
sLog.outDebug( "WORLD: Received CMSG_CONTACT_LIST" );
|
||||
uint32 unk;
|
||||
recv_data >> unk;
|
||||
@@ -542,8 +513,6 @@ void WorldSession::HandleContactListOpcode( WorldPacket & recv_data )
|
||||
|
||||
void WorldSession::HandleAddFriendOpcode( WorldPacket & recv_data )
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data, 1+1);
|
||||
|
||||
sLog.outDebug( "WORLD: Received CMSG_ADD_FRIEND" );
|
||||
|
||||
std::string friendName = GetTrinityString(LANG_FRIEND_IGNORE_UNKNOWN);
|
||||
@@ -551,9 +520,6 @@ void WorldSession::HandleAddFriendOpcode( WorldPacket & recv_data )
|
||||
|
||||
recv_data >> friendName;
|
||||
|
||||
// recheck
|
||||
CHECK_PACKET_SIZE(recv_data, (friendName.size()+1)+1);
|
||||
|
||||
recv_data >> friendNote;
|
||||
|
||||
if(!normalizePlayerName(friendName))
|
||||
@@ -625,8 +591,6 @@ void WorldSession::HandleAddFriendOpcodeCallBack(QueryResult *result, uint32 acc
|
||||
|
||||
void WorldSession::HandleDelFriendOpcode( WorldPacket & recv_data )
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data, 8);
|
||||
|
||||
uint64 FriendGUID;
|
||||
|
||||
sLog.outDebug( "WORLD: Received CMSG_DEL_FRIEND" );
|
||||
@@ -642,8 +606,6 @@ void WorldSession::HandleDelFriendOpcode( WorldPacket & recv_data )
|
||||
|
||||
void WorldSession::HandleAddIgnoreOpcode( WorldPacket & recv_data )
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data,1);
|
||||
|
||||
sLog.outDebug( "WORLD: Received CMSG_ADD_IGNORE" );
|
||||
|
||||
std::string IgnoreName = GetTrinityString(LANG_FRIEND_IGNORE_UNKNOWN);
|
||||
@@ -704,8 +666,6 @@ void WorldSession::HandleAddIgnoreOpcodeCallBack(QueryResult *result, uint32 acc
|
||||
|
||||
void WorldSession::HandleDelIgnoreOpcode( WorldPacket & recv_data )
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data, 8);
|
||||
|
||||
uint64 IgnoreGUID;
|
||||
|
||||
sLog.outDebug( "WORLD: Received CMSG_DEL_IGNORE" );
|
||||
@@ -721,7 +681,6 @@ void WorldSession::HandleDelIgnoreOpcode( WorldPacket & recv_data )
|
||||
|
||||
void WorldSession::HandleSetContactNotesOpcode( WorldPacket & recv_data )
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data, 8+1);
|
||||
sLog.outDebug("CMSG_SET_CONTACT_NOTES");
|
||||
uint64 guid;
|
||||
std::string note;
|
||||
@@ -731,8 +690,6 @@ void WorldSession::HandleSetContactNotesOpcode( WorldPacket & recv_data )
|
||||
|
||||
void WorldSession::HandleBugOpcode( WorldPacket & recv_data )
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data,4+4+1+4+1);
|
||||
|
||||
uint32 suggestion, contentlen;
|
||||
std::string content;
|
||||
uint32 typelen;
|
||||
@@ -740,9 +697,6 @@ void WorldSession::HandleBugOpcode( WorldPacket & recv_data )
|
||||
|
||||
recv_data >> suggestion >> contentlen >> content;
|
||||
|
||||
//recheck
|
||||
CHECK_PACKET_SIZE(recv_data,4+4+(content.size()+1)+4+1);
|
||||
|
||||
recv_data >> typelen >> type;
|
||||
|
||||
if( suggestion == 0 )
|
||||
@@ -750,8 +704,8 @@ void WorldSession::HandleBugOpcode( WorldPacket & recv_data )
|
||||
else
|
||||
sLog.outDebug( "WORLD: Received CMSG_BUG [Suggestion]" );
|
||||
|
||||
sLog.outDebug( type.c_str( ) );
|
||||
sLog.outDebug( content.c_str( ) );
|
||||
sLog.outDebug("%s", type.c_str() );
|
||||
sLog.outDebug("%s", content.c_str() );
|
||||
|
||||
CharacterDatabase.escape_string(type);
|
||||
CharacterDatabase.escape_string(content);
|
||||
@@ -760,8 +714,6 @@ void WorldSession::HandleBugOpcode( WorldPacket & recv_data )
|
||||
|
||||
void WorldSession::HandleReclaimCorpseOpcode(WorldPacket &recv_data)
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data,8);
|
||||
|
||||
sLog.outDetail("WORLD: Received CMSG_RECLAIM_CORPSE");
|
||||
if (GetPlayer()->isAlive())
|
||||
return;
|
||||
@@ -800,8 +752,6 @@ void WorldSession::HandleReclaimCorpseOpcode(WorldPacket &recv_data)
|
||||
|
||||
void WorldSession::HandleResurrectResponseOpcode(WorldPacket & recv_data)
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data,8+1);
|
||||
|
||||
sLog.outDetail("WORLD: Received CMSG_RESURRECT_RESPONSE");
|
||||
|
||||
if(GetPlayer()->isAlive())
|
||||
@@ -827,8 +777,6 @@ void WorldSession::HandleResurrectResponseOpcode(WorldPacket & recv_data)
|
||||
|
||||
void WorldSession::HandleAreaTriggerOpcode(WorldPacket & recv_data)
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data,4);
|
||||
|
||||
sLog.outDebug("WORLD: Received CMSG_AREATRIGGER");
|
||||
|
||||
uint32 Trigger_ID;
|
||||
@@ -951,8 +899,6 @@ 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;
|
||||
|
||||
@@ -1004,8 +950,6 @@ 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;
|
||||
|
||||
@@ -1042,8 +986,6 @@ void WorldSession::HandleRequestAccountData(WorldPacket& recv_data)
|
||||
|
||||
void WorldSession::HandleSetActionButtonOpcode(WorldPacket& recv_data)
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data,1+2+1+1);
|
||||
|
||||
sLog.outDebug( "WORLD: Received CMSG_SET_ACTION_BUTTON" );
|
||||
uint8 button;
|
||||
uint32 packetData;
|
||||
@@ -1099,7 +1041,6 @@ void WorldSession::HandleMoveTimeSkippedOpcode( WorldPacket & /*recv_data*/ )
|
||||
DEBUG_LOG( "WORLD: Time Lag/Synchronization Resent/Update" );
|
||||
|
||||
/*
|
||||
CHECK_PACKET_SIZE(recv_data,8+4);
|
||||
uint64 guid;
|
||||
uint32 time_skipped;
|
||||
recv_data >> guid;
|
||||
@@ -1122,7 +1063,6 @@ void WorldSession::HandleFeatherFallAck(WorldPacket &/*recv_data*/)
|
||||
void WorldSession::HandleMoveUnRootAck(WorldPacket&/* recv_data*/)
|
||||
{
|
||||
/*
|
||||
CHECK_PACKET_SIZE(recv_data,8+8+4+4+4+4+4);
|
||||
|
||||
sLog.outDebug( "WORLD: CMSG_FORCE_MOVE_UNROOT_ACK" );
|
||||
recv_data.hexlike();
|
||||
@@ -1156,8 +1096,6 @@ void WorldSession::HandleMoveUnRootAck(WorldPacket&/* recv_data*/)
|
||||
void WorldSession::HandleMoveRootAck(WorldPacket&/* recv_data*/)
|
||||
{
|
||||
/*
|
||||
CHECK_PACKET_SIZE(recv_data,8+8+4+4+4+4+4);
|
||||
|
||||
sLog.outDebug( "WORLD: CMSG_FORCE_MOVE_ROOT_ACK" );
|
||||
recv_data.hexlike();
|
||||
uint64 guid;
|
||||
@@ -1189,8 +1127,6 @@ void WorldSession::HandleMoveRootAck(WorldPacket&/* recv_data*/)
|
||||
|
||||
void WorldSession::HandleSetActionBarToggles(WorldPacket& recv_data)
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data,1);
|
||||
|
||||
uint8 ActionBar;
|
||||
|
||||
recv_data >> ActionBar;
|
||||
@@ -1208,8 +1144,6 @@ void WorldSession::HandleSetActionBarToggles(WorldPacket& recv_data)
|
||||
void WorldSession::HandleWardenDataOpcode(WorldPacket& /*recv_data*/)
|
||||
{
|
||||
/*
|
||||
CHECK_PACKET_SIZE(recv_data,1);
|
||||
|
||||
uint8 tmp;
|
||||
recv_data >> tmp;
|
||||
sLog.outDebug("Received opcode CMSG_WARDEN_DATA, not resolve.uint8 = %u",tmp);
|
||||
@@ -1218,8 +1152,6 @@ void WorldSession::HandleWardenDataOpcode(WorldPacket& /*recv_data*/)
|
||||
|
||||
void WorldSession::HandlePlayedTime(WorldPacket& recv_data)
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data, 1);
|
||||
|
||||
uint8 unk1;
|
||||
recv_data >> unk1; // 0 or 1 expected
|
||||
|
||||
@@ -1232,8 +1164,6 @@ void WorldSession::HandlePlayedTime(WorldPacket& recv_data)
|
||||
|
||||
void WorldSession::HandleInspectOpcode(WorldPacket& recv_data)
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data, 8);
|
||||
|
||||
uint64 guid;
|
||||
recv_data >> guid;
|
||||
DEBUG_LOG("Inspected guid is " UI64FMTD, guid);
|
||||
@@ -1267,8 +1197,6 @@ void WorldSession::HandleInspectOpcode(WorldPacket& recv_data)
|
||||
|
||||
void WorldSession::HandleInspectHonorStatsOpcode(WorldPacket& recv_data)
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data, 8);
|
||||
|
||||
uint64 guid;
|
||||
recv_data >> guid;
|
||||
|
||||
@@ -1292,8 +1220,6 @@ void WorldSession::HandleInspectHonorStatsOpcode(WorldPacket& recv_data)
|
||||
|
||||
void WorldSession::HandleWorldTeleportOpcode(WorldPacket& recv_data)
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data,4+4+4+4+4+4);
|
||||
|
||||
// write in client console: worldport 469 452 6454 2536 180 or /console worldport 469 452 6454 2536 180
|
||||
// Received opcode CMSG_WORLD_TELEPORT
|
||||
// Time is ***, map=469, x=452.000000, y=6454.000000, z=2536.000000, orient=3.141593
|
||||
@@ -1330,8 +1256,6 @@ void WorldSession::HandleWorldTeleportOpcode(WorldPacket& recv_data)
|
||||
|
||||
void WorldSession::HandleWhoisOpcode(WorldPacket& recv_data)
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data, 1);
|
||||
|
||||
sLog.outDebug("Received opcode CMSG_WHOIS");
|
||||
std::string charname;
|
||||
recv_data >> charname;
|
||||
@@ -1389,7 +1313,6 @@ void WorldSession::HandleWhoisOpcode(WorldPacket& recv_data)
|
||||
|
||||
void WorldSession::HandleComplainOpcode( WorldPacket & recv_data )
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data, 1+8);
|
||||
sLog.outDebug("WORLD: CMSG_COMPLAIN");
|
||||
recv_data.hexlike();
|
||||
|
||||
@@ -1405,13 +1328,11 @@ void WorldSession::HandleComplainOpcode( WorldPacket & recv_data )
|
||||
switch(spam_type)
|
||||
{
|
||||
case 0:
|
||||
CHECK_PACKET_SIZE(recv_data, recv_data.rpos()+4+4+4);
|
||||
recv_data >> unk1; // const 0
|
||||
recv_data >> unk2; // probably mail id
|
||||
recv_data >> unk3; // const 0
|
||||
break;
|
||||
case 1:
|
||||
CHECK_PACKET_SIZE(recv_data, recv_data.rpos()+4+4+4+4+1);
|
||||
recv_data >> unk1; // probably language
|
||||
recv_data >> unk2; // message type?
|
||||
recv_data >> unk3; // probably channel id
|
||||
@@ -1433,8 +1354,6 @@ void WorldSession::HandleComplainOpcode( WorldPacket & recv_data )
|
||||
|
||||
void WorldSession::HandleRealmSplitOpcode( WorldPacket & recv_data )
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data, 4);
|
||||
|
||||
sLog.outDebug("CMSG_REALM_SPLIT");
|
||||
|
||||
uint32 unk;
|
||||
@@ -1455,8 +1374,6 @@ void WorldSession::HandleRealmSplitOpcode( WorldPacket & recv_data )
|
||||
|
||||
void WorldSession::HandleFarSightOpcode( WorldPacket & recv_data )
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data, 1);
|
||||
|
||||
sLog.outDebug("WORLD: CMSG_FAR_SIGHT");
|
||||
//recv_data.hexlike();
|
||||
|
||||
@@ -1488,8 +1405,6 @@ void WorldSession::HandleFarSightOpcode( WorldPacket & recv_data )
|
||||
|
||||
void WorldSession::HandleSetTitleOpcode( WorldPacket & recv_data )
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data, 4);
|
||||
|
||||
sLog.outDebug("CMSG_SET_TITLE");
|
||||
|
||||
int32 title;
|
||||
@@ -1509,8 +1424,6 @@ void WorldSession::HandleSetTitleOpcode( WorldPacket & recv_data )
|
||||
|
||||
void WorldSession::HandleTimeSyncResp( WorldPacket & recv_data )
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data, 4+4);
|
||||
|
||||
sLog.outDebug("CMSG_TIME_SYNC_RESP");
|
||||
|
||||
uint32 counter, time_;
|
||||
@@ -1537,8 +1450,6 @@ void WorldSession::HandleResetInstancesOpcode( WorldPacket & /*recv_data*/ )
|
||||
|
||||
void WorldSession::HandleSetDungeonDifficultyOpcode( WorldPacket & recv_data )
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data, 4);
|
||||
|
||||
sLog.outDebug("MSG_SET_DUNGEON_DIFFICULTY");
|
||||
|
||||
uint32 mode;
|
||||
@@ -1605,8 +1516,6 @@ void WorldSession::HandleCancelMountAuraOpcode( WorldPacket & /*recv_data*/ )
|
||||
|
||||
void WorldSession::HandleMoveSetCanFlyAckOpcode( WorldPacket & recv_data )
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data, 8+4+4);
|
||||
|
||||
// fly mode on/off
|
||||
sLog.outDebug("WORLD: CMSG_MOVE_SET_CAN_FLY_ACK");
|
||||
//recv_data.hexlike();
|
||||
@@ -1630,8 +1539,6 @@ void WorldSession::HandleRequestPetInfoOpcode( WorldPacket & /*recv_data */)
|
||||
|
||||
void WorldSession::HandleSetTaxiBenchmarkOpcode( WorldPacket & recv_data )
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data, 1);
|
||||
|
||||
uint8 mode;
|
||||
recv_data >> mode;
|
||||
|
||||
@@ -1640,7 +1547,6 @@ void WorldSession::HandleSetTaxiBenchmarkOpcode( WorldPacket & recv_data )
|
||||
|
||||
void WorldSession::HandleQueryInspectAchievements( WorldPacket & recv_data )
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data, 1);
|
||||
uint64 guid;
|
||||
if(!recv_data.readPackGUID(guid))
|
||||
return;
|
||||
|
||||
@@ -173,8 +173,6 @@ void WorldSession::HandleMoveWorldportAckOpcode()
|
||||
|
||||
void WorldSession::HandleMoveTeleportAck(WorldPacket& recv_data)
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data, 8+4+4);
|
||||
|
||||
sLog.outDebug("MSG_MOVE_TELEPORT_ACK");
|
||||
uint64 guid;
|
||||
uint32 flags, time;
|
||||
@@ -372,8 +370,6 @@ void WorldSession::HandleForceSpeedChangeAck(WorldPacket &recv_data)
|
||||
{
|
||||
//sLog.outDebug("WORLD: Recvd %s (%u, 0x%X) opcode", LookupOpcodeName(recv_data.GetOpcode()), recv_data.GetOpcode(), recv_data.GetOpcode());
|
||||
|
||||
CHECK_PACKET_SIZE(recv_data, recv_data.rpos()+8+4);
|
||||
|
||||
/* extract packet */
|
||||
uint64 guid;
|
||||
uint32 unk1;
|
||||
@@ -392,9 +388,6 @@ void WorldSession::HandleForceSpeedChangeAck(WorldPacket &recv_data)
|
||||
MovementInfo movementInfo;
|
||||
ReadMovementInfo(recv_data, &movementInfo);
|
||||
|
||||
// recheck
|
||||
CHECK_PACKET_SIZE(recv_data, recv_data.rpos()+4);
|
||||
|
||||
recv_data >> newspeed;
|
||||
/*----------------*/
|
||||
|
||||
@@ -452,8 +445,6 @@ void WorldSession::HandleSetActiveMoverOpcode(WorldPacket &recv_data)
|
||||
{
|
||||
sLog.outDebug("WORLD: Recvd CMSG_SET_ACTIVE_MOVER");
|
||||
|
||||
CHECK_PACKET_SIZE(recv_data, 8);
|
||||
|
||||
uint64 guid;
|
||||
recv_data >> guid;
|
||||
|
||||
@@ -473,8 +464,6 @@ void WorldSession::HandleMoveNotActiveMover(WorldPacket &recv_data)
|
||||
{
|
||||
sLog.outDebug("WORLD: Recvd CMSG_MOVE_NOT_ACTIVE_MOVER");
|
||||
|
||||
CHECK_PACKET_SIZE(recv_data, recv_data.rpos()+8);
|
||||
|
||||
uint64 old_mover_guid;
|
||||
recv_data >> old_mover_guid;
|
||||
|
||||
@@ -522,12 +511,10 @@ void WorldSession::HandleChangeSeatsOnControlledVehicle(WorldPacket &recv_data)
|
||||
else if(recv_data.GetOpcode() == CMSG_CHANGE_SEATS_ON_CONTROLLED_VEHICLE)
|
||||
ReadMovementInfo(recv_data, &GetPlayer()->m_Vehicle->m_movementInfo);
|
||||
|
||||
CHECK_PACKET_SIZE(recv_data, recv_data.rpos()+1);
|
||||
uint64 guid;
|
||||
if(!recv_data.readPackGUID(guid))
|
||||
return;
|
||||
|
||||
CHECK_PACKET_SIZE(recv_data, recv_data.rpos()+1);
|
||||
int8 seatId;
|
||||
recv_data >> seatId;
|
||||
|
||||
@@ -559,7 +546,6 @@ void WorldSession::HandleMountSpecialAnimOpcode(WorldPacket& /*recvdata*/)
|
||||
|
||||
void WorldSession::HandleMoveKnockBackAck( WorldPacket & /*recv_data*/ )
|
||||
{
|
||||
// CHECK_PACKET_SIZE(recv_data,?);
|
||||
sLog.outDebug("CMSG_MOVE_KNOCK_BACK_ACK");
|
||||
// Currently not used but maybe use later for recheck final player position
|
||||
// (must be at call same as into "recv_data >> x >> y >> z >> orientation;"
|
||||
@@ -599,8 +585,6 @@ void WorldSession::HandleMoveWaterWalkAck(WorldPacket& /*recv_data*/)
|
||||
|
||||
void WorldSession::HandleSummonResponseOpcode(WorldPacket& recv_data)
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data, 8+1);
|
||||
|
||||
if(!_player->isAlive() || _player->isInCombat() )
|
||||
return;
|
||||
|
||||
|
||||
@@ -40,8 +40,6 @@
|
||||
|
||||
void WorldSession::HandleTabardVendorActivateOpcode( WorldPacket & recv_data )
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data,8);
|
||||
|
||||
uint64 guid;
|
||||
recv_data >> guid;
|
||||
|
||||
@@ -68,8 +66,6 @@ void WorldSession::SendTabardVendorActivate( uint64 guid )
|
||||
|
||||
void WorldSession::HandleBankerActivateOpcode( WorldPacket & recv_data )
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data,8);
|
||||
|
||||
uint64 guid;
|
||||
|
||||
sLog.outDebug( "WORLD: Received CMSG_BANKER_ACTIVATE" );
|
||||
@@ -99,8 +95,6 @@ void WorldSession::SendShowBank( uint64 guid )
|
||||
|
||||
void WorldSession::HandleTrainerListOpcode( WorldPacket & recv_data )
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data,8);
|
||||
|
||||
uint64 guid;
|
||||
|
||||
recv_data >> guid;
|
||||
@@ -198,8 +192,6 @@ void WorldSession::SendTrainerList( uint64 guid, const std::string& strTitle )
|
||||
|
||||
void WorldSession::HandleTrainerBuySpellOpcode( WorldPacket & recv_data )
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data,8+4);
|
||||
|
||||
uint64 guid;
|
||||
uint32 spellId = 0;
|
||||
|
||||
@@ -265,8 +257,6 @@ void WorldSession::HandleTrainerBuySpellOpcode( WorldPacket & recv_data )
|
||||
|
||||
void WorldSession::HandleGossipHelloOpcode( WorldPacket & recv_data )
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data,8);
|
||||
|
||||
sLog.outDebug( "WORLD: Received CMSG_GOSSIP_HELLO" );
|
||||
|
||||
uint64 guid;
|
||||
@@ -311,8 +301,6 @@ void WorldSession::HandleGossipHelloOpcode( WorldPacket & recv_data )
|
||||
|
||||
/*void WorldSession::HandleGossipSelectOptionOpcode( WorldPacket & recv_data )
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data,8+4+4);
|
||||
|
||||
sLog.outDebug("WORLD: CMSG_GOSSIP_SELECT_OPTION");
|
||||
|
||||
uint32 option;
|
||||
@@ -324,8 +312,6 @@ void WorldSession::HandleGossipHelloOpcode( WorldPacket & recv_data )
|
||||
|
||||
if(_player->PlayerTalkClass->GossipOptionCoded( option ))
|
||||
{
|
||||
// recheck
|
||||
CHECK_PACKET_SIZE(recv_data,8+4+1);
|
||||
sLog.outDebug("reading string");
|
||||
recv_data >> code;
|
||||
sLog.outDebug("string read: %s", code.c_str());
|
||||
@@ -356,8 +342,6 @@ void WorldSession::HandleGossipHelloOpcode( WorldPacket & recv_data )
|
||||
|
||||
void WorldSession::HandleSpiritHealerActivateOpcode( WorldPacket & recv_data )
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data,8);
|
||||
|
||||
sLog.outDebug("WORLD: CMSG_SPIRIT_HEALER_ACTIVATE");
|
||||
|
||||
uint64 guid;
|
||||
@@ -417,8 +401,6 @@ void WorldSession::SendSpiritResurrect()
|
||||
|
||||
void WorldSession::HandleBinderActivateOpcode( WorldPacket & recv_data )
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data,8);
|
||||
|
||||
uint64 npcGUID;
|
||||
recv_data >> npcGUID;
|
||||
|
||||
@@ -490,8 +472,6 @@ void WorldSession::SendBindPoint(Creature *npc)
|
||||
|
||||
void WorldSession::HandleListStabledPetsOpcode( WorldPacket & recv_data )
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data,8);
|
||||
|
||||
sLog.outDebug("WORLD: Recv MSG_LIST_STABLED_PETS");
|
||||
uint64 npcGUID;
|
||||
|
||||
@@ -570,8 +550,6 @@ void WorldSession::SendStablePet(uint64 guid )
|
||||
|
||||
void WorldSession::HandleStablePet( WorldPacket & recv_data )
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data, 8);
|
||||
|
||||
sLog.outDebug("WORLD: Recv CMSG_STABLE_PET");
|
||||
uint64 npcGUID;
|
||||
|
||||
@@ -639,8 +617,6 @@ void WorldSession::HandleStablePet( WorldPacket & recv_data )
|
||||
|
||||
void WorldSession::HandleUnstablePet( WorldPacket & recv_data )
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data, 8+4);
|
||||
|
||||
sLog.outDebug("WORLD: Recv CMSG_UNSTABLE_PET.");
|
||||
uint64 npcGUID;
|
||||
uint32 petnumber;
|
||||
@@ -719,8 +695,6 @@ void WorldSession::HandleUnstablePet( WorldPacket & recv_data )
|
||||
|
||||
void WorldSession::HandleBuyStableSlot( WorldPacket & recv_data )
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data, 8);
|
||||
|
||||
sLog.outDebug("WORLD: Recv CMSG_BUY_STABLE_SLOT.");
|
||||
uint64 npcGUID;
|
||||
|
||||
@@ -764,8 +738,6 @@ void WorldSession::HandleStableRevivePet( WorldPacket &/* recv_data */)
|
||||
|
||||
void WorldSession::HandleStableSwapPet( WorldPacket & recv_data )
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data, 8+4);
|
||||
|
||||
sLog.outDebug("WORLD: Recv CMSG_STABLE_SWAP_PET.");
|
||||
uint64 npcGUID;
|
||||
uint32 pet_number;
|
||||
@@ -837,8 +809,6 @@ void WorldSession::HandleStableSwapPet( WorldPacket & recv_data )
|
||||
|
||||
void WorldSession::HandleRepairItemOpcode( WorldPacket & recv_data )
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data, 8+8+1);
|
||||
|
||||
sLog.outDebug("WORLD: CMSG_REPAIR_ITEM");
|
||||
|
||||
uint64 npcGUID, itemGUID;
|
||||
|
||||
@@ -34,8 +34,6 @@
|
||||
|
||||
void WorldSession::HandlePetAction( WorldPacket & recv_data )
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data, 8+2+2+8);
|
||||
|
||||
uint64 guid1;
|
||||
uint32 data;
|
||||
uint64 guid2;
|
||||
@@ -306,8 +304,6 @@ void WorldSession::HandlePetActionHelper(Unit *pet, uint64 guid1, uint16 spellid
|
||||
|
||||
void WorldSession::HandlePetNameQuery( WorldPacket & recv_data )
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data,4+8);
|
||||
|
||||
sLog.outDetail( "HandlePetNameQuery. CMSG_PET_NAME_QUERY" );
|
||||
|
||||
uint32 petnumber;
|
||||
@@ -346,8 +342,6 @@ void WorldSession::SendPetNameQuery( uint64 petguid, uint32 petnumber)
|
||||
|
||||
void WorldSession::HandlePetSetAction( WorldPacket & recv_data )
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data, 8+4+2+2);
|
||||
|
||||
sLog.outDetail( "HandlePetSetAction. CMSG_PET_SET_ACTION" );
|
||||
|
||||
uint64 petguid;
|
||||
@@ -416,8 +410,6 @@ void WorldSession::HandlePetSetAction( WorldPacket & recv_data )
|
||||
|
||||
void WorldSession::HandlePetRename( WorldPacket & recv_data )
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data, 8+1);
|
||||
|
||||
sLog.outDetail( "HandlePetRename. CMSG_PET_RENAME" );
|
||||
|
||||
uint64 petguid;
|
||||
@@ -428,7 +420,6 @@ void WorldSession::HandlePetRename( WorldPacket & recv_data )
|
||||
|
||||
recv_data >> petguid;
|
||||
recv_data >> name;
|
||||
CHECK_PACKET_SIZE(recv_data, recv_data.rpos() + 1);
|
||||
recv_data >> isdeclined;
|
||||
|
||||
Pet* pet = ObjectAccessor::GetPet(petguid);
|
||||
@@ -463,7 +454,6 @@ void WorldSession::HandlePetRename( WorldPacket & recv_data )
|
||||
{
|
||||
for(uint8 i = 0; i < MAX_DECLINED_NAME_CASES; ++i)
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data, recv_data.rpos() + 1);
|
||||
recv_data >> declinedname.name[i];
|
||||
}
|
||||
|
||||
@@ -495,8 +485,6 @@ void WorldSession::HandlePetRename( WorldPacket & recv_data )
|
||||
|
||||
void WorldSession::HandlePetAbandon( WorldPacket & recv_data )
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data, 8);
|
||||
|
||||
uint64 guid;
|
||||
recv_data >> guid; //pet guid
|
||||
sLog.outDetail( "HandlePetAbandon. CMSG_PET_ABANDON pet guid is %u", GUID_LOPART(guid) );
|
||||
@@ -525,8 +513,6 @@ void WorldSession::HandlePetAbandon( WorldPacket & recv_data )
|
||||
|
||||
void WorldSession::HandlePetUnlearnOpcode(WorldPacket& recvPacket)
|
||||
{
|
||||
CHECK_PACKET_SIZE(recvPacket,8);
|
||||
|
||||
sLog.outDetail("CMSG_PET_UNLEARN");
|
||||
uint64 guid;
|
||||
recvPacket >> guid; // Pet guid
|
||||
@@ -554,8 +540,6 @@ void WorldSession::HandlePetUnlearnOpcode(WorldPacket& recvPacket)
|
||||
|
||||
void WorldSession::HandlePetSpellAutocastOpcode( WorldPacket& recvPacket )
|
||||
{
|
||||
CHECK_PACKET_SIZE(recvPacket,8+2+2+1);
|
||||
|
||||
sLog.outDetail("CMSG_PET_SPELL_AUTOCAST");
|
||||
uint64 guid;
|
||||
uint32 spellid;
|
||||
@@ -599,7 +583,6 @@ void WorldSession::HandlePetCastSpellOpcode( WorldPacket& recvPacket )
|
||||
{
|
||||
sLog.outDetail("WORLD: CMSG_PET_CAST_SPELL");
|
||||
|
||||
CHECK_PACKET_SIZE(recvPacket,8+1+4+1);
|
||||
uint64 guid;
|
||||
uint32 spellid;
|
||||
uint8 cast_count;
|
||||
@@ -709,8 +692,6 @@ void WorldSession::HandlePetLearnTalent( WorldPacket & recv_data )
|
||||
{
|
||||
sLog.outDebug("WORLD: CMSG_PET_LEARN_TALENT");
|
||||
|
||||
CHECK_PACKET_SIZE(recv_data, 8+4+4);
|
||||
|
||||
uint64 guid;
|
||||
uint32 talent_id, requested_rank;
|
||||
recv_data >> guid >> talent_id >> requested_rank;
|
||||
@@ -723,8 +704,6 @@ void WorldSession::HandleLearnPreviewTalentsPet( WorldPacket & recv_data )
|
||||
{
|
||||
sLog.outDebug("CMSG_LEARN_PREVIEW_TALENTS_PET");
|
||||
|
||||
CHECK_PACKET_SIZE(recv_data, 8+4);
|
||||
|
||||
uint64 guid;
|
||||
recv_data >> guid;
|
||||
|
||||
@@ -735,8 +714,6 @@ void WorldSession::HandleLearnPreviewTalentsPet( WorldPacket & recv_data )
|
||||
|
||||
for(uint32 i = 0; i < talentsCount; ++i)
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data, recv_data.rpos()+4+4);
|
||||
|
||||
recv_data >> talentId >> talentRank;
|
||||
|
||||
_player->LearnPetTalent(guid, talentId, talentRank);
|
||||
|
||||
@@ -49,8 +49,6 @@
|
||||
|
||||
void WorldSession::HandlePetitionBuyOpcode(WorldPacket & recv_data)
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data, 8+8+4+1+5*8+2+1+4+4);
|
||||
|
||||
sLog.outDebug("Received opcode CMSG_PETITION_BUY");
|
||||
//recv_data.hexlike();
|
||||
|
||||
@@ -67,9 +65,6 @@ void WorldSession::HandlePetitionBuyOpcode(WorldPacket & recv_data)
|
||||
recv_data >> unk2; // 0
|
||||
recv_data >> name; // name
|
||||
|
||||
// recheck
|
||||
CHECK_PACKET_SIZE(recv_data, 8+8+4+(name.size()+1)+5*8+2+1+4+4);
|
||||
|
||||
recv_data >> unk3; // 0
|
||||
recv_data >> unk4; // 0
|
||||
recv_data >> unk5; // 0
|
||||
@@ -238,8 +233,6 @@ void WorldSession::HandlePetitionBuyOpcode(WorldPacket & recv_data)
|
||||
|
||||
void WorldSession::HandlePetitionShowSignOpcode(WorldPacket & recv_data)
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data, 8);
|
||||
|
||||
// ok
|
||||
sLog.outDebug("Received opcode CMSG_PETITION_SHOW_SIGNATURES");
|
||||
//recv_data.hexlike();
|
||||
@@ -295,8 +288,6 @@ void WorldSession::HandlePetitionShowSignOpcode(WorldPacket & recv_data)
|
||||
|
||||
void WorldSession::HandlePetitionQueryOpcode(WorldPacket & recv_data)
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data, 4+8);
|
||||
|
||||
sLog.outDebug("Received opcode CMSG_PETITION_QUERY"); // ok
|
||||
//recv_data.hexlike();
|
||||
|
||||
@@ -372,8 +363,6 @@ void WorldSession::SendPetitionQueryOpcode(uint64 petitionguid)
|
||||
|
||||
void WorldSession::HandlePetitionRenameOpcode(WorldPacket & recv_data)
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data, 8+1);
|
||||
|
||||
sLog.outDebug("Received opcode MSG_PETITION_RENAME"); // ok
|
||||
//recv_data.hexlike();
|
||||
|
||||
@@ -443,8 +432,6 @@ void WorldSession::HandlePetitionRenameOpcode(WorldPacket & recv_data)
|
||||
|
||||
void WorldSession::HandlePetitionSignOpcode(WorldPacket & recv_data)
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data, 8+1);
|
||||
|
||||
sLog.outDebug("Received opcode CMSG_PETITION_SIGN"); // ok
|
||||
//recv_data.hexlike();
|
||||
|
||||
@@ -573,8 +560,6 @@ void WorldSession::HandlePetitionSignOpcode(WorldPacket & recv_data)
|
||||
|
||||
void WorldSession::HandlePetitionDeclineOpcode(WorldPacket & recv_data)
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data, 8);
|
||||
|
||||
sLog.outDebug("Received opcode MSG_PETITION_DECLINE"); // ok
|
||||
//recv_data.hexlike();
|
||||
|
||||
@@ -602,8 +587,6 @@ void WorldSession::HandlePetitionDeclineOpcode(WorldPacket & recv_data)
|
||||
|
||||
void WorldSession::HandleOfferPetitionOpcode(WorldPacket & recv_data)
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data, 4+8+8);
|
||||
|
||||
sLog.outDebug("Received opcode CMSG_OFFER_PETITION"); // ok
|
||||
//recv_data.hexlike();
|
||||
|
||||
@@ -707,8 +690,6 @@ void WorldSession::HandleOfferPetitionOpcode(WorldPacket & recv_data)
|
||||
|
||||
void WorldSession::HandleTurnInPetitionOpcode(WorldPacket & recv_data)
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data, 8);
|
||||
|
||||
sLog.outDebug("Received opcode CMSG_TURN_IN_PETITION"); // ok
|
||||
//recv_data.hexlike();
|
||||
|
||||
@@ -855,7 +836,6 @@ void WorldSession::HandleTurnInPetitionOpcode(WorldPacket & recv_data)
|
||||
return;
|
||||
}
|
||||
|
||||
CHECK_PACKET_SIZE(recv_data, 8+5*4);
|
||||
uint32 icon, iconcolor, border, bordercolor, backgroud;
|
||||
recv_data >> backgroud >> icon >> iconcolor >> border >> bordercolor;
|
||||
|
||||
@@ -893,8 +873,6 @@ void WorldSession::HandleTurnInPetitionOpcode(WorldPacket & recv_data)
|
||||
|
||||
void WorldSession::HandlePetitionShowListOpcode(WorldPacket & recv_data)
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data, 8);
|
||||
|
||||
sLog.outDebug("Received CMSG_PETITION_SHOWLIST"); // ok
|
||||
//recv_data.hexlike();
|
||||
|
||||
|
||||
@@ -129,8 +129,6 @@ void WorldSession::SendNameQueryOpcodeFromDBCallBack(QueryResult *result, uint32
|
||||
|
||||
void WorldSession::HandleNameQueryOpcode( WorldPacket & recv_data )
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data, 8);
|
||||
|
||||
uint64 guid;
|
||||
|
||||
recv_data >> guid;
|
||||
@@ -154,8 +152,6 @@ void WorldSession::HandleQueryTimeOpcode( WorldPacket & /*recv_data*/ )
|
||||
/// Only _static_ data send in this packet !!!
|
||||
void WorldSession::HandleCreatureQueryOpcode( WorldPacket & recv_data )
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data,4+8);
|
||||
|
||||
uint32 entry;
|
||||
recv_data >> entry;
|
||||
|
||||
@@ -223,8 +219,6 @@ void WorldSession::HandleCreatureQueryOpcode( WorldPacket & recv_data )
|
||||
/// Only _static_ data send in this packet !!!
|
||||
void WorldSession::HandleGameObjectQueryOpcode( WorldPacket & recv_data )
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data,4+8);
|
||||
|
||||
uint32 entryID;
|
||||
recv_data >> entryID;
|
||||
|
||||
@@ -335,8 +329,6 @@ void WorldSession::HandleCorpseQueryOpcode(WorldPacket & /*recv_data*/)
|
||||
|
||||
void WorldSession::HandleNpcTextQueryOpcode( WorldPacket & recv_data )
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data, 4 + 8);
|
||||
|
||||
uint32 textID;
|
||||
uint64 guid;
|
||||
|
||||
@@ -423,8 +415,6 @@ void WorldSession::HandleNpcTextQueryOpcode( WorldPacket & recv_data )
|
||||
|
||||
void WorldSession::HandlePageTextQueryOpcode( WorldPacket & recv_data )
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data, 4);
|
||||
|
||||
uint32 pageID;
|
||||
|
||||
recv_data >> pageID;
|
||||
|
||||
@@ -36,8 +36,6 @@
|
||||
|
||||
void WorldSession::HandleQuestgiverStatusQueryOpcode( WorldPacket & recv_data )
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data,8);
|
||||
|
||||
uint64 guid;
|
||||
recv_data >> guid;
|
||||
uint8 questStatus = DIALOG_STATUS_NONE;
|
||||
@@ -84,8 +82,6 @@ void WorldSession::HandleQuestgiverStatusQueryOpcode( WorldPacket & recv_data )
|
||||
|
||||
void WorldSession::HandleQuestgiverHelloOpcode( WorldPacket & recv_data )
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data,8);
|
||||
|
||||
uint64 guid;
|
||||
recv_data >> guid;
|
||||
|
||||
@@ -114,8 +110,6 @@ void WorldSession::HandleQuestgiverHelloOpcode( WorldPacket & recv_data )
|
||||
|
||||
void WorldSession::HandleQuestgiverAcceptQuestOpcode( WorldPacket & recv_data )
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data, 8+4+4);
|
||||
|
||||
uint64 guid;
|
||||
uint32 quest;
|
||||
uint32 unk1;
|
||||
@@ -211,8 +205,6 @@ void WorldSession::HandleQuestgiverAcceptQuestOpcode( WorldPacket & recv_data )
|
||||
|
||||
void WorldSession::HandleQuestgiverQueryQuestOpcode( WorldPacket & recv_data )
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data, 8+4+1);
|
||||
|
||||
uint64 guid;
|
||||
uint32 quest;
|
||||
uint8 unk1;
|
||||
@@ -236,8 +228,6 @@ void WorldSession::HandleQuestgiverQueryQuestOpcode( WorldPacket & recv_data )
|
||||
|
||||
void WorldSession::HandleQuestQueryOpcode( WorldPacket & recv_data )
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data, 4);
|
||||
|
||||
uint32 quest;
|
||||
recv_data >> quest;
|
||||
sLog.outDebug( "WORLD: Received CMSG_QUEST_QUERY quest = %u",quest );
|
||||
@@ -251,8 +241,6 @@ void WorldSession::HandleQuestQueryOpcode( WorldPacket & recv_data )
|
||||
|
||||
void WorldSession::HandleQuestgiverChooseRewardOpcode( WorldPacket & recv_data )
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data,8+4+4);
|
||||
|
||||
uint32 quest, reward;
|
||||
uint64 guid;
|
||||
recv_data >> guid >> quest >> reward;
|
||||
@@ -309,8 +297,6 @@ void WorldSession::HandleQuestgiverChooseRewardOpcode( WorldPacket & recv_data )
|
||||
|
||||
void WorldSession::HandleQuestgiverRequestRewardOpcode( WorldPacket & recv_data )
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data,8+4);
|
||||
|
||||
uint32 quest;
|
||||
uint64 guid;
|
||||
recv_data >> guid >> quest;
|
||||
@@ -343,8 +329,6 @@ void WorldSession::HandleQuestgiverCancel(WorldPacket& /*recv_data*/ )
|
||||
|
||||
void WorldSession::HandleQuestLogSwapQuest(WorldPacket& recv_data )
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data,1+1);
|
||||
|
||||
uint8 slot1, slot2;
|
||||
recv_data >> slot1 >> slot2;
|
||||
|
||||
@@ -358,8 +342,6 @@ void WorldSession::HandleQuestLogSwapQuest(WorldPacket& recv_data )
|
||||
|
||||
void WorldSession::HandleQuestLogRemoveQuest(WorldPacket& recv_data)
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data,1);
|
||||
|
||||
uint8 slot;
|
||||
recv_data >> slot;
|
||||
|
||||
@@ -383,8 +365,6 @@ void WorldSession::HandleQuestLogRemoveQuest(WorldPacket& recv_data)
|
||||
|
||||
void WorldSession::HandleQuestConfirmAccept(WorldPacket& recv_data)
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data,4);
|
||||
|
||||
uint32 quest;
|
||||
recv_data >> quest;
|
||||
|
||||
@@ -393,8 +373,6 @@ void WorldSession::HandleQuestConfirmAccept(WorldPacket& recv_data)
|
||||
|
||||
void WorldSession::HandleQuestgiverCompleteQuest(WorldPacket& recv_data)
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data,8+4);
|
||||
|
||||
uint32 quest;
|
||||
uint64 guid;
|
||||
recv_data >> guid >> quest;
|
||||
@@ -437,8 +415,6 @@ void WorldSession::HandleQuestgiverQuestAutoLaunch(WorldPacket& /*recvPacket*/)
|
||||
|
||||
void WorldSession::HandlePushQuestToParty(WorldPacket& recvPacket)
|
||||
{
|
||||
CHECK_PACKET_SIZE(recvPacket,4);
|
||||
|
||||
uint32 questId;
|
||||
recvPacket >> questId;
|
||||
|
||||
@@ -496,8 +472,6 @@ void WorldSession::HandlePushQuestToParty(WorldPacket& recvPacket)
|
||||
|
||||
void WorldSession::HandleQuestPushResult(WorldPacket& recvPacket)
|
||||
{
|
||||
CHECK_PACKET_SIZE(recvPacket,8+1);
|
||||
|
||||
uint64 guid;
|
||||
uint8 msg;
|
||||
recvPacket >> guid >> msg;
|
||||
|
||||
@@ -30,8 +30,6 @@
|
||||
|
||||
void WorldSession::HandleLearnTalentOpcode( WorldPacket & recv_data )
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data,4+4);
|
||||
|
||||
uint32 talent_id, requested_rank;
|
||||
recv_data >> talent_id >> requested_rank;
|
||||
|
||||
@@ -43,8 +41,6 @@ void WorldSession::HandleLearnPreviewTalents(WorldPacket& recvPacket)
|
||||
{
|
||||
sLog.outDebug("CMSG_LEARN_PREVIEW_TALENTS");
|
||||
|
||||
CHECK_PACKET_SIZE(recvPacket, 4);
|
||||
|
||||
uint32 talentsCount;
|
||||
recvPacket >> talentsCount;
|
||||
|
||||
@@ -52,8 +48,6 @@ void WorldSession::HandleLearnPreviewTalents(WorldPacket& recvPacket)
|
||||
|
||||
for(uint32 i = 0; i < talentsCount; ++i)
|
||||
{
|
||||
CHECK_PACKET_SIZE(recvPacket, recvPacket.rpos()+4+4);
|
||||
|
||||
recvPacket >> talentId >> talentRank;
|
||||
|
||||
_player->LearnTalent(talentId, talentRank);
|
||||
@@ -64,8 +58,6 @@ void WorldSession::HandleLearnPreviewTalents(WorldPacket& recvPacket)
|
||||
|
||||
void WorldSession::HandleTalentWipeConfirmOpcode( WorldPacket & recv_data )
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data,8);
|
||||
|
||||
sLog.outDetail("MSG_TALENT_WIPE_CONFIRM");
|
||||
uint64 guid;
|
||||
recv_data >> guid;
|
||||
@@ -96,8 +88,6 @@ void WorldSession::HandleTalentWipeConfirmOpcode( WorldPacket & recv_data )
|
||||
|
||||
void WorldSession::HandleUnlearnSkillOpcode(WorldPacket & recv_data)
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data,4);
|
||||
|
||||
uint32 skill_id;
|
||||
recv_data >> skill_id;
|
||||
GetPlayer()->SetSkill(skill_id, 0, 0);
|
||||
|
||||
@@ -35,8 +35,6 @@
|
||||
void WorldSession::HandleUseItemOpcode(WorldPacket& recvPacket)
|
||||
{
|
||||
// TODO: add targets.read() check
|
||||
CHECK_PACKET_SIZE(recvPacket,1+1+1+4+8+4+1);
|
||||
|
||||
Player* pUser = _player;
|
||||
|
||||
// ignore for remote control state
|
||||
@@ -162,8 +160,6 @@ void WorldSession::HandleUseItemOpcode(WorldPacket& recvPacket)
|
||||
|
||||
void WorldSession::HandleOpenItemOpcode(WorldPacket& recvPacket)
|
||||
{
|
||||
CHECK_PACKET_SIZE(recvPacket,1+1);
|
||||
|
||||
sLog.outDetail("WORLD: CMSG_OPEN_ITEM packet, data length = %i",(uint32)recvPacket.size());
|
||||
|
||||
Player* pUser = _player;
|
||||
@@ -242,8 +238,6 @@ void WorldSession::HandleOpenItemOpcode(WorldPacket& recvPacket)
|
||||
|
||||
void WorldSession::HandleGameObjectUseOpcode( WorldPacket & recv_data )
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data, 8);
|
||||
|
||||
uint64 guid;
|
||||
|
||||
recv_data >> guid;
|
||||
@@ -267,8 +261,6 @@ void WorldSession::HandleGameObjectUseOpcode( WorldPacket & recv_data )
|
||||
|
||||
void WorldSession::HandleGameobjectReportUse(WorldPacket& recvPacket)
|
||||
{
|
||||
CHECK_PACKET_SIZE(recvPacket,8);
|
||||
|
||||
uint64 guid;
|
||||
recvPacket >> guid;
|
||||
|
||||
@@ -290,8 +282,6 @@ void WorldSession::HandleGameobjectReportUse(WorldPacket& recvPacket)
|
||||
|
||||
void WorldSession::HandleCastSpellOpcode(WorldPacket& recvPacket)
|
||||
{
|
||||
CHECK_PACKET_SIZE(recvPacket,1+4+1);
|
||||
|
||||
uint32 spellId;
|
||||
uint8 cast_count, unk_flags;
|
||||
recvPacket >> cast_count;
|
||||
@@ -365,8 +355,6 @@ void WorldSession::HandleCastSpellOpcode(WorldPacket& recvPacket)
|
||||
|
||||
void WorldSession::HandleCancelCastOpcode(WorldPacket& recvPacket)
|
||||
{
|
||||
CHECK_PACKET_SIZE(recvPacket,5);
|
||||
|
||||
// increments with every CANCEL packet, don't use for now
|
||||
uint8 counter;
|
||||
uint32 spellId;
|
||||
@@ -379,8 +367,6 @@ void WorldSession::HandleCancelCastOpcode(WorldPacket& recvPacket)
|
||||
|
||||
void WorldSession::HandleCancelAuraOpcode( WorldPacket& recvPacket)
|
||||
{
|
||||
CHECK_PACKET_SIZE(recvPacket,4);
|
||||
|
||||
uint32 spellId;
|
||||
recvPacket >> spellId;
|
||||
|
||||
@@ -408,8 +394,6 @@ void WorldSession::HandleCancelAuraOpcode( WorldPacket& recvPacket)
|
||||
|
||||
void WorldSession::HandlePetCancelAuraOpcode( WorldPacket& recvPacket)
|
||||
{
|
||||
CHECK_PACKET_SIZE(recvPacket, 8+4);
|
||||
|
||||
uint64 guid;
|
||||
uint32 spellId;
|
||||
|
||||
@@ -464,8 +448,6 @@ void WorldSession::HandleCancelAutoRepeatSpellOpcode( WorldPacket& /*recvPacket*
|
||||
void WorldSession::HandleCancelChanneling( WorldPacket & /*recv_data */)
|
||||
{
|
||||
/*
|
||||
CHECK_PACKET_SIZE(recv_data, 4);
|
||||
|
||||
uint32 spellid;
|
||||
recv_data >> spellid;
|
||||
*/
|
||||
@@ -473,8 +455,6 @@ void WorldSession::HandleCancelChanneling( WorldPacket & /*recv_data */)
|
||||
|
||||
void WorldSession::HandleTotemDestroyed( WorldPacket& recvPacket)
|
||||
{
|
||||
CHECK_PACKET_SIZE(recvPacket, 1);
|
||||
|
||||
// ignore for remote control state
|
||||
if(_player->m_mover != _player)
|
||||
return;
|
||||
@@ -512,8 +492,6 @@ void WorldSession::HandleSelfResOpcode( WorldPacket & /*recv_data*/ )
|
||||
|
||||
void WorldSession::HandleSpellClick( WorldPacket & recv_data )
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data, 8);
|
||||
|
||||
uint64 guid;
|
||||
recv_data >> guid;
|
||||
|
||||
@@ -541,7 +519,6 @@ void WorldSession::HandleSpellClick( WorldPacket & recv_data )
|
||||
void WorldSession::HandleMirrrorImageDataRequest( WorldPacket & recv_data )
|
||||
{
|
||||
sLog.outDebug("WORLD: CMSG_GET_MIRRORIMAGE_DATA");
|
||||
CHECK_PACKET_SIZE(recv_data, 8);
|
||||
uint64 guid;
|
||||
recv_data >> guid;
|
||||
|
||||
|
||||
@@ -31,12 +31,8 @@
|
||||
#include "WaypointMovementGenerator.h"
|
||||
#include "DestinationHolderImp.h"
|
||||
|
||||
#include <cassert>
|
||||
|
||||
void WorldSession::HandleTaxiNodeStatusQueryOpcode( WorldPacket & recv_data )
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data,8);
|
||||
|
||||
sLog.outDebug( "WORLD: Received CMSG_TAXINODE_STATUS_QUERY" );
|
||||
|
||||
uint64 guid;
|
||||
@@ -72,8 +68,6 @@ void WorldSession::SendTaxiStatus( uint64 guid )
|
||||
|
||||
void WorldSession::HandleTaxiQueryAvailableNodes( WorldPacket & recv_data )
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data,8);
|
||||
|
||||
sLog.outDebug( "WORLD: Received CMSG_TAXIQUERYAVAILABLENODES" );
|
||||
|
||||
uint64 guid;
|
||||
@@ -160,8 +154,6 @@ bool WorldSession::SendLearnNewTaxiNode( Creature* unit )
|
||||
|
||||
void WorldSession::HandleActivateTaxiExpressOpcode ( WorldPacket & recv_data )
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data,8+4+4);
|
||||
|
||||
sLog.outDebug( "WORLD: Received CMSG_ACTIVATETAXIEXPRESS" );
|
||||
|
||||
uint64 guid;
|
||||
@@ -175,9 +167,6 @@ void WorldSession::HandleActivateTaxiExpressOpcode ( WorldPacket & recv_data )
|
||||
sLog.outDebug( "WORLD: HandleActivateTaxiExpressOpcode - Unit (GUID: %u) not found or you can't interact with it.", uint32(GUID_LOPART(guid)) );
|
||||
return;
|
||||
}
|
||||
// recheck
|
||||
CHECK_PACKET_SIZE(recv_data,8+4+4+node_count*4);
|
||||
|
||||
std::vector<uint32> nodes;
|
||||
|
||||
for(uint32 i = 0; i < node_count; ++i)
|
||||
@@ -264,8 +253,6 @@ void WorldSession::HandleMoveSplineDoneOpcode(WorldPacket& /*recv_data*/)
|
||||
|
||||
void WorldSession::HandleActivateTaxiOpcode( WorldPacket & recv_data )
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data,8+4+4);
|
||||
|
||||
sLog.outDebug( "WORLD: Received CMSG_ACTIVATETAXI" );
|
||||
|
||||
uint64 guid;
|
||||
|
||||
@@ -27,8 +27,6 @@
|
||||
|
||||
void WorldSession::HandleGMTicketCreateOpcode( WorldPacket & recv_data )
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data, 4*4+1+2*4);
|
||||
|
||||
if(GM_Ticket *ticket = objmgr.GetGMTicketByPlayer(GetPlayer()->GetGUID()))
|
||||
{
|
||||
WorldPacket data( SMSG_GMTICKET_CREATE, 4 );
|
||||
@@ -75,7 +73,6 @@ void WorldSession::HandleGMTicketCreateOpcode( WorldPacket & recv_data )
|
||||
|
||||
void WorldSession::HandleGMTicketUpdateOpcode( WorldPacket & recv_data)
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data, 1);
|
||||
WorldPacket data(SMSG_GMTICKET_UPDATETEXT, 4);
|
||||
|
||||
std::string message;
|
||||
|
||||
@@ -459,8 +459,6 @@ void WorldSession::HandleCancelTradeOpcode(WorldPacket& /*recvPacket*/)
|
||||
|
||||
void WorldSession::HandleInitiateTradeOpcode(WorldPacket& recvPacket)
|
||||
{
|
||||
CHECK_PACKET_SIZE(recvPacket,8);
|
||||
|
||||
if (GetPlayer()->pTrader)
|
||||
return;
|
||||
|
||||
@@ -560,8 +558,6 @@ void WorldSession::HandleInitiateTradeOpcode(WorldPacket& recvPacket)
|
||||
|
||||
void WorldSession::HandleSetTradeGoldOpcode(WorldPacket& recvPacket)
|
||||
{
|
||||
CHECK_PACKET_SIZE(recvPacket,4);
|
||||
|
||||
if(!_player->pTrader)
|
||||
return;
|
||||
|
||||
@@ -577,8 +573,6 @@ void WorldSession::HandleSetTradeGoldOpcode(WorldPacket& recvPacket)
|
||||
|
||||
void WorldSession::HandleSetTradeItemOpcode(WorldPacket& recvPacket)
|
||||
{
|
||||
CHECK_PACKET_SIZE(recvPacket,1+1+1);
|
||||
|
||||
if(!_player->pTrader)
|
||||
return;
|
||||
|
||||
@@ -626,8 +620,6 @@ void WorldSession::HandleSetTradeItemOpcode(WorldPacket& recvPacket)
|
||||
|
||||
void WorldSession::HandleClearTradeItemOpcode(WorldPacket& recvPacket)
|
||||
{
|
||||
CHECK_PACKET_SIZE(recvPacket,1);
|
||||
|
||||
if(!_player->pTrader)
|
||||
return;
|
||||
|
||||
|
||||
+54
-45
@@ -179,44 +179,57 @@ bool WorldSession::Update(uint32 /*diff*/)
|
||||
else
|
||||
{
|
||||
OpcodeHandler& opHandle = opcodeTable[packet->GetOpcode()];
|
||||
switch (opHandle.status)
|
||||
try
|
||||
{
|
||||
case STATUS_LOGGEDIN:
|
||||
if(!_player)
|
||||
{
|
||||
// skip STATUS_LOGGEDIN opcode unexpected errors if player logout sometime ago - this can be network lag delayed packets
|
||||
if(!m_playerRecentlyLogout)
|
||||
logUnexpectedOpcode(packet, "the player has not logged in yet");
|
||||
}
|
||||
else if(_player->IsInWorld())
|
||||
(this->*opHandle.handler)(*packet);
|
||||
// lag can cause STATUS_LOGGEDIN opcodes to arrive after the player started a transfer
|
||||
break;
|
||||
case STATUS_TRANSFER:
|
||||
if(!_player)
|
||||
logUnexpectedOpcode(packet, "the player has not logged in yet");
|
||||
else if(_player->IsInWorld())
|
||||
logUnexpectedOpcode(packet, "the player is still in world");
|
||||
else
|
||||
(this->*opHandle.handler)(*packet);
|
||||
break;
|
||||
case STATUS_AUTHED:
|
||||
// prevent cheating with skip queue wait
|
||||
if(m_inQueue)
|
||||
{
|
||||
logUnexpectedOpcode(packet, "the player not pass queue yet");
|
||||
switch (opHandle.status)
|
||||
{
|
||||
case STATUS_LOGGEDIN:
|
||||
if(!_player)
|
||||
{
|
||||
// skip STATUS_LOGGEDIN opcode unexpected errors if player logout sometime ago - this can be network lag delayed packets
|
||||
if(!m_playerRecentlyLogout)
|
||||
logUnexpectedOpcode(packet, "the player has not logged in yet");
|
||||
}
|
||||
else if(_player->IsInWorld())
|
||||
(this->*opHandle.handler)(*packet);
|
||||
// lag can cause STATUS_LOGGEDIN opcodes to arrive after the player started a transfer
|
||||
break;
|
||||
}
|
||||
case STATUS_TRANSFER:
|
||||
if(!_player)
|
||||
logUnexpectedOpcode(packet, "the player has not logged in yet");
|
||||
else if(_player->IsInWorld())
|
||||
logUnexpectedOpcode(packet, "the player is still in world");
|
||||
else
|
||||
(this->*opHandle.handler)(*packet);
|
||||
break;
|
||||
case STATUS_AUTHED:
|
||||
// prevent cheating with skip queue wait
|
||||
if(m_inQueue)
|
||||
{
|
||||
logUnexpectedOpcode(packet, "the player not pass queue yet");
|
||||
break;
|
||||
}
|
||||
|
||||
m_playerRecentlyLogout = false;
|
||||
(this->*opHandle.handler)(*packet);
|
||||
break;
|
||||
case STATUS_NEVER:
|
||||
break;
|
||||
sLog.outError( "SESSION: received not allowed opcode %s (0x%.4X)",
|
||||
LookupOpcodeName(packet->GetOpcode()),
|
||||
packet->GetOpcode());
|
||||
break;
|
||||
m_playerRecentlyLogout = false;
|
||||
(this->*opHandle.handler)(*packet);
|
||||
break;
|
||||
case STATUS_NEVER:
|
||||
break;
|
||||
sLog.outError( "SESSION: received not allowed opcode %s (0x%.4X)",
|
||||
LookupOpcodeName(packet->GetOpcode()),
|
||||
packet->GetOpcode());
|
||||
break;
|
||||
}
|
||||
}
|
||||
catch(ByteBufferException &exception)
|
||||
{
|
||||
sLog.outError("WorldSession::Update ByteBufferException occured while parsing a packet (opcode: %u) from client %s, accountid=%i. Skipped packet.",
|
||||
packet->GetOpcode(), GetRemoteAddress().c_str(), GetAccountId());
|
||||
if(sLog.IsOutDebug())
|
||||
{
|
||||
sLog.outDebug("Dumping error causing packet:");
|
||||
packet->hexlike();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -630,7 +643,6 @@ void WorldSession::SaveTutorialsData()
|
||||
|
||||
void WorldSession::ReadMovementInfo(WorldPacket &data, MovementInfo *mi)
|
||||
{
|
||||
CHECK_PACKET_SIZE(data, data.rpos()+4+2+4+4+4+4+4);
|
||||
data >> mi->flags;
|
||||
data >> mi->unk1;
|
||||
data >> mi->time;
|
||||
@@ -644,7 +656,6 @@ void WorldSession::ReadMovementInfo(WorldPacket &data, MovementInfo *mi)
|
||||
if(!data.readPackGUID(mi->t_guid))
|
||||
return;
|
||||
|
||||
CHECK_PACKET_SIZE(data, data.rpos()+4+4+4+4+4+1);
|
||||
data >> mi->t_x;
|
||||
data >> mi->t_y;
|
||||
data >> mi->t_z;
|
||||
@@ -655,16 +666,13 @@ void WorldSession::ReadMovementInfo(WorldPacket &data, MovementInfo *mi)
|
||||
|
||||
if((mi->flags & (MOVEMENTFLAG_SWIMMING | MOVEMENTFLAG_FLYING)) || (mi->unk1 & 0x20))
|
||||
{
|
||||
CHECK_PACKET_SIZE(data, data.rpos()+4);
|
||||
data >> mi->s_pitch;
|
||||
}
|
||||
|
||||
CHECK_PACKET_SIZE(data, data.rpos()+4);
|
||||
data >> mi->fallTime;
|
||||
|
||||
if(mi->flags & MOVEMENTFLAG_JUMPING)
|
||||
{
|
||||
CHECK_PACKET_SIZE(data, data.rpos()+4+4+4+4);
|
||||
data >> mi->j_zspeed;
|
||||
data >> mi->j_sinAngle;
|
||||
data >> mi->j_cosAngle;
|
||||
@@ -673,7 +681,6 @@ void WorldSession::ReadMovementInfo(WorldPacket &data, MovementInfo *mi)
|
||||
|
||||
if(mi->flags & MOVEMENTFLAG_SPLINE)
|
||||
{
|
||||
CHECK_PACKET_SIZE(data, data.rpos()+4);
|
||||
data >> mi->u_unk1;
|
||||
}
|
||||
}
|
||||
@@ -688,6 +695,12 @@ void WorldSession::ReadAddonsInfo(WorldPacket &data)
|
||||
if(!size)
|
||||
return;
|
||||
|
||||
if(size > 0xFFFFF)
|
||||
{
|
||||
sLog.outError("WorldSession::ReadAddonsInfo addon info too big, size %u", size);
|
||||
return;
|
||||
}
|
||||
|
||||
uLongf uSize = size;
|
||||
|
||||
uint32 pos = data.rpos();
|
||||
@@ -712,10 +725,6 @@ void WorldSession::ReadAddonsInfo(WorldPacket &data)
|
||||
|
||||
addonInfo >> addonName;
|
||||
|
||||
// recheck next addon data format correctness
|
||||
if(addonInfo.rpos()+1+4+4 > addonInfo.size())
|
||||
return;
|
||||
|
||||
addonInfo >> enabled >> crc >> unk1;
|
||||
|
||||
sLog.outDebug("ADDON: Name: %s, Enabled: 0x%x, CRC: 0x%x, Unknown2: 0x%x", addonName.c_str(), enabled, crc, unk1);
|
||||
|
||||
@@ -46,8 +46,6 @@ class QueryResult;
|
||||
class LoginQueryHolder;
|
||||
class CharacterHandler;
|
||||
|
||||
#define CHECK_PACKET_SIZE(P,S) if((P).size() < (S)) return SizeError((P),(S));
|
||||
|
||||
#define NUM_ACCOUNT_DATA_TYPES 8
|
||||
|
||||
struct AccountData
|
||||
|
||||
+46
-55
@@ -617,45 +617,55 @@ int WorldSocket::ProcessIncoming (WorldPacket* new_pct)
|
||||
sWorldLog.outLog ("\n");
|
||||
}
|
||||
|
||||
// like one switch ;)
|
||||
if (opcode == CMSG_PING)
|
||||
{
|
||||
return HandlePing (*new_pct);
|
||||
}
|
||||
else if (opcode == CMSG_AUTH_SESSION)
|
||||
{
|
||||
if (m_Session)
|
||||
try {
|
||||
switch(opcode)
|
||||
{
|
||||
sLog.outError ("WorldSocket::ProcessIncoming: Player send CMSG_AUTH_SESSION again");
|
||||
return -1;
|
||||
case CMSG_PING:
|
||||
return HandlePing (*new_pct);
|
||||
case CMSG_AUTH_SESSION:
|
||||
if (m_Session)
|
||||
{
|
||||
sLog.outError ("WorldSocket::ProcessIncoming: Player send CMSG_AUTH_SESSION again");
|
||||
return -1;
|
||||
}
|
||||
|
||||
return HandleAuthSession (*new_pct);
|
||||
case CMSG_KEEP_ALIVE:
|
||||
DEBUG_LOG ("CMSG_KEEP_ALIVE ,size: %d", new_pct->size ());
|
||||
|
||||
return 0;
|
||||
default:
|
||||
{
|
||||
ACE_GUARD_RETURN (LockType, Guard, m_SessionLock, -1);
|
||||
|
||||
if (m_Session != NULL)
|
||||
{
|
||||
// OK ,give the packet to WorldSession
|
||||
aptr.release ();
|
||||
// WARNINIG here we call it with locks held.
|
||||
// Its possible to cause deadlock if QueuePacket calls back
|
||||
m_Session->QueuePacket (new_pct);
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
sLog.outError ("WorldSocket::ProcessIncoming: Client not authed opcode = %u", uint32(opcode));
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch(ByteBufferException &exception)
|
||||
{
|
||||
sLog.outError("WorldSocket::ProcessIncoming ByteBufferException occured while parsing an instant handled packet (opcode: %u) from client %s, accountid=%i. Disconnected client.",
|
||||
opcode, GetRemoteAddress().c_str(), m_Session?m_Session->GetAccountId():-1);
|
||||
if(sLog.IsOutDebug())
|
||||
{
|
||||
sLog.outDebug("Dumping error causing packet:");
|
||||
new_pct->hexlike();
|
||||
}
|
||||
|
||||
return HandleAuthSession (*new_pct);
|
||||
}
|
||||
else if (opcode == CMSG_KEEP_ALIVE)
|
||||
{
|
||||
DEBUG_LOG ("CMSG_KEEP_ALIVE ,size: %d", new_pct->size ());
|
||||
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
ACE_GUARD_RETURN (LockType, Guard, m_SessionLock, -1);
|
||||
|
||||
if (m_Session != NULL)
|
||||
{
|
||||
// OK ,give the packet to WorldSession
|
||||
aptr.release ();
|
||||
// WARNINIG here we call it with locks held.
|
||||
// Its possible to cause deadlock if QueuePacket calls back
|
||||
m_Session->QueuePacket (new_pct);
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
sLog.outError ("WorldSocket::ProcessIncoming: Client not authed opcode = %u", uint32(opcode));
|
||||
return -1;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
ACE_NOTREACHED (return 0);
|
||||
@@ -678,12 +688,6 @@ int WorldSocket::HandleAuthSession (WorldPacket& recvPacket)
|
||||
|
||||
BigNumber K;
|
||||
|
||||
if (recvPacket.size () < (4 + 4 + 1 + 4 + 4 + 20))
|
||||
{
|
||||
sLog.outError ("WorldSocket::HandleAuthSession: wrong packet size");
|
||||
return -1;
|
||||
}
|
||||
|
||||
if(sWorld.IsClosed())
|
||||
{
|
||||
packet.Initialize(SMSG_AUTH_RESPONSE, 1);
|
||||
@@ -699,13 +703,6 @@ int WorldSocket::HandleAuthSession (WorldPacket& recvPacket)
|
||||
recvPacket >> unk2;
|
||||
recvPacket >> account;
|
||||
recvPacket >> unk3;
|
||||
|
||||
if (recvPacket.size () < (4 + 4 + (account.size () + 1) + 4 + 4 + 20))
|
||||
{
|
||||
sLog.outError ("WorldSocket::HandleAuthSession: wrong packet size second check");
|
||||
return -1;
|
||||
}
|
||||
|
||||
recvPacket >> clientSeed;
|
||||
recvPacket.read (digest, 20);
|
||||
|
||||
@@ -940,12 +937,6 @@ int WorldSocket::HandlePing (WorldPacket& recvPacket)
|
||||
uint32 ping;
|
||||
uint32 latency;
|
||||
|
||||
if (recvPacket.size () < 8)
|
||||
{
|
||||
sLog.outError ("WorldSocket::_HandlePing wrong packet size");
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Get the ping packet content
|
||||
recvPacket >> ping;
|
||||
recvPacket >> latency;
|
||||
|
||||
+26
-11
@@ -26,6 +26,26 @@
|
||||
#include "Log.h"
|
||||
#include "Utilities/ByteConverter.h"
|
||||
|
||||
class ByteBufferException
|
||||
{
|
||||
public:
|
||||
ByteBufferException(bool add, size_t pos, size_t esize, size_t size):add(add), pos(pos), esize(esize), size(size)
|
||||
{
|
||||
PrintPosError();
|
||||
}
|
||||
|
||||
void PrintPosError() const
|
||||
{
|
||||
sLog.outError("ERROR: Attempted to %s in ByteBuffer (pos: %lu size: %lu) value with size: %lu",(add ? "put" : "get"),(unsigned long)pos, (unsigned long)size, (unsigned long)esize);
|
||||
|
||||
}
|
||||
private:
|
||||
bool add;
|
||||
size_t pos;
|
||||
size_t esize;
|
||||
size_t size;
|
||||
};
|
||||
|
||||
class ByteBuffer
|
||||
{
|
||||
public:
|
||||
@@ -250,7 +270,8 @@ class ByteBuffer
|
||||
|
||||
template <typename T> T read(size_t pos) const
|
||||
{
|
||||
ASSERT(pos + sizeof(T) <= size() || PrintPosError(false, pos, sizeof(T)));
|
||||
if(pos + sizeof(T) > size())
|
||||
throw ByteBufferException(false, pos, sizeof(T), size());
|
||||
T val = *((T const*)&_storage[pos]);
|
||||
EndianConvert(val);
|
||||
return val;
|
||||
@@ -258,7 +279,8 @@ class ByteBuffer
|
||||
|
||||
void read(uint8 *dest, size_t len)
|
||||
{
|
||||
ASSERT(_rpos + len <= size() || PrintPosError(false, _rpos, len));
|
||||
if(_rpos + len > size())
|
||||
throw ByteBufferException(false, _rpos, len, size());
|
||||
memcpy(dest, &_storage[_rpos], len);
|
||||
_rpos += len;
|
||||
}
|
||||
@@ -372,7 +394,8 @@ class ByteBuffer
|
||||
|
||||
void put(size_t pos, const uint8 *src, size_t cnt)
|
||||
{
|
||||
ASSERT(pos + cnt <= size() || PrintPosError(true, pos, cnt));
|
||||
if(pos + cnt > size())
|
||||
throw ByteBufferException(true, pos, cnt, size());
|
||||
memcpy(&_storage[pos], src, cnt);
|
||||
}
|
||||
|
||||
@@ -454,14 +477,6 @@ class ByteBuffer
|
||||
}
|
||||
|
||||
protected:
|
||||
bool PrintPosError(bool add, size_t pos, size_t esize) const
|
||||
{
|
||||
sLog.outError("ERROR: Attempt %s in ByteBuffer (pos: %lu size: %lu) value with size: %lu",(add ? "put" : "get"),(unsigned long)pos, (unsigned long)size(), (unsigned long)esize);
|
||||
|
||||
// assert must fail after function call
|
||||
return false;
|
||||
}
|
||||
|
||||
size_t _rpos, _wpos;
|
||||
std::vector<uint8> _storage;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user