chore(Core/Logging): replace most server loggers (#5726)

* chore(Core/Logging): replace most server loggers

Co-authored-by: Kitzunu <24550914+Kitzunu@users.noreply.github.com>
This commit is contained in:
Kargatum
2021-06-21 08:07:12 +07:00
committed by GitHub
parent 9f80a592bb
commit 5787d00d54
199 changed files with 2312 additions and 4487 deletions

View File

@@ -72,9 +72,7 @@ bool AddonHandler::BuildAddonPacket(WorldPacket* Source, WorldPacket* Target)
AddOnPacked >> enabled >> crc >> unk2;
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "ADDON: Name: %s, Enabled: 0x%x, CRC: 0x%x, Unknown2: 0x%x", addonName.c_str(), enabled, crc, unk2);
#endif
uint8 state = (enabled ? 2 : 1);
*Target << uint8(state);
@@ -127,14 +125,12 @@ bool AddonHandler::BuildAddonPacket(WorldPacket* Source, WorldPacket* Target)
uint32 count = 0;
*Target << uint32(count);
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
if (AddOnPacked.rpos() != AddOnPacked.size())
LOG_DEBUG("network", "packet under read!");
#endif
}
else
{
LOG_ERROR("server", "Addon packet uncompress error :(");
LOG_ERROR("network", "Addon packet uncompress error :(");
return false;
}
return true;

View File

@@ -17,15 +17,11 @@
void WorldSession::HandleInspectArenaTeamsOpcode(WorldPacket& recvData)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "MSG_INSPECT_ARENA_TEAMS");
#endif
ObjectGuid guid;
recvData >> guid;
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "Inspect Arena stats (%s)", guid.ToString().c_str());
#endif
if (Player* player = ObjectAccessor::FindPlayer(guid))
{
@@ -42,9 +38,7 @@ void WorldSession::HandleInspectArenaTeamsOpcode(WorldPacket& recvData)
void WorldSession::HandleArenaTeamQueryOpcode(WorldPacket& recvData)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: Received CMSG_ARENA_TEAM_QUERY");
#endif
uint32 arenaTeamId;
recvData >> arenaTeamId;
@@ -58,9 +52,7 @@ void WorldSession::HandleArenaTeamQueryOpcode(WorldPacket& recvData)
void WorldSession::HandleArenaTeamRosterOpcode(WorldPacket& recvData)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: Received CMSG_ARENA_TEAM_ROSTER");
#endif
uint32 arenaTeamId; // arena team id
recvData >> arenaTeamId;
@@ -71,9 +63,7 @@ void WorldSession::HandleArenaTeamRosterOpcode(WorldPacket& recvData)
void WorldSession::HandleArenaTeamInviteOpcode(WorldPacket& recvData)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "CMSG_ARENA_TEAM_INVITE");
#endif
uint32 arenaTeamId; // arena team id
std::string invitedName;
@@ -143,9 +133,7 @@ void WorldSession::HandleArenaTeamInviteOpcode(WorldPacket& recvData)
return;
}
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("bg.battleground", "Player %s Invited %s to Join his ArenaTeam", GetPlayer()->GetName().c_str(), invitedName.c_str());
#endif
player->SetArenaTeamIdInvited(arenaTeam->GetId());
@@ -154,16 +142,12 @@ void WorldSession::HandleArenaTeamInviteOpcode(WorldPacket& recvData)
data << arenaTeam->GetName();
player->GetSession()->SendPacket(&data);
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: Sent SMSG_ARENA_TEAM_INVITE");
#endif
}
void WorldSession::HandleArenaTeamAcceptOpcode(WorldPacket& /*recvData*/)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "CMSG_ARENA_TEAM_ACCEPT"); // empty opcode
#endif
ArenaTeam* arenaTeam = sArenaTeamMgr->GetArenaTeamById(_player->GetArenaTeamIdInvited());
if (!arenaTeam)
@@ -196,9 +180,7 @@ void WorldSession::HandleArenaTeamAcceptOpcode(WorldPacket& /*recvData*/)
void WorldSession::HandleArenaTeamDeclineOpcode(WorldPacket& /*recvData*/)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "CMSG_ARENA_TEAM_DECLINE"); // empty opcode
#endif
// Remove invite from player
_player->SetArenaTeamIdInvited(0);
@@ -206,9 +188,7 @@ void WorldSession::HandleArenaTeamDeclineOpcode(WorldPacket& /*recvData*/)
void WorldSession::HandleArenaTeamLeaveOpcode(WorldPacket& recvData)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "CMSG_ARENA_TEAM_LEAVE");
#endif
uint32 arenaTeamId;
recvData >> arenaTeamId;
@@ -265,9 +245,7 @@ void WorldSession::HandleArenaTeamLeaveOpcode(WorldPacket& recvData)
void WorldSession::HandleArenaTeamDisbandOpcode(WorldPacket& recvData)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "CMSG_ARENA_TEAM_DISBAND");
#endif
uint32 arenaTeamId;
recvData >> arenaTeamId;
@@ -299,9 +277,7 @@ void WorldSession::HandleArenaTeamDisbandOpcode(WorldPacket& recvData)
void WorldSession::HandleArenaTeamRemoveOpcode(WorldPacket& recvData)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "CMSG_ARENA_TEAM_REMOVE");
#endif
uint32 arenaTeamId;
std::string name;
@@ -366,9 +342,7 @@ void WorldSession::HandleArenaTeamRemoveOpcode(WorldPacket& recvData)
void WorldSession::HandleArenaTeamLeaderOpcode(WorldPacket& recvData)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "CMSG_ARENA_TEAM_LEADER");
#endif
uint32 arenaTeamId;
std::string name;

View File

@@ -28,9 +28,7 @@ void WorldSession::HandleAuctionHelloOpcode(WorldPacket& recvData)
Creature* unit = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_AUCTIONEER);
if (!unit)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: HandleAuctionHelloOpcode - Unit (%s) not found or you can't interact with him.", guid.ToString().c_str());
#endif
return;
}
@@ -144,10 +142,8 @@ void WorldSession::HandleAuctionSellItem(WorldPacket& recvData)
if (bid > MAX_MONEY_AMOUNT || buyout > MAX_MONEY_AMOUNT)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: HandleAuctionSellItem - Player %s (%s) attempted to sell item with higher price than max gold amount.",
_player->GetName().c_str(), _player->GetGUID().ToString().c_str());
#endif
SendAuctionCommandResult(0, AUCTION_SELL_ITEM, ERR_AUCTION_DATABASE_ERROR);
return;
}
@@ -155,18 +151,14 @@ void WorldSession::HandleAuctionSellItem(WorldPacket& recvData)
Creature* creature = GetPlayer()->GetNPCIfCanInteractWith(auctioneer, UNIT_NPC_FLAG_AUCTIONEER);
if (!creature)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: HandleAuctionSellItem - Unit (%s) not found or you can't interact with him.", auctioneer.ToString().c_str());
#endif
return;
}
AuctionHouseEntry const* auctionHouseEntry = AuctionHouseMgr::GetAuctionHouseEntry(creature->getFaction());
if (!auctionHouseEntry)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: HandleAuctionSellItem - Unit (%s) has wrong faction.", auctioneer.ToString().c_str());
#endif
return;
}
@@ -271,14 +263,14 @@ void WorldSession::HandleAuctionSellItem(WorldPacket& recvData)
CreatureData const* auctioneerData = sObjectMgr->GetCreatureData(creature->GetSpawnId());
if (!auctioneerData)
{
LOG_ERROR("server", "Data for auctioneer not found (%s)", auctioneer.ToString().c_str());
LOG_ERROR("network.opcode", "Data for auctioneer not found (%s)", auctioneer.ToString().c_str());
return;
}
CreatureTemplate const* auctioneerInfo = sObjectMgr->GetCreatureTemplate(auctioneerData->id);
if (!auctioneerInfo)
{
LOG_ERROR("server", "Non existing auctioneer (%s)", auctioneer.ToString().c_str());
LOG_ERROR("network.opcode", "Non existing auctioneer (%s)", auctioneer.ToString().c_str());
return;
}
@@ -301,10 +293,8 @@ void WorldSession::HandleAuctionSellItem(WorldPacket& recvData)
AH->deposit = deposit;
AH->auctionHouseEntry = auctionHouseEntry;
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("server", "CMSG_AUCTION_SELL_ITEM: Player %s (%s) is selling item %s entry %u (%s) with count %u with initial bid %u with buyout %u and with time %u (in sec) in auctionhouse %u",
LOG_DEBUG("network.opcode", "CMSG_AUCTION_SELL_ITEM: Player %s (%s) is selling item %s entry %u (%s) with count %u with initial bid %u with buyout %u and with time %u (in sec) in auctionhouse %u",
_player->GetName().c_str(), _player->GetGUID().ToString().c_str(), item->GetTemplate()->Name1.c_str(), item->GetEntry(), item->GetGUID().ToString().c_str(), item->GetCount(), bid, buyout, auctionTime, AH->GetHouseId());
#endif
sAuctionMgr->AddAItem(item);
auctionHouse->AddAuction(AH);
@@ -327,7 +317,7 @@ void WorldSession::HandleAuctionSellItem(WorldPacket& recvData)
Item* newItem = item->CloneItem(finalCount, _player);
if (!newItem)
{
LOG_ERROR("server", "CMSG_AUCTION_SELL_ITEM: Could not create clone of item %u", item->GetEntry());
LOG_ERROR("network.opcode", "CMSG_AUCTION_SELL_ITEM: Could not create clone of item %u", item->GetEntry());
SendAuctionCommandResult(0, AUCTION_SELL_ITEM, ERR_AUCTION_DATABASE_ERROR);
return;
}
@@ -344,10 +334,8 @@ void WorldSession::HandleAuctionSellItem(WorldPacket& recvData)
AH->deposit = deposit;
AH->auctionHouseEntry = auctionHouseEntry;
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("server", "CMSG_AUCTION_SELL_ITEM: Player %s (%s) is selling item %s entry %u (%s) with count %u with initial bid %u with buyout %u and with time %u (in sec) in auctionhouse %u",
LOG_DEBUG("network.opcode", "CMSG_AUCTION_SELL_ITEM: Player %s (%s) is selling item %s entry %u (%s) with count %u with initial bid %u with buyout %u and with time %u (in sec) in auctionhouse %u",
_player->GetName().c_str(), _player->GetGUID().ToString().c_str(), newItem->GetTemplate()->Name1.c_str(), newItem->GetEntry(), newItem->GetGUID().ToString().c_str(), newItem->GetCount(), bid, buyout, auctionTime, AH->GetHouseId());
#endif
sAuctionMgr->AddAItem(newItem);
auctionHouse->AddAuction(AH);
@@ -396,9 +384,7 @@ void WorldSession::HandleAuctionSellItem(WorldPacket& recvData)
//this function is called when client bids or buys out auction
void WorldSession::HandleAuctionPlaceBid(WorldPacket& recvData)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: Received CMSG_AUCTION_PLACE_BID");
#endif
ObjectGuid auctioneer;
uint32 auctionId;
@@ -412,9 +398,7 @@ void WorldSession::HandleAuctionPlaceBid(WorldPacket& recvData)
Creature* creature = GetPlayer()->GetNPCIfCanInteractWith(auctioneer, UNIT_NPC_FLAG_AUCTIONEER);
if (!creature)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: HandleAuctionPlaceBid - Unit (%s) not found or you can't interact with him.", auctioneer.ToString().c_str());
#endif
return;
}
@@ -526,9 +510,7 @@ void WorldSession::HandleAuctionPlaceBid(WorldPacket& recvData)
//this void is called when auction_owner cancels his auction
void WorldSession::HandleAuctionRemoveItem(WorldPacket& recvData)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: Received CMSG_AUCTION_REMOVE_ITEM");
#endif
ObjectGuid auctioneer;
uint32 auctionId;
@@ -538,9 +520,7 @@ void WorldSession::HandleAuctionRemoveItem(WorldPacket& recvData)
Creature* creature = GetPlayer()->GetNPCIfCanInteractWith(auctioneer, UNIT_NPC_FLAG_AUCTIONEER);
if (!creature)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: HandleAuctionRemoveItem - Unit (%s) not found or you can't interact with him.", auctioneer.ToString().c_str());
#endif
return;
}
@@ -576,7 +556,7 @@ void WorldSession::HandleAuctionRemoveItem(WorldPacket& recvData)
}
else
{
LOG_ERROR("server", "Auction id: %u has non-existed item (item: %s)!!!", auction->Id, auction->item_guid.ToString().c_str());
LOG_ERROR("network.opcode", "Auction id: %u has non-existed item (item: %s)!!!", auction->Id, auction->item_guid.ToString().c_str());
SendAuctionCommandResult(0, AUCTION_CANCEL, ERR_AUCTION_DATABASE_ERROR);
return;
}
@@ -585,7 +565,7 @@ void WorldSession::HandleAuctionRemoveItem(WorldPacket& recvData)
{
SendAuctionCommandResult(0, AUCTION_CANCEL, ERR_AUCTION_DATABASE_ERROR);
//this code isn't possible ... maybe there should be assert
LOG_ERROR("server", "CHEATER : %s, he tried to cancel auction (id: %u) of another player, or auction is nullptr", player->GetGUID().ToString().c_str(), auctionId);
LOG_ERROR("network.opcode", "CHEATER : %s, he tried to cancel auction (id: %u) of another player, or auction is nullptr", player->GetGUID().ToString().c_str(), auctionId);
return;
}
@@ -605,9 +585,7 @@ void WorldSession::HandleAuctionRemoveItem(WorldPacket& recvData)
//called when player lists his bids
void WorldSession::HandleAuctionListBidderItems(WorldPacket& recvData)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: Received CMSG_AUCTION_LIST_BIDDER_ITEMS");
#endif
ObjectGuid guid; //NPC guid
uint32 listfrom; //page of auctions
@@ -618,16 +596,14 @@ void WorldSession::HandleAuctionListBidderItems(WorldPacket& recvData)
recvData >> outbiddedCount;
if (recvData.size() != (16 + outbiddedCount * 4))
{
LOG_ERROR("server", "Client sent bad opcode!!! with count: %u and size : %lu (must be: %u)", outbiddedCount, (unsigned long)recvData.size(), (16 + outbiddedCount * 4));
LOG_ERROR("network.opcode", "Client sent bad opcode!!! with count: %u and size : %lu (must be: %u)", outbiddedCount, (unsigned long)recvData.size(), (16 + outbiddedCount * 4));
outbiddedCount = 0;
}
Creature* creature = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_AUCTIONEER);
if (!creature)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: HandleAuctionListBidderItems - Unit (%s) not found or you can't interact with him.", guid.ToString().c_str());
#endif
recvData.rfinish();
return;
}
@@ -688,18 +664,14 @@ void WorldSession::HandleAuctionListOwnerItems(WorldPacket& recvData)
void WorldSession::HandleAuctionListOwnerItemsEvent(ObjectGuid creatureGuid)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: Received CMSG_AUCTION_LIST_OWNER_ITEMS");
#endif
_lastAuctionListOwnerItemsMSTime = World::GetGameTimeMS(); // pussywizard
Creature* creature = GetPlayer()->GetNPCIfCanInteractWith(creatureGuid, UNIT_NPC_FLAG_AUCTIONEER);
if (!creature)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: HandleAuctionListOwnerItems - Unit (%s) not found or you can't interact with him.", creatureGuid.ToString().c_str());
#endif
return;
}
@@ -725,9 +697,7 @@ void WorldSession::HandleAuctionListOwnerItemsEvent(ObjectGuid creatureGuid)
//this void is called when player clicks on search button
void WorldSession::HandleAuctionListItems(WorldPacket& recvData)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: Received CMSG_AUCTION_LIST_ITEMS");
#endif
std::string searchedname;
uint8 levelmin, levelmax, usable;
@@ -772,9 +742,7 @@ void WorldSession::HandleAuctionListItems(WorldPacket& recvData)
void WorldSession::HandleAuctionListPendingSales(WorldPacket& recvData)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: Received CMSG_AUCTION_LIST_PENDING_SALES");
#endif
recvData.read_skip<uint64>();

View File

@@ -23,9 +23,7 @@ void WorldSession::HandleBattlemasterHelloOpcode(WorldPacket& recvData)
{
ObjectGuid guid;
recvData >> guid;
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: Recvd CMSG_BATTLEMASTER_HELLO Message from (%s)", guid.ToString().c_str());
#endif
Creature* unit = GetPlayer()->GetMap()->GetCreature(guid);
if (!unit)
@@ -263,9 +261,7 @@ void WorldSession::HandleBattlemasterJoinOpcode(WorldPacket& recvData)
void WorldSession::HandleBattlegroundPlayerPositionsOpcode(WorldPacket& /*recvData*/)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: Recvd MSG_BATTLEGROUND_PLAYER_POSITIONS Message");
#endif
Battleground* bg = _player->GetBattleground();
if (!bg) // can't be received if player not in battleground
@@ -316,9 +312,7 @@ void WorldSession::HandleBattlegroundPlayerPositionsOpcode(WorldPacket& /*recvDa
void WorldSession::HandlePVPLogDataOpcode(WorldPacket& /*recvData*/)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: Recvd MSG_PVP_LOG_DATA Message");
#endif
Battleground* bg = _player->GetBattleground();
if (!bg)
@@ -332,16 +326,12 @@ void WorldSession::HandlePVPLogDataOpcode(WorldPacket& /*recvData*/)
sBattlegroundMgr->BuildPvpLogDataPacket(&data, bg);
SendPacket(&data);
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: Sent MSG_PVP_LOG_DATA Message");
#endif
}
void WorldSession::HandleBattlefieldListOpcode(WorldPacket& recvData)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: Recvd CMSG_BATTLEFIELD_LIST Message");
#endif
uint32 bgTypeId;
recvData >> bgTypeId; // id from DBC
@@ -491,9 +481,7 @@ void WorldSession::HandleBattleFieldPortOpcode(WorldPacket& recvData)
void WorldSession::HandleBattlefieldLeaveOpcode(WorldPacket& recvData)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: Recvd CMSG_LEAVE_BATTLEFIELD Message");
#endif
recvData.read_skip<uint8>(); // unk1
recvData.read_skip<uint8>(); // unk2
@@ -803,15 +791,11 @@ void WorldSession::HandleReportPvPAFK(WorldPacket& recvData)
if (!reportedPlayer)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("bg.battleground", "WorldSession::HandleReportPvPAFK: player not found");
#endif
return;
}
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("bg.battleground", "WorldSession::HandleReportPvPAFK: %s reported %s", _player->GetName().c_str(), reportedPlayer->GetName().c_str());
#endif
reportedPlayer->ReportedAfkBy(_player);
}

View File

@@ -210,7 +210,7 @@ bool validUtf8String(WorldPacket& recvData, std::string& s, std::string action,
{
if (!utf8::is_valid(s.begin(), s.end()))
{
LOG_INFO("server", "CalendarHandler: Player (%s) attempt to %s an event with invalid name or description (packet modification)",
LOG_INFO("network.opcode", "CalendarHandler: Player (%s) attempt to %s an event with invalid name or description (packet modification)",
playerGUID.ToString().c_str(), action.c_str());
recvData.rfinish();
return false;

View File

@@ -17,9 +17,7 @@ void WorldSession::HandleJoinChannel(WorldPacket& recvPacket)
recvPacket >> channelId >> unknown1 >> unknown2 >> channelName >> password;
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("chat.system", "CMSG_JOIN_CHANNEL %s Channel: %u, unk1: %u, unk2: %u, channel: %s, password: %s", GetPlayerInfo().c_str(), channelId, unknown1, unknown2, channelName.c_str(), password.c_str());
#endif
if (channelId)
{
ChatChannelsEntry const* channel = sChatChannelsStore.LookupEntry(channelId);
@@ -55,10 +53,8 @@ void WorldSession::HandleLeaveChannel(WorldPacket& recvPacket)
std::string channelName;
recvPacket >> unk >> channelName;
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("chat.system", "CMSG_LEAVE_CHANNEL %s Channel: %s, unk1: %u",
GetPlayerInfo().c_str(), channelName.c_str(), unk);
#endif
if (channelName.empty())
return;
@@ -74,11 +70,9 @@ void WorldSession::HandleChannelList(WorldPacket& recvPacket)
std::string channelName;
recvPacket >> channelName;
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("chat.system", "%s %s Channel: %s",
recvPacket.GetOpcode() == CMSG_CHANNEL_DISPLAY_LIST ? "CMSG_CHANNEL_DISPLAY_LIST" : "CMSG_CHANNEL_LIST",
GetPlayerInfo().c_str(), channelName.c_str());
#endif
if (ChannelMgr* cMgr = ChannelMgr::forTeam(GetPlayer()->GetTeamId()))
if (Channel* channel = cMgr->GetChannel(channelName, GetPlayer()))
channel->List(GetPlayer());
@@ -89,10 +83,8 @@ void WorldSession::HandleChannelPassword(WorldPacket& recvPacket)
std::string channelName, password;
recvPacket >> channelName >> password;
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("chat.system", "CMSG_CHANNEL_PASSWORD %s Channel: %s, Password: %s",
GetPlayerInfo().c_str(), channelName.c_str(), password.c_str());
#endif
if (password.length() > MAX_CHANNEL_PASS_STR)
return;
@@ -106,10 +98,8 @@ void WorldSession::HandleChannelSetOwner(WorldPacket& recvPacket)
std::string channelName, targetName;
recvPacket >> channelName >> targetName;
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("chat.system", "CMSG_CHANNEL_SET_OWNER %s Channel: %s, Target: %s",
GetPlayerInfo().c_str(), channelName.c_str(), targetName.c_str());
#endif
if (!normalizePlayerName(targetName))
return;
@@ -123,10 +113,8 @@ void WorldSession::HandleChannelOwner(WorldPacket& recvPacket)
std::string channelName;
recvPacket >> channelName;
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("chat.system", "CMSG_CHANNEL_OWNER %s Channel: %s",
GetPlayerInfo().c_str(), channelName.c_str());
#endif
if (ChannelMgr* cMgr = ChannelMgr::forTeam(GetPlayer()->GetTeamId()))
if (Channel* channel = cMgr->GetChannel(channelName, GetPlayer()))
channel->SendWhoOwner(GetPlayer()->GetGUID());
@@ -137,10 +125,8 @@ void WorldSession::HandleChannelModerator(WorldPacket& recvPacket)
std::string channelName, targetName;
recvPacket >> channelName >> targetName;
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("chat.system", "CMSG_CHANNEL_MODERATOR %s Channel: %s, Target: %s",
GetPlayerInfo().c_str(), channelName.c_str(), targetName.c_str());
#endif
if (!normalizePlayerName(targetName))
return;
@@ -154,10 +140,8 @@ void WorldSession::HandleChannelUnmoderator(WorldPacket& recvPacket)
std::string channelName, targetName;
recvPacket >> channelName >> targetName;
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("chat.system", "CMSG_CHANNEL_UNMODERATOR %s Channel: %s, Target: %s",
GetPlayerInfo().c_str(), channelName.c_str(), targetName.c_str());
#endif
if (!normalizePlayerName(targetName))
return;
@@ -171,10 +155,8 @@ void WorldSession::HandleChannelMute(WorldPacket& recvPacket)
std::string channelName, targetName;
recvPacket >> channelName >> targetName;
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("chat.system", "CMSG_CHANNEL_MUTE %s Channel: %s, Target: %s",
GetPlayerInfo().c_str(), channelName.c_str(), targetName.c_str());
#endif
if (!normalizePlayerName(targetName))
return;
@@ -188,10 +170,8 @@ void WorldSession::HandleChannelUnmute(WorldPacket& recvPacket)
std::string channelName, targetName;
recvPacket >> channelName >> targetName;
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("chat.system", "CMSG_CHANNEL_UNMUTE %s Channel: %s, Target: %s",
GetPlayerInfo().c_str(), channelName.c_str(), targetName.c_str());
#endif
if (!normalizePlayerName(targetName))
return;
@@ -205,10 +185,8 @@ void WorldSession::HandleChannelInvite(WorldPacket& recvPacket)
std::string channelName, targetName;
recvPacket >> channelName >> targetName;
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("chat.system", "CMSG_CHANNEL_INVITE %s Channel: %s, Target: %s",
GetPlayerInfo().c_str(), channelName.c_str(), targetName.c_str());
#endif
if (!normalizePlayerName(targetName))
return;
@@ -222,10 +200,8 @@ void WorldSession::HandleChannelKick(WorldPacket& recvPacket)
std::string channelName, targetName;
recvPacket >> channelName >> targetName;
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("chat.system", "CMSG_CHANNEL_KICK %s Channel: %s, Target: %s",
GetPlayerInfo().c_str(), channelName.c_str(), targetName.c_str());
#endif
if (!normalizePlayerName(targetName))
return;
@@ -239,10 +215,8 @@ void WorldSession::HandleChannelBan(WorldPacket& recvPacket)
std::string channelName, targetName;
recvPacket >> channelName >> targetName;
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("chat.system", "CMSG_CHANNEL_BAN %s Channel: %s, Target: %s",
GetPlayerInfo().c_str(), channelName.c_str(), targetName.c_str());
#endif
if (!normalizePlayerName(targetName))
return;
@@ -256,10 +230,8 @@ void WorldSession::HandleChannelUnban(WorldPacket& recvPacket)
std::string channelName, targetName;
recvPacket >> channelName >> targetName;
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("chat.system", "CMSG_CHANNEL_UNBAN %s Channel: %s, Target: %s",
GetPlayerInfo().c_str(), channelName.c_str(), targetName.c_str());
#endif
if (!normalizePlayerName(targetName))
return;
@@ -273,10 +245,8 @@ void WorldSession::HandleChannelAnnouncements(WorldPacket& recvPacket)
std::string channelName;
recvPacket >> channelName;
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("chat.system", "CMSG_CHANNEL_ANNOUNCEMENTS %s Channel: %s",
GetPlayerInfo().c_str(), channelName.c_str());
#endif
if (ChannelMgr* cMgr = ChannelMgr::forTeam(GetPlayer()->GetTeamId()))
if (Channel* channel = cMgr->GetChannel(channelName, GetPlayer()))
channel->Announce(GetPlayer());
@@ -287,10 +257,8 @@ void WorldSession::HandleChannelModerateOpcode(WorldPacket& recvPacket)
std::string channelName;
recvPacket >> channelName;
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("chat.system", "CMSG_CHANNEL_MODERATE %s Channel: %s",
GetPlayerInfo().c_str(), channelName.c_str());
#endif
if (ChannelMgr* cMgr = ChannelMgr::forTeam(GetPlayer()->GetTeamId()))
if (Channel* chn = cMgr->GetChannel(channelName, GetPlayer()))
@@ -308,10 +276,8 @@ void WorldSession::HandleGetChannelMemberCount(WorldPacket& recvPacket)
std::string channelName;
recvPacket >> channelName;
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("chat.system", "CMSG_GET_CHANNEL_MEMBER_COUNT %s Channel: %s",
GetPlayerInfo().c_str(), channelName.c_str());
#endif
if (ChannelMgr* cMgr = ChannelMgr::forTeam(GetPlayer()->GetTeamId()))
{
if (Channel* channel = cMgr->GetChannel(channelName, GetPlayer()))

View File

@@ -213,9 +213,7 @@ void WorldSession::HandleCharEnum(PreparedQueryResult result)
do
{
ObjectGuid guid = ObjectGuid::Create<HighGuid::Player>((*result)[0].GetUInt32());
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("server", "Loading char %s from account %u.", guid.ToString().c_str(), GetAccountId());
#endif
LOG_DEBUG("network.opcode", "Loading char %s from account %u.", guid.ToString().c_str(), GetAccountId());
if (Player::BuildEnumData(result, &data))
{
_legitCharacters.insert(guid);
@@ -285,7 +283,7 @@ void WorldSession::HandleCharCreateOpcode(WorldPacket& recvData)
{
data << (uint8)CHAR_CREATE_FAILED;
SendPacket(&data);
LOG_ERROR("server", "Class (%u) not found in DBC while creating new char for account (ID: %u): wrong DBC files or cheater?", class_, GetAccountId());
LOG_ERROR("network.opcode", "Class (%u) not found in DBC while creating new char for account (ID: %u): wrong DBC files or cheater?", class_, GetAccountId());
return;
}
@@ -294,7 +292,7 @@ void WorldSession::HandleCharCreateOpcode(WorldPacket& recvData)
{
data << (uint8)CHAR_CREATE_FAILED;
SendPacket(&data);
LOG_ERROR("server", "Race (%u) not found in DBC while creating new char for account (ID: %u): wrong DBC files or cheater?", race_, GetAccountId());
LOG_ERROR("network.opcode", "Race (%u) not found in DBC while creating new char for account (ID: %u): wrong DBC files or cheater?", race_, GetAccountId());
return;
}
@@ -302,7 +300,7 @@ void WorldSession::HandleCharCreateOpcode(WorldPacket& recvData)
if (raceEntry->expansion > Expansion())
{
data << (uint8)CHAR_CREATE_EXPANSION;
LOG_ERROR("server", "Expansion %u account:[%d] tried to Create character with expansion %u race (%u)", Expansion(), GetAccountId(), raceEntry->expansion, race_);
LOG_ERROR("network.opcode", "Expansion %u account:[%d] tried to Create character with expansion %u race (%u)", Expansion(), GetAccountId(), raceEntry->expansion, race_);
SendPacket(&data);
return;
}
@@ -311,7 +309,7 @@ void WorldSession::HandleCharCreateOpcode(WorldPacket& recvData)
if (classEntry->expansion > Expansion())
{
data << (uint8)CHAR_CREATE_EXPANSION_CLASS;
LOG_ERROR("server", "Expansion %u account:[%d] tried to Create character with expansion %u class (%u)", Expansion(), GetAccountId(), classEntry->expansion, class_);
LOG_ERROR("network.opcode", "Expansion %u account:[%d] tried to Create character with expansion %u class (%u)", Expansion(), GetAccountId(), classEntry->expansion, class_);
SendPacket(&data);
return;
}
@@ -340,7 +338,7 @@ void WorldSession::HandleCharCreateOpcode(WorldPacket& recvData)
{
data << (uint8)CHAR_NAME_NO_NAME;
SendPacket(&data);
LOG_ERROR("server", "Account:[%d] but tried to Create character with empty [name] ", GetAccountId());
LOG_ERROR("network.opcode", "Account:[%d] but tried to Create character with empty [name] ", GetAccountId());
return;
}
@@ -602,9 +600,7 @@ void WorldSession::HandleCharCreateCallback(PreparedQueryResult result, Characte
{
uint8 unk;
createInfo->Data >> unk;
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "Character creation %s (account %u) has unhandled tail data: [%u]", createInfo->Name.c_str(), GetAccountId(), unk);
#endif
}
// pussywizard:
@@ -662,9 +658,7 @@ void WorldSession::HandleCharCreateCallback(PreparedQueryResult result, Characte
SendPacket(&data);
std::string IP_str = GetRemoteAddress();
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("server", "Account: %d (IP: %s) Create Character:[%s] (%s)", GetAccountId(), IP_str.c_str(), createInfo->Name.c_str(), newChar.GetGUID().ToString().c_str());
#endif
LOG_DEBUG("network.opcode", "Account: %d (IP: %s) Create Character:[%s] (%s)", GetAccountId(), IP_str.c_str(), createInfo->Name.c_str(), newChar.GetGUID().ToString().c_str());
LOG_INFO("entities.player", "Account: %d (IP: %s) Create Character:[%s] (%s)", GetAccountId(), IP_str.c_str(), createInfo->Name.c_str(), newChar.GetGUID().ToString().c_str());
sScriptMgr->OnPlayerCreate(&newChar);
sWorld->AddGlobalPlayerData(newChar.GetGUID().GetCounter(), GetAccountId(), newChar.GetName(), newChar.getGender(), newChar.getRace(), newChar.getClass(), newChar.getLevel(), 0, 0);
@@ -732,9 +726,7 @@ void WorldSession::HandleCharDeleteOpcode(WorldPacket& recvData)
}
std::string IP_str = GetRemoteAddress();
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("server", "Account: %d (IP: %s) Delete Character:[%s] (%s)", GetAccountId(), IP_str.c_str(), name.c_str(), guid.ToString().c_str());
#endif
LOG_DEBUG("network.opcode", "Account: %d (IP: %s) Delete Character:[%s] (%s)", GetAccountId(), IP_str.c_str(), name.c_str(), guid.ToString().c_str());
LOG_INFO("entities.player", "Account: %d (IP: %s) Delete Character:[%s] (%s)", GetAccountId(), IP_str.c_str(), name.c_str(), guid.ToString().c_str());
// To prevent hook failure, place hook before removing reference from DB
@@ -761,7 +753,7 @@ void WorldSession::HandlePlayerLoginOpcode(WorldPacket& recvData)
{
if (PlayerLoading() || GetPlayer() != nullptr)
{
LOG_ERROR("server", "Player tries to login again, AccountId = %d", GetAccountId());
LOG_ERROR("network.opcode", "Player tries to login again, AccountId = %d", GetAccountId());
KickPlayer("Player tries to login again");
return;
}
@@ -771,7 +763,7 @@ void WorldSession::HandlePlayerLoginOpcode(WorldPacket& recvData)
if (!playerGuid.IsPlayer() || !IsLegitCharacterForAccount(playerGuid))
{
LOG_ERROR("server", "Account (%u) can't login with that character (%s).", GetAccountId(), playerGuid.ToString().c_str());
LOG_ERROR("network.opcode", "Account (%u) can't login with that character (%s).", GetAccountId(), playerGuid.ToString().c_str());
KickPlayer("Account can't login with this character");
return;
}
@@ -922,9 +914,7 @@ void WorldSession::HandlePlayerLoginFromDB(LoginQueryHolder* holder)
if (sWorld->getIntConfig(CONFIG_ENABLE_SINFO_LOGIN) == 1)
chH.PSendSysMessage("%s", GitRevision::GetFullVersion());
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("server", "WORLD: Sent server info");
#endif
LOG_DEBUG("network.opcode", "WORLD: Sent server info");
}
if (uint32 guildId = Player::GetGuildIdFromStorage(pCurrChar->GetGUID().GetCounter()))
@@ -939,7 +929,7 @@ void WorldSession::HandlePlayerLoginFromDB(LoginQueryHolder* holder)
}
else
{
LOG_ERROR("server", "Player %s (%s) marked as member of not existing guild (id: %u), removing guild membership for player.",
LOG_ERROR("network.opcode", "Player %s (%s) marked as member of not existing guild (id: %u), removing guild membership for player.",
pCurrChar->GetName().c_str(), pCurrChar->GetGUID().ToString().c_str(), guildId);
pCurrChar->SetInGuild(0);
pCurrChar->SetRank(0);
@@ -1231,9 +1221,7 @@ void WorldSession::HandlePlayerLoginToCharInWorld(Player* pCurrChar)
if (sWorld->getIntConfig(CONFIG_ENABLE_SINFO_LOGIN) == 1)
chH.PSendSysMessage("%s", GitRevision::GetFullVersion());
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("server", "WORLD: Sent server info");
#endif
LOG_DEBUG("network.opcode", "WORLD: Sent server info");
}
data.Initialize(SMSG_LEARNED_DANCE_MOVES, 4 + 4);
@@ -1332,9 +1320,7 @@ void WorldSession::HandlePlayerLoginToCharOutOfWorld(Player* /*pCurrChar*/)
void WorldSession::HandleSetFactionAtWar(WorldPacket& recvData)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("server", "WORLD: Received CMSG_SET_FACTION_ATWAR");
#endif
LOG_DEBUG("network.opcode", "WORLD: Received CMSG_SET_FACTION_ATWAR");
uint32 repListID;
uint8 flag;
@@ -1348,7 +1334,7 @@ void WorldSession::HandleSetFactionAtWar(WorldPacket& recvData)
//I think this function is never used :/ I dunno, but i guess this opcode not exists
void WorldSession::HandleSetFactionCheat(WorldPacket& /*recvData*/)
{
LOG_ERROR("server", "WORLD SESSION: HandleSetFactionCheat, not expected call, please report.");
LOG_ERROR("network.opcode", "WORLD SESSION: HandleSetFactionCheat, not expected call, please report.");
GetPlayer()->GetReputationMgr().SendStates();
}
@@ -1382,9 +1368,7 @@ void WorldSession::HandleTutorialReset(WorldPacket& /*recvData*/)
void WorldSession::HandleSetWatchedFactionOpcode(WorldPacket& recvData)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("server", "WORLD: Received CMSG_SET_WATCHED_FACTION");
#endif
LOG_DEBUG("network.opcode", "WORLD: Received CMSG_SET_WATCHED_FACTION");
uint32 fact;
recvData >> fact;
GetPlayer()->SetUInt32Value(PLAYER_FIELD_WATCHED_FACTION_INDEX, fact);
@@ -1392,9 +1376,7 @@ void WorldSession::HandleSetWatchedFactionOpcode(WorldPacket& recvData)
void WorldSession::HandleSetFactionInactiveOpcode(WorldPacket& recvData)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("server", "WORLD: Received CMSG_SET_FACTION_INACTIVE");
#endif
LOG_DEBUG("network.opcode", "WORLD: Received CMSG_SET_FACTION_INACTIVE");
uint32 replistid;
uint8 inactive;
recvData >> replistid >> inactive;
@@ -1404,18 +1386,14 @@ void WorldSession::HandleSetFactionInactiveOpcode(WorldPacket& recvData)
void WorldSession::HandleShowingHelmOpcode(WorldPacket& recvData)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("server", "CMSG_SHOWING_HELM for %s", _player->GetName().c_str());
#endif
LOG_DEBUG("network.opcode", "CMSG_SHOWING_HELM for %s", _player->GetName().c_str());
recvData.read_skip<uint8>(); // unknown, bool?
_player->ToggleFlag(PLAYER_FLAGS, PLAYER_FLAGS_HIDE_HELM);
}
void WorldSession::HandleShowingCloakOpcode(WorldPacket& recvData)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("server", "CMSG_SHOWING_CLOAK for %s", _player->GetName().c_str());
#endif
LOG_DEBUG("network.opcode", "CMSG_SHOWING_CLOAK for %s", _player->GetName().c_str());
recvData.read_skip<uint8>(); // unknown, bool?
_player->ToggleFlag(PLAYER_FLAGS, PLAYER_FLAGS_HIDE_CLOAK);
}
@@ -1633,9 +1611,7 @@ void WorldSession::HandleSetPlayerDeclinedNames(WorldPacket& recvData)
void WorldSession::HandleAlterAppearance(WorldPacket& recvData)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "CMSG_ALTER_APPEARANCE");
#endif
uint32 Hair, Color, FacialHair, SkinColor;
recvData >> Hair >> Color >> FacialHair >> SkinColor;
@@ -1712,9 +1688,7 @@ void WorldSession::HandleRemoveGlyph(WorldPacket& recvData)
if (slot >= MAX_GLYPH_SLOT_INDEX)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "Client sent wrong glyph slot number in opcode CMSG_REMOVE_GLYPH %u", slot);
#endif
return;
}
@@ -1737,7 +1711,7 @@ void WorldSession::HandleCharCustomize(WorldPacket& recvData)
recvData >> guid;
if (!IsLegitCharacterForAccount(guid))
{
LOG_ERROR("server", "Account %u, IP: %s tried to customise character %s, but it does not belong to their account!",
LOG_ERROR("network.opcode", "Account %u, IP: %s tried to customise character %s, but it does not belong to their account!",
GetAccountId(), GetRemoteAddress().c_str(), guid.ToString().c_str());
recvData.rfinish();
KickPlayer("HandleCharCustomize");
@@ -1875,9 +1849,7 @@ void WorldSession::HandleCharCustomize(WorldPacket& recvData)
void WorldSession::HandleEquipmentSetSave(WorldPacket& recvData)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "CMSG_EQUIPMENT_SET_SAVE");
#endif
uint64 setGuid;
recvData.readPackGUID(setGuid);
@@ -1936,9 +1908,7 @@ void WorldSession::HandleEquipmentSetSave(WorldPacket& recvData)
void WorldSession::HandleEquipmentSetDelete(WorldPacket& recvData)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "CMSG_EQUIPMENT_SET_DELETE");
#endif
uint64 setGuid;
recvData.readPackGUID(setGuid);
@@ -1948,9 +1918,7 @@ void WorldSession::HandleEquipmentSetDelete(WorldPacket& recvData)
void WorldSession::HandleEquipmentSetUse(WorldPacket& recvData)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "CMSG_EQUIPMENT_SET_USE");
#endif
for (uint32 i = 0; i < EQUIPMENT_SLOT_END; ++i)
{
@@ -1960,9 +1928,7 @@ void WorldSession::HandleEquipmentSetUse(WorldPacket& recvData)
uint8 srcbag, srcslot;
recvData >> srcbag >> srcslot;
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("entities.player.items", "Item %s: srcbag %u, srcslot %u", itemGuid.ToString().c_str(), srcbag, srcslot);
#endif
// check if item slot is set to "ignored" (raw value == 1), must not be unequipped then
if (itemGuid.GetRawValue() == 1)
@@ -2043,7 +2009,7 @@ void WorldSession::HandleCharFactionOrRaceChange(WorldPacket& recvData)
if (!IsLegitCharacterForAccount(guid))
{
LOG_ERROR("server", "Account %u, IP: %s tried to factionchange character %s, but it does not belong to their account!",
LOG_ERROR("network.opcode", "Account %u, IP: %s tried to factionchange character %s, but it does not belong to their account!",
GetAccountId(), GetRemoteAddress().c_str(), guid.ToString().c_str());
recvData.rfinish();
KickPlayer("HandleCharFactionOrRaceChange");

View File

@@ -57,7 +57,7 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData)
if (type >= MAX_CHAT_MSG_TYPE)
{
LOG_ERROR("server", "CHAT: Wrong message type received: %u", type);
LOG_ERROR("network.opcode", "CHAT: Wrong message type received: %u", type);
recvData.rfinish();
return;
}
@@ -298,7 +298,7 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData)
{
if (sWorld->getIntConfig(CONFIG_CHAT_STRICT_LINK_CHECKING_SEVERITY) && !ChatHandler(this).isValidChatMessage(msg.c_str()))
{
//LOG_ERROR("server", "Player %s (%s) sent a chatmessage with an invalid link: %s", GetPlayer()->GetName().c_str(),
//LOG_ERROR("network.opcode", "Player %s (%s) sent a chatmessage with an invalid link: %s", GetPlayer()->GetName().c_str(),
// GetPlayer()->GetGUID().ToString().c_str(), msg.c_str());
if (sWorld->getIntConfig(CONFIG_CHAT_STRICT_LINK_CHECKING_KICK))
@@ -668,7 +668,7 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData)
break;
}
default:
LOG_ERROR("server", "CHAT: unknown message type %u, lang: %u", type, lang);
LOG_ERROR("network.opcode", "CHAT: unknown message type %u, lang: %u", type, lang);
break;
}
}
@@ -813,9 +813,7 @@ void WorldSession::HandleChannelDeclineInvite(WorldPacket& recvPacket)
// used only with EXTRA_LOGS
(void)recvPacket;
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "Opcode %u", recvPacket.GetOpcode());
#endif
}
void WorldSession::SendPlayerNotFoundNotice(std::string const& name)

View File

@@ -19,9 +19,7 @@ void WorldSession::HandleAttackSwingOpcode(WorldPacket& recvData)
ObjectGuid guid;
recvData >> guid;
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: Recvd CMSG_ATTACKSWING: %s", guid.ToString().c_str());
#endif
Unit* pEnemy = ObjectAccessor::GetUnit(*_player, guid);
@@ -68,7 +66,7 @@ void WorldSession::HandleSetSheathedOpcode(WorldPacket& recvData)
if (sheathed >= MAX_SHEATH_STATE)
{
LOG_ERROR("server", "Unknown sheath state %u ??", sheathed);
LOG_ERROR("network.opcode", "Unknown sheath state %u ??", sheathed);
return;
}

View File

@@ -27,10 +27,8 @@ void WorldSession::HandleDuelAcceptedOpcode(WorldPacket& recvPacket)
if (player == player->duel->initiator || !plTarget || player == plTarget || player->duel->startTime != 0 || plTarget->duel->startTime != 0)
return;
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("server", "Player 1 is: %s (%s)", player->GetGUID().ToString().c_str(), player->GetName().c_str());
LOG_DEBUG("server", "Player 2 is: %s (%s)", plTarget->GetGUID().ToString().c_str(), plTarget->GetName().c_str());
#endif
LOG_DEBUG("network.opcode", "Player 1 is: %s (%s)", player->GetGUID().ToString().c_str(), player->GetName().c_str());
LOG_DEBUG("network.opcode", "Player 2 is: %s (%s)", plTarget->GetGUID().ToString().c_str(), plTarget->GetName().c_str());
time_t now = time(nullptr);
player->duel->startTimer = now;
@@ -42,9 +40,7 @@ void WorldSession::HandleDuelAcceptedOpcode(WorldPacket& recvPacket)
void WorldSession::HandleDuelCancelledOpcode(WorldPacket& recvPacket)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: Received CMSG_DUEL_CANCELLED");
#endif
ObjectGuid guid;
recvPacket >> guid;

View File

@@ -48,9 +48,7 @@ void WorldSession::SendPartyResult(PartyOperation operation, const std::string&
void WorldSession::HandleGroupInviteOpcode(WorldPacket& recvData)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: Received CMSG_GROUP_INVITE");
#endif
std::string membername;
recvData >> membername;
@@ -208,9 +206,7 @@ void WorldSession::HandleGroupInviteOpcode(WorldPacket& recvData)
void WorldSession::HandleGroupAcceptOpcode(WorldPacket& recvData)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: Received CMSG_GROUP_ACCEPT");
#endif
recvData.read_skip<uint32>();
Group* group = GetPlayer()->GetGroupInvite();
@@ -232,7 +228,7 @@ void WorldSession::HandleGroupAcceptOpcode(WorldPacket& recvData)
if (group->GetLeaderGUID() == GetPlayer()->GetGUID())
{
LOG_ERROR("server", "HandleGroupAcceptOpcode: player %s (%s) tried to accept an invite to his own group",
LOG_ERROR("network.opcode", "HandleGroupAcceptOpcode: player %s (%s) tried to accept an invite to his own group",
GetPlayer()->GetName().c_str(), GetPlayer()->GetGUID().ToString().c_str());
return;
}
@@ -272,9 +268,7 @@ void WorldSession::HandleGroupAcceptOpcode(WorldPacket& recvData)
void WorldSession::HandleGroupDeclineOpcode(WorldPacket& /*recvData*/)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: Received CMSG_GROUP_DECLINE");
#endif
Group* group = GetPlayer()->GetGroupInvite();
if (!group)
@@ -297,9 +291,7 @@ void WorldSession::HandleGroupDeclineOpcode(WorldPacket& /*recvData*/)
void WorldSession::HandleGroupUninviteGuidOpcode(WorldPacket& recvData)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: Received CMSG_GROUP_UNINVITE_GUID");
#endif
ObjectGuid guid;
std::string reason, name;
@@ -309,7 +301,7 @@ void WorldSession::HandleGroupUninviteGuidOpcode(WorldPacket& recvData)
//can't uninvite yourself
if (guid == GetPlayer()->GetGUID())
{
LOG_ERROR("server", "WorldSession::HandleGroupUninviteGuidOpcode: leader %s (%s) tried to uninvite himself from the group.",
LOG_ERROR("network.opcode", "WorldSession::HandleGroupUninviteGuidOpcode: leader %s (%s) tried to uninvite himself from the group.",
GetPlayer()->GetName().c_str(), GetPlayer()->GetGUID().ToString().c_str());
return;
}
@@ -358,9 +350,7 @@ void WorldSession::HandleGroupUninviteGuidOpcode(WorldPacket& recvData)
void WorldSession::HandleGroupUninviteOpcode(WorldPacket& recvData)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: Received CMSG_GROUP_UNINVITE");
#endif
std::string membername;
recvData >> membername;
@@ -372,7 +362,7 @@ void WorldSession::HandleGroupUninviteOpcode(WorldPacket& recvData)
// can't uninvite yourself
if (GetPlayer()->GetName() == membername)
{
LOG_ERROR("server", "WorldSession::HandleGroupUninviteOpcode: leader %s (%s) tried to uninvite himself from the group.",
LOG_ERROR("network.opcode", "WorldSession::HandleGroupUninviteOpcode: leader %s (%s) tried to uninvite himself from the group.",
GetPlayer()->GetName().c_str(), GetPlayer()->GetGUID().ToString().c_str());
return;
}
@@ -405,9 +395,7 @@ void WorldSession::HandleGroupUninviteOpcode(WorldPacket& recvData)
void WorldSession::HandleGroupSetLeaderOpcode(WorldPacket& recvData)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: Received CMSG_GROUP_SET_LEADER");
#endif
ObjectGuid guid;
recvData >> guid;
@@ -428,9 +416,7 @@ void WorldSession::HandleGroupSetLeaderOpcode(WorldPacket& recvData)
void WorldSession::HandleGroupDisbandOpcode(WorldPacket& /*recvData*/)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: Received CMSG_GROUP_DISBAND");
#endif
Group* grp = GetPlayer()->GetGroup();
if (!grp)
@@ -453,9 +439,7 @@ void WorldSession::HandleGroupDisbandOpcode(WorldPacket& /*recvData*/)
void WorldSession::HandleLootMethodOpcode(WorldPacket& recvData)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: Received CMSG_LOOT_METHOD");
#endif
uint32 lootMethod;
ObjectGuid lootMaster;
@@ -516,9 +500,7 @@ void WorldSession::HandleLootRoll(WorldPacket& recvData)
void WorldSession::HandleMinimapPingOpcode(WorldPacket& recvData)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: Received MSG_MINIMAP_PING");
#endif
if (!GetPlayer()->GetGroup())
return;
@@ -540,9 +522,7 @@ void WorldSession::HandleMinimapPingOpcode(WorldPacket& recvData)
void WorldSession::HandleRandomRollOpcode(WorldPacket& recvData)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: Received MSG_RANDOM_ROLL");
#endif
uint32 minimum, maximum, roll;
recvData >> minimum;
@@ -569,9 +549,7 @@ void WorldSession::HandleRandomRollOpcode(WorldPacket& recvData)
void WorldSession::HandleRaidTargetUpdateOpcode(WorldPacket& recvData)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: Received MSG_RAID_TARGET_UPDATE");
#endif
Group* group = GetPlayer()->GetGroup();
if (!group)
@@ -610,9 +588,7 @@ void WorldSession::HandleRaidTargetUpdateOpcode(WorldPacket& recvData)
void WorldSession::HandleGroupRaidConvertOpcode(WorldPacket& /*recvData*/)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: Received CMSG_GROUP_RAID_CONVERT");
#endif
Group* group = GetPlayer()->GetGroup();
if (!group)
@@ -633,9 +609,7 @@ void WorldSession::HandleGroupRaidConvertOpcode(WorldPacket& /*recvData*/)
void WorldSession::HandleGroupChangeSubGroupOpcode(WorldPacket& recvData)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: Received CMSG_GROUP_CHANGE_SUB_GROUP");
#endif
// we will get correct pointer for group here, so we don't have to check if group is BG raid
Group* group = GetPlayer()->GetGroup();
@@ -674,9 +648,7 @@ void WorldSession::HandleGroupChangeSubGroupOpcode(WorldPacket& recvData)
void WorldSession::HandleGroupAssistantLeaderOpcode(WorldPacket& recvData)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: Received CMSG_GROUP_ASSISTANT_LEADER");
#endif
Group* group = GetPlayer()->GetGroup();
if (!group)
@@ -697,9 +669,7 @@ void WorldSession::HandleGroupAssistantLeaderOpcode(WorldPacket& recvData)
void WorldSession::HandlePartyAssignmentOpcode(WorldPacket& recvData)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: Received MSG_PARTY_ASSIGNMENT");
#endif
Group* group = GetPlayer()->GetGroup();
if (!group)
@@ -733,9 +703,7 @@ void WorldSession::HandlePartyAssignmentOpcode(WorldPacket& recvData)
void WorldSession::HandleRaidReadyCheckOpcode(WorldPacket& recvData)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: Received MSG_RAID_READY_CHECK");
#endif
Group* group = GetPlayer()->GetGroup();
if (!group)
@@ -1120,9 +1088,7 @@ void WorldSession::HandleRequestRaidInfoOpcode(WorldPacket& /*recvData*/)
void WorldSession::HandleOptOutOfLootOpcode(WorldPacket& recvData)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: Received CMSG_OPT_OUT_OF_LOOT");
#endif
uint32 passOnLoot;
recvData >> passOnLoot; // 1 always pass, 0 do not pass

View File

@@ -25,9 +25,7 @@ void WorldSession::HandleGuildQueryOpcode(WorldPacket& recvPacket)
uint32 guildId;
recvPacket >> guildId;
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("guild", "CMSG_GUILD_QUERY [%s]: Guild: %u", GetPlayerInfo().c_str(), guildId);
#endif
if (!guildId)
return;
@@ -40,7 +38,7 @@ void WorldSession::HandleGuildCreateOpcode(WorldPacket& recvPacket)
std::string name;
recvPacket >> name;
LOG_ERROR("server", "CMSG_GUILD_CREATE: Possible hacking-attempt: %s tried to create a guild [Name: %s] using cheats", GetPlayerInfo().c_str(), name.c_str());
LOG_ERROR("network.opcode", "CMSG_GUILD_CREATE: Possible hacking-attempt: %s tried to create a guild [Name: %s] using cheats", GetPlayerInfo().c_str(), name.c_str());
}
void WorldSession::HandleGuildInviteOpcode(WorldPacket& recvPacket)
@@ -48,9 +46,7 @@ void WorldSession::HandleGuildInviteOpcode(WorldPacket& recvPacket)
std::string invitedName;
recvPacket >> invitedName;
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("guild", "CMSG_GUILD_INVITE [%s]: Invited: %s", GetPlayerInfo().c_str(), invitedName.c_str());
#endif
if (normalizePlayerName(invitedName))
if (Guild* guild = GetPlayer()->GetGuild())
guild->HandleInviteMember(this, invitedName);
@@ -61,9 +57,7 @@ void WorldSession::HandleGuildRemoveOpcode(WorldPacket& recvPacket)
std::string playerName;
recvPacket >> playerName;
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("guild", "CMSG_GUILD_REMOVE [%s]: Target: %s", GetPlayerInfo().c_str(), playerName.c_str());
#endif
if (normalizePlayerName(playerName))
if (Guild* guild = GetPlayer()->GetGuild())
@@ -72,9 +66,7 @@ void WorldSession::HandleGuildRemoveOpcode(WorldPacket& recvPacket)
void WorldSession::HandleGuildAcceptOpcode(WorldPacket& /*recvPacket*/)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("guild", "CMSG_GUILD_ACCEPT [%s]", GetPlayer()->GetName().c_str());
#endif
if (!GetPlayer()->GetGuildId())
if (Guild* guild = sGuildMgr->GetGuildById(GetPlayer()->GetGuildIdInvited()))
@@ -83,9 +75,7 @@ void WorldSession::HandleGuildAcceptOpcode(WorldPacket& /*recvPacket*/)
void WorldSession::HandleGuildDeclineOpcode(WorldPacket& /*recvPacket*/)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("guild", "CMSG_GUILD_DECLINE [%s]", GetPlayerInfo().c_str());
#endif
GetPlayer()->SetGuildIdInvited(0);
GetPlayer()->SetInGuild(0);
@@ -93,9 +83,7 @@ void WorldSession::HandleGuildDeclineOpcode(WorldPacket& /*recvPacket*/)
void WorldSession::HandleGuildInfoOpcode(WorldPacket& /*recvPacket*/)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("guild", "CMSG_GUILD_INFO [%s]", GetPlayerInfo().c_str());
#endif
if (Guild* guild = GetPlayer()->GetGuild())
guild->SendInfo(this);
@@ -103,9 +91,7 @@ void WorldSession::HandleGuildInfoOpcode(WorldPacket& /*recvPacket*/)
void WorldSession::HandleGuildRosterOpcode(WorldPacket& /*recvPacket*/)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("guild", "CMSG_GUILD_ROSTER [%s]", GetPlayerInfo().c_str());
#endif
if (Guild* guild = GetPlayer()->GetGuild())
guild->HandleRoster(this);
@@ -118,9 +104,7 @@ void WorldSession::HandleGuildPromoteOpcode(WorldPacket& recvPacket)
std::string playerName;
recvPacket >> playerName;
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("guild", "CMSG_GUILD_PROMOTE [%s]: Target: %s", GetPlayerInfo().c_str(), playerName.c_str());
#endif
if (normalizePlayerName(playerName))
if (Guild* guild = GetPlayer()->GetGuild())
@@ -132,9 +116,7 @@ void WorldSession::HandleGuildDemoteOpcode(WorldPacket& recvPacket)
std::string playerName;
recvPacket >> playerName;
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("guild", "CMSG_GUILD_DEMOTE [%s]: Target: %s", GetPlayerInfo().c_str(), playerName.c_str());
#endif
if (normalizePlayerName(playerName))
if (Guild* guild = GetPlayer()->GetGuild())
@@ -143,9 +125,7 @@ void WorldSession::HandleGuildDemoteOpcode(WorldPacket& recvPacket)
void WorldSession::HandleGuildLeaveOpcode(WorldPacket& /*recvPacket*/)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("guild", "CMSG_GUILD_LEAVE [%s]", GetPlayerInfo().c_str());
#endif
if (Guild* guild = GetPlayer()->GetGuild())
guild->HandleLeaveMember(this);
@@ -153,9 +133,7 @@ void WorldSession::HandleGuildLeaveOpcode(WorldPacket& /*recvPacket*/)
void WorldSession::HandleGuildDisbandOpcode(WorldPacket& /*recvPacket*/)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("guild", "CMSG_GUILD_DISBAND [%s]", GetPlayerInfo().c_str());
#endif
if (Guild* guild = GetPlayer()->GetGuild())
guild->HandleDisband(this);
@@ -166,9 +144,7 @@ void WorldSession::HandleGuildLeaderOpcode(WorldPacket& recvPacket)
std::string name;
recvPacket >> name;
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("guild", "CMSG_GUILD_LEADER [%s]: Target: %s", GetPlayerInfo().c_str(), name.c_str());
#endif
if (normalizePlayerName(name))
if (Guild* guild = GetPlayer()->GetGuild())
@@ -180,9 +156,7 @@ void WorldSession::HandleGuildMOTDOpcode(WorldPacket& recvPacket)
std::string motd;
recvPacket >> motd;
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("guild", "CMSG_GUILD_MOTD [%s]: MOTD: %s", GetPlayerInfo().c_str(), motd.c_str());
#endif
// Check for overflow
if (motd.length() > 128)
@@ -201,9 +175,7 @@ void WorldSession::HandleGuildSetPublicNoteOpcode(WorldPacket& recvPacket)
std::string note;
recvPacket >> playerName >> note;
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("guild", "CMSG_GUILD_SET_PUBLIC_NOTE [%s]: Target: %s, Note: %s", GetPlayerInfo().c_str(), playerName.c_str(), note.c_str());
#endif
// Check for overflow
if (note.length() > 31)
@@ -223,10 +195,8 @@ void WorldSession::HandleGuildSetOfficerNoteOpcode(WorldPacket& recvPacket)
std::string note;
recvPacket >> playerName >> note;
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("guild", "CMSG_GUILD_SET_OFFICER_NOTE [%s]: Target: %s, Note: %s",
GetPlayerInfo().c_str(), playerName.c_str(), note.c_str());
#endif
// Check for overflow
if (note.length() > 31)
@@ -254,9 +224,7 @@ void WorldSession::HandleGuildRankOpcode(WorldPacket& recvPacket)
uint32 money;
recvPacket >> money;
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("guild", "CMSG_GUILD_RANK [%s]: Rank: %s (%u)", GetPlayerInfo().c_str(), rankName.c_str(), rankId);
#endif
Guild* guild = GetPlayer()->GetGuild();
if (!guild)
@@ -293,9 +261,7 @@ void WorldSession::HandleGuildAddRankOpcode(WorldPacket& recvPacket)
std::string rankName;
recvPacket >> rankName;
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("guild", "CMSG_GUILD_ADD_RANK [%s]: Rank: %s", GetPlayerInfo().c_str(), rankName.c_str());
#endif
// Check for overflow
if (rankName.length() > 15)
@@ -310,9 +276,7 @@ void WorldSession::HandleGuildAddRankOpcode(WorldPacket& recvPacket)
void WorldSession::HandleGuildDelRankOpcode(WorldPacket& /*recvPacket*/)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("guild", "CMSG_GUILD_DEL_RANK [%s]", GetPlayerInfo().c_str());
#endif
if (Guild* guild = GetPlayer()->GetGuild())
guild->HandleRemoveLowestRank(this);
@@ -323,9 +287,7 @@ void WorldSession::HandleGuildChangeInfoTextOpcode(WorldPacket& recvPacket)
std::string info;
recvPacket >> info;
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("guild", "CMSG_GUILD_INFO_TEXT [%s]: %s", GetPlayerInfo().c_str(), info.c_str());
#endif
// Check for overflow
if (info.length() > 500)
@@ -346,12 +308,10 @@ void WorldSession::HandleSaveGuildEmblemOpcode(WorldPacket& recvPacket)
EmblemInfo emblemInfo;
emblemInfo.ReadPacket(recvPacket);
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("guild", "MSG_SAVE_GUILD_EMBLEM [%s]: Guid: [%s] Style: %d, Color: %d, BorderStyle: %d, BorderColor: %d, BackgroundColor: %d"
, GetPlayerInfo().c_str(), vendorGuid.ToString().c_str(), emblemInfo.GetStyle()
, emblemInfo.GetColor(), emblemInfo.GetBorderStyle()
, emblemInfo.GetBorderColor(), emblemInfo.GetBackgroundColor());
#endif
if (GetPlayer()->GetNPCIfCanInteractWith(vendorGuid, UNIT_NPC_FLAG_TABARDDESIGNER))
{
// Remove fake death
@@ -369,9 +329,7 @@ void WorldSession::HandleSaveGuildEmblemOpcode(WorldPacket& recvPacket)
void WorldSession::HandleGuildEventLogQueryOpcode(WorldPacket& /* recvPacket */)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("guild", "MSG_GUILD_EVENT_LOG_QUERY [%s]", GetPlayerInfo().c_str());
#endif
if (Guild* guild = GetPlayer()->GetGuild())
guild->SendEventLog(this);
@@ -379,9 +337,7 @@ void WorldSession::HandleGuildEventLogQueryOpcode(WorldPacket& /* recvPacket */)
void WorldSession::HandleGuildBankMoneyWithdrawn(WorldPacket& /* recvData */)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("guild", "MSG_GUILD_BANK_MONEY_WITHDRAWN [%s]", GetPlayerInfo().c_str());
#endif
if (Guild* guild = GetPlayer()->GetGuild())
guild->SendMoneyInfo(this);
@@ -389,9 +345,7 @@ void WorldSession::HandleGuildBankMoneyWithdrawn(WorldPacket& /* recvData */)
void WorldSession::HandleGuildPermissions(WorldPacket& /* recvData */)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("guild", "MSG_GUILD_PERMISSIONS [%s]", GetPlayerInfo().c_str());
#endif
if (Guild* guild = GetPlayer()->GetGuild())
guild->SendPermissions(this);
@@ -404,10 +358,8 @@ void WorldSession::HandleGuildBankerActivate(WorldPacket& recvData)
bool sendAllSlots;
recvData >> guid >> sendAllSlots;
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("guild", "CMSG_GUILD_BANKER_ACTIVATE [%s]: Go: [%s] AllSlots: %u"
, GetPlayerInfo().c_str(), guid.ToString().c_str(), sendAllSlots);
#endif
Guild* const guild = GetPlayer()->GetGuild();
if (!guild)
{
@@ -427,10 +379,8 @@ void WorldSession::HandleGuildBankQueryTab(WorldPacket& recvData)
recvData >> guid >> tabId >> full;
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("guild", "CMSG_GUILD_BANK_QUERY_TAB [%s]: Go: [%s], TabId: %u, ShowTabs: %u"
, GetPlayerInfo().c_str(), guid.ToString().c_str(), tabId, full);
#endif
if (GetPlayer()->GetGameObjectIfCanInteractWith(guid, GAMEOBJECT_TYPE_GUILD_BANK))
if (Guild* guild = GetPlayer()->GetGuild())
guild->SendBankTabData(this, tabId);
@@ -442,10 +392,8 @@ void WorldSession::HandleGuildBankDepositMoney(WorldPacket& recvData)
uint32 money;
recvData >> guid >> money;
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("guild", "CMSG_GUILD_BANK_DEPOSIT_MONEY [%s]: Go: [%s], money: %u",
GetPlayerInfo().c_str(), guid.ToString().c_str(), money);
#endif
if (GetPlayer()->GetGameObjectIfCanInteractWith(guid, GAMEOBJECT_TYPE_GUILD_BANK))
if (money && GetPlayer()->HasEnoughMoney(money))
if (Guild* guild = GetPlayer()->GetGuild())
@@ -458,10 +406,8 @@ void WorldSession::HandleGuildBankWithdrawMoney(WorldPacket& recvData)
uint32 money;
recvData >> guid >> money;
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("guild", "CMSG_GUILD_BANK_WITHDRAW_MONEY [%s]: Go: [%s], money: %u",
GetPlayerInfo().c_str(), guid.ToString().c_str(), money);
#endif
if (money && GetPlayer()->GetGameObjectIfCanInteractWith(guid, GAMEOBJECT_TYPE_GUILD_BANK))
if (Guild* guild = GetPlayer()->GetGuild())
guild->HandleMemberWithdrawMoney(this, money);
@@ -469,9 +415,7 @@ void WorldSession::HandleGuildBankWithdrawMoney(WorldPacket& recvData)
void WorldSession::HandleGuildBankSwapItems(WorldPacket& recvData)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("guild", "CMSG_GUILD_BANK_SWAP_ITEMS [%s]", GetPlayerInfo().c_str());
#endif
ObjectGuid GoGuid;
recvData >> GoGuid;
@@ -557,9 +501,7 @@ void WorldSession::HandleGuildBankBuyTab(WorldPacket& recvData)
recvData >> guid >> tabId;
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("guild", "CMSG_GUILD_BANK_BUY_TAB [%s]: Go: [%s], TabId: %u", GetPlayerInfo().c_str(), guid.ToString().c_str(), tabId);
#endif
if (GetPlayer()->GetGameObjectIfCanInteractWith(guid, GAMEOBJECT_TYPE_GUILD_BANK))
if (Guild* guild = GetPlayer()->GetGuild())
@@ -574,10 +516,8 @@ void WorldSession::HandleGuildBankUpdateTab(WorldPacket& recvData)
recvData >> guid >> tabId >> name >> icon;
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("guild", "CMSG_GUILD_BANK_UPDATE_TAB [%s]: Go: [%s], TabId: %u, Name: %s, Icon: %s"
, GetPlayerInfo().c_str(), guid.ToString().c_str(), tabId, name.c_str(), icon.c_str());
#endif
// Check for overflow
if (name.length() > 16 || icon.length() > 128)
@@ -597,9 +537,7 @@ void WorldSession::HandleGuildBankLogQuery(WorldPacket& recvData)
uint8 tabId;
recvData >> tabId;
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("guild", "MSG_GUILD_BANK_LOG_QUERY [%s]: TabId: %u", GetPlayerInfo().c_str(), tabId);
#endif
if (Guild* guild = GetPlayer()->GetGuild())
guild->SendBankLog(this, tabId);
@@ -610,9 +548,7 @@ void WorldSession::HandleQueryGuildBankTabText(WorldPacket& recvData)
uint8 tabId;
recvData >> tabId;
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("guild", "MSG_QUERY_GUILD_BANK_TEXT [%s]: TabId: %u", GetPlayerInfo().c_str(), tabId);
#endif
if (Guild* guild = GetPlayer()->GetGuild())
guild->SendBankTabText(this, tabId);
@@ -624,9 +560,7 @@ void WorldSession::HandleSetGuildBankTabText(WorldPacket& recvData)
std::string text;
recvData >> tabId >> text;
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("guild", "CMSG_SET_GUILD_BANK_TEXT [%s]: TabId: %u, Text: %s", GetPlayerInfo().c_str(), tabId, text.c_str());
#endif
// Check for overflow
if (text.length() > 500)

View File

@@ -426,9 +426,7 @@ void WorldSession::HandleItemQuerySingleOpcode(WorldPacket& recvData)
uint32 item;
recvData >> item;
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("server", "STORAGE: Item Query = %u", item);
#endif
LOG_DEBUG("network.opcode", "STORAGE: Item Query = %u", item);
ItemTemplate const* pProto = sObjectMgr->GetItemTemplate(item);
if (pProto)
@@ -574,9 +572,7 @@ void WorldSession::HandleItemQuerySingleOpcode(WorldPacket& recvData)
}
else
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: CMSG_ITEM_QUERY_SINGLE - NO item INFO! (ENTRY: %u)", item);
#endif
WorldPacket queryData(SMSG_ITEM_QUERY_SINGLE_RESPONSE, 4);
queryData << uint32(item | 0x80000000);
SendPacket(&queryData);
@@ -590,7 +586,7 @@ void WorldSession::HandleReadItem(WorldPacket& recvData)
uint8 bag, slot;
recvData >> bag >> slot;
//LOG_DEBUG("server", "STORAGE: Read bag = %u, slot = %u", bag, slot);
//LOG_DEBUG("network.opcode", "STORAGE: Read bag = %u, slot = %u", bag, slot);
Item* pItem = _player->GetItemByPos(bag, slot);
if (pItem && pItem->GetTemplate()->PageText)
@@ -601,16 +597,12 @@ void WorldSession::HandleReadItem(WorldPacket& recvData)
if (msg == EQUIP_ERR_OK)
{
data.Initialize (SMSG_READ_ITEM_OK, 8);
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("server", "STORAGE: Item page sent");
#endif
LOG_DEBUG("network.opcode", "STORAGE: Item page sent");
}
else
{
data.Initialize(SMSG_READ_ITEM_FAILED, 8);
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("server", "STORAGE: Unable to read item");
#endif
LOG_DEBUG("network.opcode", "STORAGE: Unable to read item");
_player->SendEquipError(msg, pItem, nullptr);
}
data << pItem->GetGUID();
@@ -622,9 +614,7 @@ void WorldSession::HandleReadItem(WorldPacket& recvData)
void WorldSession::HandleSellItemOpcode(WorldPacket& recvData)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: Received CMSG_SELL_ITEM");
#endif
ObjectGuid vendorguid, itemguid;
uint32 count;
@@ -636,9 +626,7 @@ void WorldSession::HandleSellItemOpcode(WorldPacket& recvData)
Creature* creature = GetPlayer()->GetNPCIfCanInteractWith(vendorguid, UNIT_NPC_FLAG_VENDOR);
if (!creature)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: HandleSellItemOpcode - Unit (%s) not found or you can not interact with him.", vendorguid.ToString().c_str());
#endif
_player->SendSellError(SELL_ERR_CANT_FIND_VENDOR, nullptr, itemguid, 0);
return;
}
@@ -714,7 +702,7 @@ void WorldSession::HandleSellItemOpcode(WorldPacket& recvData)
Item* pNewItem = pItem->CloneItem(count, _player);
if (!pNewItem)
{
LOG_ERROR("server", "WORLD: HandleSellItemOpcode - could not create clone of item %u; count = %u", pItem->GetEntry(), count);
LOG_ERROR("network.opcode", "WORLD: HandleSellItemOpcode - could not create clone of item %u; count = %u", pItem->GetEntry(), count);
_player->SendSellError(SELL_ERR_CANT_SELL_ITEM, creature, itemguid, 0);
return;
}
@@ -753,9 +741,7 @@ void WorldSession::HandleSellItemOpcode(WorldPacket& recvData)
void WorldSession::HandleBuybackItem(WorldPacket& recvData)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: Received CMSG_BUYBACK_ITEM");
#endif
ObjectGuid vendorguid;
uint32 slot;
@@ -764,9 +750,7 @@ void WorldSession::HandleBuybackItem(WorldPacket& recvData)
Creature* creature = GetPlayer()->GetNPCIfCanInteractWith(vendorguid, UNIT_NPC_FLAG_VENDOR);
if (!creature)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: HandleBuybackItem - Unit (%s) not found or you can not interact with him.", vendorguid.ToString().c_str());
#endif
_player->SendSellError(SELL_ERR_CANT_FIND_VENDOR, nullptr, ObjectGuid::Empty, 0);
return;
}
@@ -814,9 +798,7 @@ void WorldSession::HandleBuybackItem(WorldPacket& recvData)
void WorldSession::HandleBuyItemInSlotOpcode(WorldPacket& recvData)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: Received CMSG_BUY_ITEM_IN_SLOT");
#endif
ObjectGuid vendorguid, bagguid;
uint32 item, slot, count;
uint8 bagslot;
@@ -858,9 +840,7 @@ void WorldSession::HandleBuyItemInSlotOpcode(WorldPacket& recvData)
void WorldSession::HandleBuyItemOpcode(WorldPacket& recvData)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: Received CMSG_BUY_ITEM");
#endif
ObjectGuid vendorguid;
uint32 item, slot, count;
uint8 unk1;
@@ -885,25 +865,19 @@ void WorldSession::HandleListInventoryOpcode(WorldPacket& recvData)
if (!GetPlayer()->IsAlive())
return;
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: Recvd CMSG_LIST_INVENTORY");
#endif
SendListInventory(guid);
}
void WorldSession::SendListInventory(ObjectGuid vendorGuid, uint32 vendorEntry)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: Sent SMSG_LIST_INVENTORY");
#endif
Creature* vendor = GetPlayer()->GetNPCIfCanInteractWith(vendorGuid, UNIT_NPC_FLAG_VENDOR);
if (!vendor)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: SendListInventory - Unit (%s) not found or you can not interact with him.", vendorGuid.ToString().c_str());
#endif
_player->SendSellError(SELL_ERR_CANT_FIND_VENDOR, nullptr, ObjectGuid::Empty, 0);
return;
}
@@ -961,9 +935,7 @@ void WorldSession::SendListInventory(ObjectGuid vendorGuid, uint32 vendorEntry)
ConditionList conditions = sConditionMgr->GetConditionsForNpcVendorEvent(vendor->GetEntry(), item->item);
if (!sConditionMgr->IsObjectMeetToConditions(_player, vendor, conditions))
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "SendListInventory: conditions not met for creature entry %u item %u", vendor->GetEntry(), item->item);
#endif
continue;
}
@@ -1049,9 +1021,7 @@ void WorldSession::HandleAutoStoreBagItemOpcode(WorldPacket& recvData)
void WorldSession::HandleBuyBankSlotOpcode(WorldPacket& recvPacket)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: CMSG_BUY_BANK_SLOT");
#endif
ObjectGuid guid;
recvPacket >> guid;
@@ -1067,9 +1037,7 @@ void WorldSession::HandleBuyBankSlotOpcode(WorldPacket& recvPacket)
// next slot
++slot;
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("server", "PLAYER: Buy bank bag slot, slot number = %u", slot);
#endif
LOG_DEBUG("network.opcode", "PLAYER: Buy bank bag slot, slot number = %u", slot);
BankBagSlotPricesEntry const* slotEntry = sBankBagSlotPricesStore.LookupEntry(slot);
@@ -1102,15 +1070,11 @@ void WorldSession::HandleBuyBankSlotOpcode(WorldPacket& recvPacket)
void WorldSession::HandleAutoBankItemOpcode(WorldPacket& recvPacket)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: CMSG_AUTOBANK_ITEM");
#endif
uint8 srcbag, srcslot;
recvPacket >> srcbag >> srcslot;
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "STORAGE: receive srcbag = %u, srcslot = %u", srcbag, srcslot);
#endif
if (!CanUseBank())
{
@@ -1144,15 +1108,11 @@ void WorldSession::HandleAutoBankItemOpcode(WorldPacket& recvPacket)
void WorldSession::HandleAutoStoreBankItemOpcode(WorldPacket& recvPacket)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: CMSG_AUTOSTORE_BANK_ITEM");
#endif
uint8 srcbag, srcslot;
recvPacket >> srcbag >> srcslot;
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "STORAGE: receive srcbag = %u, srcslot = %u", srcbag, srcslot);
#endif
if (!CanUseBank())
{
@@ -1202,9 +1162,7 @@ void WorldSession::HandleSetAmmoOpcode(WorldPacket& recvData)
return;
}
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: CMSG_SET_AMMO");
#endif
uint32 item;
recvData >> item;
@@ -1250,9 +1208,7 @@ void WorldSession::HandleItemNameQueryOpcode(WorldPacket& recvData)
recvData >> itemid;
recvData.read_skip<uint64>(); // guid
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: CMSG_ITEM_NAME_QUERY %u", itemid);
#endif
ItemSetNameEntry const* pName = sObjectMgr->GetItemSetNameEntry(itemid);
if (pName)
{
@@ -1272,18 +1228,14 @@ void WorldSession::HandleItemNameQueryOpcode(WorldPacket& recvData)
void WorldSession::HandleWrapItemOpcode(WorldPacket& recvData)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "Received opcode CMSG_WRAP_ITEM");
#endif
uint8 gift_bag, gift_slot, item_bag, item_slot;
recvData >> gift_bag >> gift_slot; // paper
recvData >> item_bag >> item_slot; // item
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WRAP: receive gift_bag = %u, gift_slot = %u, item_bag = %u, item_slot = %u", gift_bag, gift_slot, item_bag, item_slot);
#endif
Item* gift = _player->GetItemByPos(gift_bag, gift_slot);
if (!gift)
@@ -1403,9 +1355,7 @@ void WorldSession::HandleWrapItemOpcode(WorldPacket& recvData)
void WorldSession::HandleSocketOpcode(WorldPacket& recvData)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: CMSG_SOCKET_GEMS");
#endif
ObjectGuid item_guid;
ObjectGuid gem_guids[MAX_GEM_SOCKETS];
@@ -1603,9 +1553,7 @@ void WorldSession::HandleSocketOpcode(WorldPacket& recvData)
void WorldSession::HandleCancelTempEnchantmentOpcode(WorldPacket& recvData)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: CMSG_CANCEL_TEMP_ENCHANTMENT");
#endif
uint32 eslot;
@@ -1629,9 +1577,7 @@ void WorldSession::HandleCancelTempEnchantmentOpcode(WorldPacket& recvData)
void WorldSession::HandleItemRefundInfoRequest(WorldPacket& recvData)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: CMSG_ITEM_REFUND_INFO");
#endif
ObjectGuid guid;
recvData >> guid; // item guid
@@ -1639,9 +1585,7 @@ void WorldSession::HandleItemRefundInfoRequest(WorldPacket& recvData)
Item* item = _player->GetItemByGuid(guid);
if (!item)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "Item refund: item not found!");
#endif
return;
}
@@ -1650,18 +1594,14 @@ void WorldSession::HandleItemRefundInfoRequest(WorldPacket& recvData)
void WorldSession::HandleItemRefund(WorldPacket& recvData)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: CMSG_ITEM_REFUND");
#endif
ObjectGuid guid;
recvData >> guid; // item guid
Item* item = _player->GetItemByGuid(guid);
if (!item)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "Item refund: item not found!");
#endif
return;
}
@@ -1682,9 +1622,7 @@ void WorldSession::HandleItemTextQuery(WorldPacket& recvData )
ObjectGuid itemGuid;
recvData >> itemGuid;
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "CMSG_ITEM_TEXT_QUERY item: %s", itemGuid.ToString().c_str());
#endif
WorldPacket data(SMSG_ITEM_TEXT_QUERY_RESPONSE, 50); // guess size

View File

@@ -56,9 +56,7 @@ void WorldSession::HandleLfgJoinOpcode(WorldPacket& recvData)
recvData >> numDungeons;
if (!numDungeons)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "CMSG_LFG_JOIN [%s] no dungeons selected", GetPlayer()->GetGUID().ToString().c_str());
#endif
recvData.rfinish();
return;
}
@@ -77,10 +75,8 @@ void WorldSession::HandleLfgJoinOpcode(WorldPacket& recvData)
std::string comment;
recvData >> comment;
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "CMSG_LFG_JOIN [%s] roles: %u, Dungeons: %u, Comment: %s",
GetPlayer()->GetGUID().ToString().c_str(), roles, uint8(newDungeons.size()), comment.c_str());
#endif
sLFGMgr->JoinLfg(GetPlayer(), uint8(roles), newDungeons, comment);
}
@@ -91,9 +87,7 @@ void WorldSession::HandleLfgLeaveOpcode(WorldPacket& /*recvData*/)
ObjectGuid guid = GetPlayer()->GetGUID();
ObjectGuid gguid = group ? group->GetGUID() : guid;
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "CMSG_LFG_LEAVE [%s] in group: %u", guid.ToString().c_str(), group ? 1 : 0);
#endif
// Check cheating - only leader can leave the queue
if (!group || group->GetLeaderGUID() == guid)
@@ -110,9 +104,7 @@ void WorldSession::HandleLfgProposalResultOpcode(WorldPacket& recvData)
recvData >> proposalID;
recvData >> accept;
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "CMSG_LFG_PROPOSAL_RESULT [%s] proposal: %u accept: %u", GetPlayer()->GetGUID().ToString().c_str(), proposalID, accept ? 1 : 0);
#endif
sLFGMgr->UpdateProposal(proposalID, GetPlayer()->GetGUID(), accept);
}
@@ -124,15 +116,11 @@ void WorldSession::HandleLfgSetRolesOpcode(WorldPacket& recvData)
Group* group = GetPlayer()->GetGroup();
if (!group)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "CMSG_LFG_SET_ROLES [%s] Not in group", guid.ToString().c_str());
#endif
return;
}
ObjectGuid gguid = group->GetGUID();
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "CMSG_LFG_SET_ROLES: Group [%s], Player [%s], Roles: %u", gguid.ToString().c_str(), guid.ToString().c_str(), roles);
#endif
sLFGMgr->UpdateRoleCheck(gguid, guid, roles);
}
@@ -140,10 +128,8 @@ void WorldSession::HandleLfgSetCommentOpcode(WorldPacket& recvData)
{
std::string comment;
recvData >> comment;
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
ObjectGuid guid = GetPlayer()->GetGUID();
LOG_DEBUG("network", "CMSG_LFG_SET_COMMENT [%s] comment: %s", guid.ToString().c_str(), comment.c_str());
#endif
sLFGMgr->SetComment(GetPlayer()->GetGUID(), comment);
sLFGMgr->LfrSetComment(GetPlayer(), comment);
@@ -155,9 +141,7 @@ void WorldSession::HandleLfgSetBootVoteOpcode(WorldPacket& recvData)
recvData >> agree;
ObjectGuid guid = GetPlayer()->GetGUID();
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "CMSG_LFG_SET_BOOT_VOTE [%s] agree: %u", guid.ToString().c_str(), agree ? 1 : 0);
#endif
sLFGMgr->UpdateBoot(guid, agree);
}
@@ -166,18 +150,14 @@ void WorldSession::HandleLfgTeleportOpcode(WorldPacket& recvData)
bool out;
recvData >> out;
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "CMSG_LFG_TELEPORT [%s] out: %u", GetPlayer()->GetGUID().ToString().c_str(), out ? 1 : 0);
#endif
sLFGMgr->TeleportPlayer(GetPlayer(), out, true);
}
void WorldSession::HandleLfgPlayerLockInfoRequestOpcode(WorldPacket& /*recvData*/)
{
ObjectGuid guid = GetPlayer()->GetGUID();
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "CMSG_LFG_PLAYER_LOCK_INFO_REQUEST [%s]", guid.ToString().c_str());
#endif
// Get Random dungeons that can be done at a certain level and expansion
uint8 level = GetPlayer()->getLevel();
@@ -190,9 +170,7 @@ void WorldSession::HandleLfgPlayerLockInfoRequestOpcode(WorldPacket& /*recvData*
uint32 rsize = uint32(randomDungeons.size());
uint32 lsize = uint32(lock.size());
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "SMSG_LFG_PLAYER_INFO [%s]", guid.ToString().c_str());
#endif
WorldPacket data(SMSG_LFG_PLAYER_INFO, 1 + rsize * (4 + 1 + 4 + 4 + 4 + 4 + 1 + 4 + 4 + 4) + 4 + lsize * (1 + 4 + 4 + 4 + 4 + 1 + 4 + 4 + 4));
data << uint8(randomDungeons.size()); // Random Dungeon count
@@ -250,9 +228,7 @@ void WorldSession::HandleLfgPlayerLockInfoRequestOpcode(WorldPacket& /*recvData*
void WorldSession::HandleLfgPartyLockInfoRequestOpcode(WorldPacket& /*recvData*/)
{
ObjectGuid guid = GetPlayer()->GetGUID();
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "CMSG_LFG_PARTY_LOCK_INFO_REQUEST [%s]", guid.ToString().c_str());
#endif
Group* group = GetPlayer()->GetGroup();
if (!group)
@@ -278,9 +254,7 @@ void WorldSession::HandleLfgPartyLockInfoRequestOpcode(WorldPacket& /*recvData*
for (lfg::LfgLockPartyMap::const_iterator it = lockMap.begin(); it != lockMap.end(); ++it)
size += 8 + 4 + uint32(it->second.size()) * (4 + 4);
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "SMSG_LFG_PARTY_INFO [%s]", guid.ToString().c_str());
#endif
WorldPacket data(SMSG_LFG_PARTY_INFO, 1 + size);
BuildPartyLockDungeonBlock(data, lockMap);
SendPacket(&data);
@@ -304,9 +278,7 @@ void WorldSession::HandleLfrSearchLeaveOpcode(WorldPacket& recvData)
void WorldSession::HandleLfgGetStatus(WorldPacket& /*recvData*/)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("lfg", "CMSG_LFG_GET_STATUS %s", GetPlayerInfo().c_str());
#endif
ObjectGuid guid = GetPlayer()->GetGUID();
lfg::LfgUpdateData updateData = sLFGMgr->GetLfgStatus(guid);
@@ -343,10 +315,8 @@ void WorldSession::SendLfgUpdatePlayer(lfg::LfgUpdateData const& updateData)
break;
}
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("lfg", "SMSG_LFG_UPDATE_PLAYER %s updatetype: %u",
GetPlayerInfo().c_str(), updateData.updateType);
#endif
WorldPacket data(SMSG_LFG_UPDATE_PLAYER, 1 + 1 + (size > 0 ? 1 : 0) * (1 + 1 + 1 + 1 + size * 4 + updateData.comment.length()));
data << uint8(updateData.updateType); // Lfg Update type
data << uint8(size > 0); // Extra info
@@ -386,10 +356,8 @@ void WorldSession::SendLfgUpdateParty(lfg::LfgUpdateData const& updateData)
break;
}
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("lfg", "SMSG_LFG_UPDATE_PARTY %s updatetype: %u",
GetPlayerInfo().c_str(), updateData.updateType);
#endif
WorldPacket data(SMSG_LFG_UPDATE_PARTY, 1 + 1 + (size > 0 ? 1 : 0) * (1 + 1 + 1 + 1 + 1 + size * 4 + updateData.comment.length()));
data << uint8(updateData.updateType); // Lfg Update type
data << uint8(size > 0); // Extra info
@@ -412,9 +380,7 @@ void WorldSession::SendLfgUpdateParty(lfg::LfgUpdateData const& updateData)
void WorldSession::SendLfgRoleChosen(ObjectGuid guid, uint8 roles)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "SMSG_LFG_ROLE_CHOSEN [%s] guid: [%s] roles: %u", GetPlayer()->GetGUID().ToString().c_str(), guid.ToString().c_str(), roles);
#endif
WorldPacket data(SMSG_LFG_ROLE_CHOSEN, 8 + 1 + 4);
data << guid; // Guid
@@ -431,9 +397,7 @@ void WorldSession::SendLfgRoleCheckUpdate(lfg::LfgRoleCheck const& roleCheck)
else
dungeons = roleCheck.dungeons;
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "SMSG_LFG_ROLE_CHECK_UPDATE [%s]", GetPlayer()->GetGUID().ToString().c_str());
#endif
WorldPacket data(SMSG_LFG_ROLE_CHECK_UPDATE, 4 + 1 + 1 + dungeons.size() * 4 + 1 + roleCheck.roles.size() * (8 + 1 + 4 + 1));
data << uint32(roleCheck.state); // Check result
@@ -478,9 +442,7 @@ void WorldSession::SendLfgJoinResult(lfg::LfgJoinResultData const& joinData)
for (lfg::LfgLockPartyMap::const_iterator it = joinData.lockmap.begin(); it != joinData.lockmap.end(); ++it)
size += 8 + 4 + uint32(it->second.size()) * (4 + 4);
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "SMSG_LFG_JOIN_RESULT [%s] checkResult: %u checkValue: %u", GetPlayer()->GetGUID().ToString().c_str(), joinData.result, joinData.state);
#endif
WorldPacket data(SMSG_LFG_JOIN_RESULT, 4 + 4 + size);
data << uint32(joinData.result); // Check Result
data << uint32(joinData.state); // Check Value
@@ -491,11 +453,9 @@ void WorldSession::SendLfgJoinResult(lfg::LfgJoinResultData const& joinData)
void WorldSession::SendLfgQueueStatus(lfg::LfgQueueStatusData const& queueData)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "SMSG_LFG_QUEUE_STATUS [%s] dungeon: %u - waitTime: %d - avgWaitTime: %d - waitTimeTanks: %d - waitTimeHealer: %d - waitTimeDps: %d - queuedTime: %u - tanks: %u - healers: %u - dps: %u",
GetPlayer()->GetGUID().ToString().c_str(), queueData.dungeonId, queueData.waitTime, queueData.waitTimeAvg, queueData.waitTimeTank,
queueData.waitTimeHealer, queueData.waitTimeDps, queueData.queuedTime, queueData.tanks, queueData.healers, queueData.dps);
#endif
WorldPacket data(SMSG_LFG_QUEUE_STATUS, 4 + 4 + 4 + 4 + 4 + 4 + 1 + 1 + 1 + 4);
data << uint32(queueData.dungeonId); // Dungeon
data << int32(queueData.waitTimeAvg); // Average Wait time
@@ -560,11 +520,9 @@ void WorldSession::SendLfgBootProposalUpdate(lfg::LfgPlayerBoot const& boot)
++agreeNum;
}
}
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "SMSG_LFG_BOOT_PROPOSAL_UPDATE [%s] inProgress: %u - didVote: %u - agree: %u - victim: [%s] votes: %u - agrees: %u - left: %u - needed: %u - reason %s",
guid.ToString().c_str(), uint8(boot.inProgress), uint8(playerVote != lfg::LFG_ANSWER_PENDING), uint8(playerVote == lfg::LFG_ANSWER_AGREE),
boot.victim.ToString().c_str(), votesNum, agreeNum, secsleft, lfg::LFG_GROUP_KICK_VOTES_NEEDED, boot.reason.c_str());
#endif
WorldPacket data(SMSG_LFG_BOOT_PROPOSAL_UPDATE, 1 + 1 + 1 + 8 + 4 + 4 + 4 + 4 + boot.reason.length());
data << uint8(boot.inProgress); // Vote in progress
data << uint8(playerVote != lfg::LFG_ANSWER_PENDING); // Did Vote
@@ -585,9 +543,7 @@ void WorldSession::SendLfgUpdateProposal(lfg::LfgProposal const& proposal)
bool silent = !proposal.isNew && gguid == proposal.group;
uint32 dungeonEntry = proposal.dungeonId;
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "SMSG_LFG_PROPOSAL_UPDATE [%s state: %u", guid.ToString().c_str(), proposal.state);
#endif
// show random dungeon if player selected random dungeon and it's not lfg group
if (!silent)
@@ -630,9 +586,7 @@ void WorldSession::SendLfgUpdateProposal(lfg::LfgProposal const& proposal)
void WorldSession::SendLfgLfrList(bool update)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "SMSG_LFG_LFR_LIST [%s] update: %u", GetPlayer()->GetGUID().ToString().c_str(), update ? 1 : 0);
#endif
WorldPacket data(SMSG_LFG_UPDATE_SEARCH, 1);
data << uint8(update); // In Lfg Queue?
SendPacket(&data);
@@ -640,18 +594,14 @@ void WorldSession::SendLfgLfrList(bool update)
void WorldSession::SendLfgDisabled()
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "SMSG_LFG_DISABLED [%s]", GetPlayer()->GetGUID().ToString().c_str());
#endif
WorldPacket data(SMSG_LFG_DISABLED, 0);
SendPacket(&data);
}
void WorldSession::SendLfgOfferContinue(uint32 dungeonEntry)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "SMSG_LFG_OFFER_CONTINUE [%s] dungeon entry: %u", GetPlayer()->GetGUID().ToString().c_str(), dungeonEntry);
#endif
WorldPacket data(SMSG_LFG_OFFER_CONTINUE, 4);
data << uint32(dungeonEntry);
SendPacket(&data);
@@ -659,9 +609,7 @@ void WorldSession::SendLfgOfferContinue(uint32 dungeonEntry)
void WorldSession::SendLfgTeleportError(uint8 err)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "SMSG_LFG_TELEPORT_DENIED [%s] reason: %u", GetPlayer()->GetGUID().ToString().c_str(), err);
#endif
WorldPacket data(SMSG_LFG_TELEPORT_DENIED, 4);
data << uint32(err); // Error
SendPacket(&data);

View File

@@ -24,9 +24,7 @@
void WorldSession::HandleAutostoreLootItemOpcode(WorldPacket& recvData)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: CMSG_AUTOSTORE_LOOT_ITEM");
#endif
Player* player = GetPlayer();
ObjectGuid lguid = player->GetLootGUID();
Loot* loot = nullptr;
@@ -96,9 +94,7 @@ void WorldSession::HandleAutostoreLootItemOpcode(WorldPacket& recvData)
void WorldSession::HandleLootMoneyOpcode(WorldPacket& /*recvData*/)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: CMSG_LOOT_MONEY");
#endif
Player* player = GetPlayer();
ObjectGuid guid = player->GetLootGUID();
@@ -218,9 +214,7 @@ void WorldSession::HandleLootMoneyOpcode(WorldPacket& /*recvData*/)
void WorldSession::HandleLootOpcode(WorldPacket& recvData)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: CMSG_LOOT");
#endif
ObjectGuid guid;
recvData >> guid;
@@ -238,9 +232,7 @@ void WorldSession::HandleLootOpcode(WorldPacket& recvData)
void WorldSession::HandleLootReleaseOpcode(WorldPacket& recvData)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: CMSG_LOOT_RELEASE");
#endif
// cheaters can modify lguid to prevent correct apply loot release code and re-loot
// use internal stored guid
@@ -300,9 +292,7 @@ void WorldSession::DoLootRelease(ObjectGuid lguid)
// Xinef: prevents exploits with just opening GO and spawning bilions of npcs, which can crash core if you know what you're doin ;)
if (go->GetGoType() == GAMEOBJECT_TYPE_CHEST && go->GetGOInfo()->chest.eventId)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("spells.aura", "Chest ScriptStart id %u for GO %u", go->GetGOInfo()->chest.eventId, go->GetSpawnId());
#endif
player->GetMap()->ScriptsStart(sEventScripts, go->GetGOInfo()->chest.eventId, player, go);
}
}
@@ -420,9 +410,7 @@ void WorldSession::HandleLootMasterGiveOpcode(WorldPacket& recvData)
return;
}
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WorldSession::HandleLootMasterGiveOpcode (CMSG_LOOT_MASTER_GIVE, 0x02A3) Target = [%s].", target->GetName().c_str());
#endif
if (_player->GetLootGUID() != lootguid)
{
@@ -461,9 +449,7 @@ void WorldSession::HandleLootMasterGiveOpcode(WorldPacket& recvData)
if (slotid >= loot->items.size() + loot->quest_items.size())
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("loot", "MasterLootItem: Player %s might be using a hack! (slot %d, size %lu)", GetPlayer()->GetName().c_str(), slotid, (unsigned long)loot->items.size());
#endif
return;
}

View File

@@ -27,7 +27,7 @@ bool WorldSession::CanOpenMailBox(ObjectGuid guid)
{
if (_player->GetSession()->GetSecurity() < SEC_MODERATOR)
{
LOG_ERROR("server", "%s attempt open mailbox in cheating way.", _player->GetName().c_str());
LOG_ERROR("network.opcode", "%s attempt open mailbox in cheating way.", _player->GetName().c_str());
return false;
}
}
@@ -115,18 +115,14 @@ void WorldSession::HandleSendMail(WorldPacket& recvData)
if (!rc)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("server", "Player %s is sending mail to %s (GUID: not existed!) with subject %s and body %s includes %u items, %u copper and %u COD copper with unk1 = %u, unk2 = %u",
LOG_DEBUG("network.opcode", "Player %s is sending mail to %s (GUID: not existed!) with subject %s and body %s includes %u items, %u copper and %u COD copper with unk1 = %u, unk2 = %u",
player->GetGUID().ToString().c_str(), receiver.c_str(), subject.c_str(), body.c_str(), items_count, money, COD, unk1, unk2);
#endif
player->SendMailResult(0, MAIL_SEND, MAIL_ERR_RECIPIENT_NOT_FOUND);
return;
}
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("server", "Player %s is sending mail to %s (%s) with subject %s and body %s includes %u items, %u copper and %u COD copper with unk1 = %u, unk2 = %u",
LOG_DEBUG("network.opcode", "Player %s is sending mail to %s (%s) with subject %s and body %s includes %u items, %u copper and %u COD copper with unk1 = %u, unk2 = %u",
player->GetGUID().ToString().c_str(), receiver.c_str(), rc.ToString().c_str(), subject.c_str(), body.c_str(), items_count, money, COD, unk1, unk2);
#endif
if (player->GetGUID() == rc)
{
@@ -136,7 +132,7 @@ void WorldSession::HandleSendMail(WorldPacket& recvData)
if (money && COD) // cannot send money in a COD mail
{
LOG_ERROR("server", "%s attempt to dupe money!!!.", receiver.c_str());
LOG_ERROR("network.opcode", "%s attempt to dupe money!!!.", receiver.c_str());
player->SendMailResult(0, MAIL_SEND, MAIL_ERR_INTERNAL_ERROR);
return;
}
@@ -750,9 +746,7 @@ void WorldSession::HandleMailCreateTextItem(WorldPacket& recvData)
bodyItem->SetUInt32Value(ITEM_FIELD_CREATOR, m->sender);
bodyItem->SetFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_MAIL_TEXT_MASK);
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("server", "HandleMailCreateTextItem mailid=%u", mailId);
#endif
LOG_DEBUG("network.opcode", "HandleMailCreateTextItem mailid=%u", mailId);
ItemPosCountVec dest;
uint8 msg = _player->CanStoreItem(NULL_BAG, NULL_SLOT, dest, bodyItem, false);

View File

@@ -45,9 +45,7 @@
void WorldSession::HandleRepopRequestOpcode(WorldPacket& recv_data)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: Recvd CMSG_REPOP_REQUEST Message");
#endif
recv_data.read_skip<uint8>();
@@ -64,10 +62,8 @@ void WorldSession::HandleRepopRequestOpcode(WorldPacket& recv_data)
// release spirit after he's killed but before he is updated
if (GetPlayer()->getDeathState() == JUST_DIED)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "HandleRepopRequestOpcode: got request after player %s (%s) was killed and before he was updated",
GetPlayer()->GetName().c_str(), GetPlayer()->GetGUID().ToString().c_str());
#endif
GetPlayer()->KillPlayer();
}
@@ -83,9 +79,7 @@ void WorldSession::HandleRepopRequestOpcode(WorldPacket& recv_data)
void WorldSession::HandleGossipSelectOptionOpcode(WorldPacket& recv_data)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: CMSG_GOSSIP_SELECT_OPTION");
#endif
uint32 gossipListId;
uint32 menuId;
@@ -105,9 +99,7 @@ void WorldSession::HandleGossipSelectOptionOpcode(WorldPacket& recv_data)
unit = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_NONE);
if (!unit)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: HandleGossipSelectOptionOpcode - Unit (%s) not found or you can't interact with him.", guid.ToString().c_str());
#endif
return;
}
}
@@ -116,9 +108,7 @@ void WorldSession::HandleGossipSelectOptionOpcode(WorldPacket& recv_data)
go = _player->GetMap()->GetGameObject(guid);
if (!go)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: HandleGossipSelectOptionOpcode - GameObject (%s) not found.", guid.ToString().c_str());
#endif
return;
}
}
@@ -141,9 +131,7 @@ void WorldSession::HandleGossipSelectOptionOpcode(WorldPacket& recv_data)
}
else
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: HandleGossipSelectOptionOpcode - unsupported GUID type for %s.", guid.ToString().c_str());
#endif
return;
}
@@ -153,9 +141,7 @@ void WorldSession::HandleGossipSelectOptionOpcode(WorldPacket& recv_data)
if ((unit && unit->GetCreatureTemplate()->ScriptID != unit->LastUsedScriptID) || (go && go->GetGOInfo()->ScriptId != go->LastUsedScriptID))
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: HandleGossipSelectOptionOpcode - Script reloaded while in use, ignoring and set new scipt id");
#endif
if (unit)
unit->LastUsedScriptID = unit->GetCreatureTemplate()->ScriptID;
if (go)
@@ -409,9 +395,7 @@ void WorldSession::HandleWhoOpcode(WorldPacket& recvData)
void WorldSession::HandleLogoutRequestOpcode(WorldPacket& /*recv_data*/)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: Recvd CMSG_LOGOUT_REQUEST Message, security - %u", GetSecurity());
#endif
if (ObjectGuid lguid = GetPlayer()->GetLootGUID())
DoLootRelease(lguid);
@@ -474,9 +458,7 @@ void WorldSession::HandleLogoutRequestOpcode(WorldPacket& /*recv_data*/)
void WorldSession::HandlePlayerLogoutOpcode(WorldPacket& /*recv_data*/)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: Recvd CMSG_PLAYER_LOGOUT Message");
#endif
}
void WorldSession::HandleLogoutCancelOpcode(WorldPacket& /*recv_data*/)
@@ -525,9 +507,7 @@ void WorldSession::HandleZoneUpdateOpcode(WorldPacket& recv_data)
uint32 newZone;
recv_data >> newZone;
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: Recvd ZONE_UPDATE: %u", newZone);
#endif
// use server size data
uint32 newzone, newarea;
@@ -627,7 +607,6 @@ void WorldSession::HandleBugOpcode(WorldPacket& recv_data)
recv_data >> typelen >> type;
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
if (suggestion == 0)
LOG_DEBUG("network", "WORLD: Received CMSG_BUG [Bug Report]");
else
@@ -635,7 +614,6 @@ void WorldSession::HandleBugOpcode(WorldPacket& recv_data)
LOG_DEBUG("network", "%s", type.c_str());
LOG_DEBUG("network", "%s", content.c_str());
#endif
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_BUG_REPORT);
@@ -647,9 +625,7 @@ void WorldSession::HandleBugOpcode(WorldPacket& recv_data)
void WorldSession::HandleReclaimCorpseOpcode(WorldPacket& recv_data)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: Received CMSG_RECLAIM_CORPSE");
#endif
ObjectGuid guid;
recv_data >> guid;
@@ -685,9 +661,7 @@ void WorldSession::HandleReclaimCorpseOpcode(WorldPacket& recv_data)
void WorldSession::HandleResurrectResponseOpcode(WorldPacket& recv_data)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: Received CMSG_RESURRECT_RESPONSE");
#endif
ObjectGuid guid;
uint8 status;
@@ -732,36 +706,28 @@ void WorldSession::HandleAreaTriggerOpcode(WorldPacket& recv_data)
uint32 triggerId;
recv_data >> triggerId;
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "CMSG_AREATRIGGER. Trigger ID: %u", triggerId);
#endif
Player* player = GetPlayer();
if (player->IsInFlight())
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "HandleAreaTriggerOpcode: Player '%s' (%s) in flight, ignore Area Trigger ID:%u",
player->GetName().c_str(), player->GetGUID().ToString().c_str(), triggerId);
#endif
return;
}
AreaTrigger const* atEntry = sObjectMgr->GetAreaTrigger(triggerId);
if (!atEntry)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "HandleAreaTriggerOpcode: Player '%s' (%s) send unknown (by DBC) Area Trigger ID:%u",
player->GetName().c_str(), player->GetGUID().ToString().c_str(), triggerId);
#endif
return;
}
if (!player->IsInAreaTriggerRadius(atEntry))
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "HandleAreaTriggerOpcode: Player %s (%s) too far (trigger map: %u player map: %u), ignore Area Trigger ID: %u",
player->GetName().c_str(), player->GetGUID().ToString().c_str(), atEntry->map, player->GetMapId(), triggerId);
#endif
return;
}
@@ -819,16 +785,12 @@ void WorldSession::HandleAreaTriggerOpcode(WorldPacket& recv_data)
void WorldSession::HandleUpdateAccountData(WorldPacket& recv_data)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: Received CMSG_UPDATE_ACCOUNT_DATA");
#endif
uint32 type, timestamp, decompressedSize;
recv_data >> type >> timestamp >> decompressedSize;
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "UAD: type %u, time %u, decompressedSize %u", type, timestamp, decompressedSize);
#endif
if (type > NUM_ACCOUNT_DATA_TYPES)
return;
@@ -848,7 +810,7 @@ void WorldSession::HandleUpdateAccountData(WorldPacket& recv_data)
if (decompressedSize > 0xFFFF)
{
recv_data.rfinish(); // unnneded warning spam in this case
LOG_ERROR("server", "UAD: Account data packet too big, size %u", decompressedSize);
LOG_ERROR("network.opcode", "UAD: Account data packet too big, size %u", decompressedSize);
return;
}
@@ -859,7 +821,7 @@ void WorldSession::HandleUpdateAccountData(WorldPacket& recv_data)
if (uncompress(dest.contents(), &realSize, recv_data.contents() + recv_data.rpos(), recv_data.size() - recv_data.rpos()) != Z_OK)
{
recv_data.rfinish(); // unnneded warning spam in this case
LOG_ERROR("server", "UAD: Failed to decompress account data");
LOG_ERROR("network.opcode", "UAD: Failed to decompress account data");
return;
}
@@ -878,16 +840,12 @@ void WorldSession::HandleUpdateAccountData(WorldPacket& recv_data)
void WorldSession::HandleRequestAccountData(WorldPacket& recv_data)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: Received CMSG_REQUEST_ACCOUNT_DATA");
#endif
uint32 type;
recv_data >> type;
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "RAD: type %u", type);
#endif
if (type >= NUM_ACCOUNT_DATA_TYPES)
return;
@@ -903,9 +861,7 @@ void WorldSession::HandleRequestAccountData(WorldPacket& recv_data)
if (size && compress(dest.contents(), &destSize, (uint8 const*)adata->Data.c_str(), size) != Z_OK)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "RAD: Failed to compress account data");
#endif
return;
}
@@ -922,9 +878,7 @@ void WorldSession::HandleRequestAccountData(WorldPacket& recv_data)
void WorldSession::HandleSetActionButtonOpcode(WorldPacket& recv_data)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: Received CMSG_SET_ACTION_BUTTON");
#endif
uint8 button;
uint32 packetData;
recv_data >> button >> packetData;
@@ -932,14 +886,10 @@ void WorldSession::HandleSetActionButtonOpcode(WorldPacket& recv_data)
uint32 action = ACTION_BUTTON_ACTION(packetData);
uint8 type = ACTION_BUTTON_TYPE(packetData);
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("server", "BUTTON: %u ACTION: %u TYPE: %u", button, action, type);
#endif
LOG_DEBUG("network.opcode", "BUTTON: %u ACTION: %u TYPE: %u", button, action, type);
if (!packetData)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("server", "MISC: Remove action from button %u", button);
#endif
LOG_DEBUG("network.opcode", "MISC: Remove action from button %u", button);
GetPlayer()->removeActionButton(button);
}
else
@@ -948,27 +898,19 @@ void WorldSession::HandleSetActionButtonOpcode(WorldPacket& recv_data)
{
case ACTION_BUTTON_MACRO:
case ACTION_BUTTON_CMACRO:
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("server", "MISC: Added Macro %u into button %u", action, button);
#endif
LOG_DEBUG("network.opcode", "MISC: Added Macro %u into button %u", action, button);
break;
case ACTION_BUTTON_EQSET:
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("server", "MISC: Added EquipmentSet %u into button %u", action, button);
#endif
LOG_DEBUG("network.opcode", "MISC: Added EquipmentSet %u into button %u", action, button);
break;
case ACTION_BUTTON_SPELL:
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("server", "MISC: Added Spell %u into button %u", action, button);
#endif
LOG_DEBUG("network.opcode", "MISC: Added Spell %u into button %u", action, button);
break;
case ACTION_BUTTON_ITEM:
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("server", "MISC: Added Item %u into button %u", action, button);
#endif
LOG_DEBUG("network.opcode", "MISC: Added Item %u into button %u", action, button);
break;
default:
LOG_ERROR("server", "MISC: Unknown action button type %u for action %u into button %u for player %s (%s)",
LOG_ERROR("network.opcode", "MISC: Unknown action button type %u for action %u into button %u for player %s (%s)",
type, action, button, _player->GetName().c_str(), _player->GetGUID().ToString().c_str());
return;
}
@@ -978,31 +920,25 @@ void WorldSession::HandleSetActionButtonOpcode(WorldPacket& recv_data)
void WorldSession::HandleCompleteCinematic(WorldPacket& /*recv_data*/)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
{
LOG_DEBUG("network", "WORLD: Received CMSG_COMPLETE_CINEMATIC");
}
#endif
// If player has sight bound to visual waypoint NPC we should remove it
GetPlayer()->EndCinematic();
}
void WorldSession::HandleNextCinematicCamera(WorldPacket& /*recv_data*/)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
{
LOG_DEBUG("network", "WORLD: Received CMSG_NEXT_CINEMATIC_CAMERA");
}
#endif
// Sent by client when cinematic actually begun. So we begin the server side process
GetPlayer()->BeginCinematic();
}
void WorldSession::HandleFeatherFallAck(WorldPacket& recv_data)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: CMSG_MOVE_FEATHER_FALL_ACK");
#endif
// no used
recv_data.rfinish(); // prevent warnings spam
@@ -1023,9 +959,7 @@ void WorldSession::HandleMoveUnRootAck(WorldPacket& recv_data)
return;
}
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network.opcode", "WORLD: CMSG_FORCE_MOVE_UNROOT_ACK");
#endif
recv_data.read_skip<uint32>(); // unk
@@ -1051,9 +985,7 @@ void WorldSession::HandleMoveRootAck(WorldPacket& recv_data)
return;
}
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network.opcode", "WORLD: CMSG_FORCE_MOVE_ROOT_ACK");
#endif
recv_data.read_skip<uint32>(); // unk
@@ -1071,7 +1003,7 @@ void WorldSession::HandleSetActionBarToggles(WorldPacket& recv_data)
if (!GetPlayer()) // ignore until not logged (check needed because STATUS_AUTHED)
{
if (ActionBar != 0)
LOG_ERROR("server", "WorldSession::HandleSetActionBarToggles in not logged state with value: %u, ignored", uint32(ActionBar));
LOG_ERROR("network.opcode", "WorldSession::HandleSetActionBarToggles in not logged state with value: %u, ignored", uint32(ActionBar));
return;
}
@@ -1095,16 +1027,12 @@ void WorldSession::HandleInspectOpcode(WorldPacket& recv_data)
ObjectGuid guid;
recv_data >> guid;
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: Received CMSG_INSPECT");
#endif
Player* player = ObjectAccessor::GetPlayer(*_player, guid);
if (!player)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "CMSG_INSPECT: No player found from %s", guid.ToString().c_str());
#endif
return;
}
@@ -1136,9 +1064,7 @@ void WorldSession::HandleInspectHonorStatsOpcode(WorldPacket& recv_data)
Player* player = ObjectAccessor::GetPlayer(*_player, guid);
if (!player)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "MSG_INSPECT_HONOR_STATS: No player found from %s", guid.ToString().c_str());
#endif
return;
}
@@ -1168,21 +1094,15 @@ void WorldSession::HandleWorldTeleportOpcode(WorldPacket& recv_data)
recv_data >> PositionZ;
recv_data >> Orientation; // o (3.141593 = 180 degrees)
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: Received CMSG_WORLD_TELEPORT");
#endif
if (GetPlayer()->IsInFlight())
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "Player '%s' (%s) in flight, ignore worldport command.", GetPlayer()->GetName().c_str(), GetPlayer()->GetGUID().ToString().c_str());
#endif
return;
}
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "CMSG_WORLD_TELEPORT: Player = %s, Time = %u, map = %u, x = %f, y = %f, z = %f, o = %f", GetPlayer()->GetName().c_str(), time, mapid, PositionX, PositionY, PositionZ, Orientation);
#endif
if (AccountMgr::IsAdminAccount(GetSecurity()))
GetPlayer()->TeleportTo(mapid, PositionX, PositionY, PositionZ, Orientation);
@@ -1192,9 +1112,7 @@ void WorldSession::HandleWorldTeleportOpcode(WorldPacket& recv_data)
void WorldSession::HandleWhoisOpcode(WorldPacket& recv_data)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "Received opcode CMSG_WHOIS");
#endif
std::string charname;
recv_data >> charname;
@@ -1249,16 +1167,12 @@ void WorldSession::HandleWhoisOpcode(WorldPacket& recv_data)
data << msg;
SendPacket(&data);
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "Received whois command from player %s for character %s", GetPlayer()->GetName().c_str(), charname.c_str());
#endif
}
void WorldSession::HandleComplainOpcode(WorldPacket& recv_data)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: CMSG_COMPLAIN");
#endif
uint8 spam_type; // 0 - mail, 1 - chat
ObjectGuid spammer_guid;
@@ -1293,17 +1207,13 @@ void WorldSession::HandleComplainOpcode(WorldPacket& recv_data)
data << uint8(0);
SendPacket(&data);
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "REPORT SPAM: type %u, %s, unk1 %u, unk2 %u, unk3 %u, unk4 %u, message %s",
spam_type, spammer_guid.ToString().c_str(), unk1, unk2, unk3, unk4, description.c_str());
#endif
}
void WorldSession::HandleRealmSplitOpcode(WorldPacket& recv_data)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "CMSG_REALM_SPLIT");
#endif
uint32 unk;
std::string split_date = "01/01/01";
@@ -1322,32 +1232,24 @@ void WorldSession::HandleRealmSplitOpcode(WorldPacket& recv_data)
void WorldSession::HandleFarSightOpcode(WorldPacket& recvData)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: CMSG_FAR_SIGHT");
#endif
bool apply;
recvData >> apply;
if (apply)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "Added FarSight %s to player %s", _player->GetGuidValue(PLAYER_FARSIGHT).ToString().c_str(), _player->GetGUID().ToString().c_str());
#endif
if (WorldObject* target = _player->GetViewpoint())
_player->SetSeer(target);
else
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_ERROR("server", "Player %s requests non-existing seer %s", _player->GetName().c_str(), _player->GetGuidValue(PLAYER_FARSIGHT).ToString().c_str());
#endif
LOG_ERROR("network.opcode", "Player %s requests non-existing seer %s", _player->GetName().c_str(), _player->GetGuidValue(PLAYER_FARSIGHT).ToString().c_str());
}
}
else
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "Player %s set vision to self", _player->GetGUID().ToString().c_str());
#endif
_player->SetSeer(_player);
}
@@ -1356,9 +1258,7 @@ void WorldSession::HandleFarSightOpcode(WorldPacket& recvData)
void WorldSession::HandleSetTitleOpcode(WorldPacket& recv_data)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "CMSG_SET_TITLE");
#endif
int32 title;
recv_data >> title;
@@ -1377,9 +1277,7 @@ void WorldSession::HandleSetTitleOpcode(WorldPacket& recv_data)
void WorldSession::HandleResetInstancesOpcode(WorldPacket& /*recv_data*/)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: CMSG_RESET_INSTANCES");
#endif
if (Group* group = _player->GetGroup())
{
@@ -1392,9 +1290,7 @@ void WorldSession::HandleResetInstancesOpcode(WorldPacket& /*recv_data*/)
void WorldSession::HandleSetDungeonDifficultyOpcode(WorldPacket& recv_data)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "MSG_SET_DUNGEON_DIFFICULTY");
#endif
uint32 mode;
recv_data >> mode;
@@ -1447,9 +1343,7 @@ void WorldSession::HandleSetDungeonDifficultyOpcode(WorldPacket& recv_data)
void WorldSession::HandleSetRaidDifficultyOpcode(WorldPacket& recv_data)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "MSG_SET_RAID_DIFFICULTY");
#endif
uint32 mode;
recv_data >> mode;
@@ -1609,9 +1503,7 @@ void WorldSession::HandleSetRaidDifficultyOpcode(WorldPacket& recv_data)
void WorldSession::HandleCancelMountAuraOpcode(WorldPacket& /*recv_data*/)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: CMSG_CANCEL_MOUNT_AURA");
#endif
//If player is not mounted, so go out :)
if (!_player->IsMounted()) // not blizz like; no any messages on blizz
@@ -1633,9 +1525,7 @@ void WorldSession::HandleCancelMountAuraOpcode(WorldPacket& /*recv_data*/)
void WorldSession::HandleMoveSetCanFlyAckOpcode(WorldPacket& recv_data)
{
// fly mode on/off
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: CMSG_MOVE_SET_CAN_FLY_ACK");
#endif
ObjectGuid guid;
recv_data >> guid.ReadAsPacked();
@@ -1662,9 +1552,7 @@ void WorldSession::HandleMoveSetCanFlyAckOpcode(WorldPacket& recv_data)
void WorldSession::HandleRequestPetInfoOpcode(WorldPacket& /*recv_data */)
{
/*
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network.opcode", "WORLD: CMSG_REQUEST_PET_INFO");
#endif
recv_data.hexlike();
*/
@@ -1681,9 +1569,7 @@ void WorldSession::HandleSetTaxiBenchmarkOpcode(WorldPacket& recv_data)
mode ? _player->SetFlag(PLAYER_FLAGS, PLAYER_FLAGS_TAXI_BENCHMARK) : _player->RemoveFlag(PLAYER_FLAGS, PLAYER_FLAGS_TAXI_BENCHMARK);
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "Client used \"/timetest %d\" command", mode);
#endif
}
void WorldSession::HandleQueryInspectAchievements(WorldPacket& recv_data)
@@ -1701,9 +1587,7 @@ void WorldSession::HandleQueryInspectAchievements(WorldPacket& recv_data)
void WorldSession::HandleWorldStateUITimerUpdate(WorldPacket& /*recv_data*/)
{
// empty opcode
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: CMSG_WORLD_STATE_UI_TIMER_UPDATE");
#endif
WorldPacket data(SMSG_WORLD_STATE_UI_TIMER_UPDATE, 4);
data << uint32(time(nullptr));
@@ -1713,9 +1597,7 @@ void WorldSession::HandleWorldStateUITimerUpdate(WorldPacket& /*recv_data*/)
void WorldSession::HandleReadyForAccountDataTimes(WorldPacket& /*recv_data*/)
{
// empty opcode
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: CMSG_READY_FOR_ACCOUNT_DATA_TIMES");
#endif
SendAccountDataTimes(GLOBAL_CACHE_MASK);
}
@@ -1730,9 +1612,7 @@ void WorldSession::SendSetPhaseShift(uint32 PhaseShift)
//Battlefield and Battleground
void WorldSession::HandleAreaSpiritHealerQueryOpcode(WorldPacket& recv_data)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: CMSG_AREA_SPIRIT_HEALER_QUERY");
#endif
Battleground* bg = _player->GetBattleground();
@@ -1755,9 +1635,7 @@ void WorldSession::HandleAreaSpiritHealerQueryOpcode(WorldPacket& recv_data)
void WorldSession::HandleAreaSpiritHealerQueueOpcode(WorldPacket& recv_data)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: CMSG_AREA_SPIRIT_HEALER_QUEUE");
#endif
Battleground* bg = _player->GetBattleground();
@@ -1806,10 +1684,8 @@ void WorldSession::HandleInstanceLockResponse(WorldPacket& recvPacket)
if (!_player->HasPendingBind() || _player->GetPendingBind() != _player->GetInstanceId() || (_player->GetGroup() && _player->GetGroup()->isLFGGroup() && _player->GetGroup()->IsLfgRandomInstance()))
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("server", "InstanceLockResponse: Player %s (%s) tried to bind himself/teleport to graveyard without a pending bind!",
LOG_DEBUG("network.opcode", "InstanceLockResponse: Player %s (%s) tried to bind himself/teleport to graveyard without a pending bind!",
_player->GetName().c_str(), _player->GetGUID().ToString().c_str());
#endif
return;
}
@@ -1823,9 +1699,7 @@ void WorldSession::HandleInstanceLockResponse(WorldPacket& recvPacket)
void WorldSession::HandleUpdateMissileTrajectory(WorldPacket& recvPacket)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: CMSG_UPDATE_MISSILE_TRAJECTORY");
#endif
ObjectGuid guid;
uint32 spellId;

View File

@@ -31,9 +31,7 @@
void WorldSession::HandleMoveWorldportAckOpcode(WorldPacket& /*recvData*/)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: got MSG_MOVE_WORLDPORT_ACK.");
#endif
HandleMoveWorldportAck();
}
@@ -62,7 +60,7 @@ void WorldSession::HandleMoveWorldportAck()
Map* oldMap = GetPlayer()->GetMap();
if (GetPlayer()->IsInWorld())
{
LOG_ERROR("server", "Player (Name %s) is still in world when teleported from map %u to new map %u", GetPlayer()->GetName().c_str(), oldMap->GetId(), loc.GetMapId());
LOG_ERROR("network.opcode", "Player (Name %s) is still in world when teleported from map %u to new map %u", GetPlayer()->GetName().c_str(), oldMap->GetId(), loc.GetMapId());
oldMap->RemovePlayerFromMap(GetPlayer(), false);
}
@@ -81,7 +79,7 @@ void WorldSession::HandleMoveWorldportAck()
// while the player is in transit, for example the map may get full
if (!newMap || !newMap->CanEnter(GetPlayer(), false))
{
LOG_ERROR("server", "Map %d could not be created for player %s, porting player to homebind", loc.GetMapId(), GetPlayer()->GetGUID().ToString().c_str());
LOG_ERROR("network.opcode", "Map %d could not be created for player %s, porting player to homebind", loc.GetMapId(), GetPlayer()->GetGUID().ToString().c_str());
GetPlayer()->TeleportTo(GetPlayer()->m_homebindMapId, GetPlayer()->m_homebindX, GetPlayer()->m_homebindY, GetPlayer()->m_homebindZ, GetPlayer()->GetOrientation());
return;
}
@@ -95,7 +93,7 @@ void WorldSession::HandleMoveWorldportAck()
GetPlayer()->SendInitialPacketsBeforeAddToMap();
if (!GetPlayer()->GetMap()->AddPlayerToMap(GetPlayer()))
{
LOG_ERROR("server", "WORLD: failed to teleport player %s (%s) to map %d because of unknown reason!",
LOG_ERROR("network.opcode", "WORLD: failed to teleport player %s (%s) to map %d because of unknown reason!",
GetPlayer()->GetName().c_str(), GetPlayer()->GetGUID().ToString().c_str(), loc.GetMapId());
GetPlayer()->ResetMap();
GetPlayer()->SetMap(oldMap);
@@ -238,21 +236,15 @@ void WorldSession::HandleMoveWorldportAck()
void WorldSession::HandleMoveTeleportAck(WorldPacket& recvData)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "MSG_MOVE_TELEPORT_ACK");
#endif
ObjectGuid guid;
recvData >> guid.ReadAsPacked();
uint32 flags, time;
recvData >> flags >> time; // unused
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("server", "Guid %s", guid.ToString().c_str());
#endif
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("server", "Flags %u, time %u", flags, time / IN_MILLISECONDS);
#endif
LOG_DEBUG("network.opcode", "Guid %s", guid.ToString().c_str());
LOG_DEBUG("network.opcode", "Flags %u, time %u", flags, time / IN_MILLISECONDS);
Player* plMover = _player->m_mover->ToPlayer();
@@ -583,9 +575,7 @@ void WorldSession::HandleMovementOpcodes(WorldPacket& recvData)
void WorldSession::HandleForceSpeedChangeAck(WorldPacket& recvData)
{
uint32 opcode = recvData.GetOpcode();
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: Recvd %s (%u, 0x%X) opcode", GetOpcodeNameForLogging(static_cast<OpcodeClient>(opcode)).c_str(), opcode, opcode);
#endif
/* extract packet */
ObjectGuid guid;
@@ -656,7 +646,7 @@ void WorldSession::HandleForceSpeedChangeAck(WorldPacket& recvData)
force_move_type = MOVE_PITCH_RATE;
break;
default:
LOG_ERROR("server", "WorldSession::HandleForceSpeedChangeAck: Unknown move type opcode: %u", opcode);
LOG_ERROR("network.opcode", "WorldSession::HandleForceSpeedChangeAck: Unknown move type opcode: %u", opcode);
return;
}
@@ -675,13 +665,13 @@ void WorldSession::HandleForceSpeedChangeAck(WorldPacket& recvData)
{
if (_player->GetSpeed(move_type) > newspeed) // must be greater - just correct
{
LOG_ERROR("server", "%sSpeedChange player %s is NOT correct (must be %f instead %f), force set to correct value",
LOG_ERROR("network.opcode", "%sSpeedChange player %s is NOT correct (must be %f instead %f), force set to correct value",
move_type_name[move_type], _player->GetName().c_str(), _player->GetSpeed(move_type), newspeed);
_player->SetSpeed(move_type, _player->GetSpeedRate(move_type), true);
}
else // must be lesser - cheating
{
LOG_INFO("server", "Player %s from account id %u kicked for incorrect speed (must be %f instead %f)",
LOG_INFO("network.opcode", "Player %s from account id %u kicked for incorrect speed (must be %f instead %f)",
_player->GetName().c_str(), GetAccountId(), _player->GetSpeed(move_type), newspeed);
KickPlayer("Incorrect speed");
}
@@ -690,9 +680,7 @@ void WorldSession::HandleForceSpeedChangeAck(WorldPacket& recvData)
void WorldSession::HandleSetActiveMoverOpcode(WorldPacket& recvData)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: Recvd CMSG_SET_ACTIVE_MOVER");
#endif
ObjectGuid guid;
recvData >> guid;
@@ -700,16 +688,14 @@ void WorldSession::HandleSetActiveMoverOpcode(WorldPacket& recvData)
if (GetPlayer()->IsInWorld() && _player->m_mover && _player->m_mover->IsInWorld())
{
if (_player->m_mover->GetGUID() != guid)
LOG_ERROR("server", "HandleSetActiveMoverOpcode: incorrect mover guid: mover is %s and should be %s",
LOG_ERROR("network.opcode", "HandleSetActiveMoverOpcode: incorrect mover guid: mover is %s and should be %s",
guid.ToString().c_str(), _player->m_mover->GetGUID().ToString().c_str());
}
}
void WorldSession::HandleMoveNotActiveMover(WorldPacket& recvData)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: Recvd CMSG_MOVE_NOT_ACTIVE_MOVER");
#endif
ObjectGuid old_mover_guid;
recvData >> old_mover_guid.ReadAsPacked();
@@ -738,9 +724,7 @@ void WorldSession::HandleMountSpecialAnimOpcode(WorldPacket& /*recvData*/)
void WorldSession::HandleMoveKnockBackAck(WorldPacket& recvData)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "CMSG_MOVE_KNOCK_BACK_ACK");
#endif
ObjectGuid guid;
recvData >> guid.ReadAsPacked();
@@ -775,9 +759,7 @@ void WorldSession::HandleMoveKnockBackAck(WorldPacket& recvData)
void WorldSession::HandleMoveHoverAck(WorldPacket& recvData)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "CMSG_MOVE_HOVER_ACK");
#endif
ObjectGuid guid;
recvData >> guid.ReadAsPacked();
@@ -793,9 +775,7 @@ void WorldSession::HandleMoveHoverAck(WorldPacket& recvData)
void WorldSession::HandleMoveWaterWalkAck(WorldPacket& recvData)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "CMSG_MOVE_WATER_WALK_ACK");
#endif
ObjectGuid guid;
recvData >> guid.ReadAsPacked();
@@ -835,9 +815,7 @@ void WorldSession::HandleSummonResponseOpcode(WorldPacket& recvData)
void WorldSession::HandleMoveTimeSkippedOpcode(WorldPacket& recvData)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: Recvd CMSG_MOVE_TIME_SKIPPED");
#endif
ObjectGuid guid;
uint32 timeSkipped;
@@ -848,14 +826,14 @@ void WorldSession::HandleMoveTimeSkippedOpcode(WorldPacket& recvData)
if (!mover)
{
LOG_ERROR("server", "WorldSession::HandleMoveTimeSkippedOpcode wrong mover state from the unit moved by the player [%s]", GetPlayer()->GetGUID().ToString().c_str());
LOG_ERROR("network.opcode", "WorldSession::HandleMoveTimeSkippedOpcode wrong mover state from the unit moved by the player [%s]", GetPlayer()->GetGUID().ToString().c_str());
return;
}
// prevent tampered movement data
if (guid != mover->GetGUID())
{
LOG_ERROR("server", "WorldSession::HandleMoveTimeSkippedOpcode wrong guid from the unit moved by the player [%s]", GetPlayer()->GetGUID().ToString().c_str());
LOG_ERROR("network.opcode", "WorldSession::HandleMoveTimeSkippedOpcode wrong guid from the unit moved by the player [%s]", GetPlayer()->GetGUID().ToString().c_str());
return;
}
@@ -869,9 +847,7 @@ void WorldSession::HandleMoveTimeSkippedOpcode(WorldPacket& recvData)
void WorldSession::HandleTimeSyncResp(WorldPacket& recvData)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "CMSG_TIME_SYNC_RESP");
#endif
uint32 counter, clientTimestamp;
recvData >> counter >> clientTimestamp;

View File

@@ -41,9 +41,7 @@ void WorldSession::HandleTabardVendorActivateOpcode(WorldPacket& recvData)
Creature* unit = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_TABARDDESIGNER);
if (!unit)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: HandleTabardVendorActivateOpcode - Unit (%s) not found or you can not interact with him.", guid.ToString().c_str());
#endif
return;
}
@@ -65,18 +63,14 @@ void WorldSession::HandleBankerActivateOpcode(WorldPacket& recvData)
{
ObjectGuid guid;
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: Received CMSG_BANKER_ACTIVATE");
#endif
recvData >> guid;
Creature* unit = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_BANKER);
if (!unit)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: HandleBankerActivateOpcode - Unit (%s) not found or you can not interact with him.", guid.ToString().c_str());
#endif
return;
}
@@ -118,16 +112,12 @@ void WorldSession::SendTrainerList(ObjectGuid guid)
void WorldSession::SendTrainerList(ObjectGuid guid, const std::string& strTitle)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: SendTrainerList");
#endif
Creature* unit = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_TRAINER);
if (!unit)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: SendTrainerList - Unit (%s) not found or you can not interact with him.", guid.ToString().c_str());
#endif
return;
}
@@ -139,18 +129,14 @@ void WorldSession::SendTrainerList(ObjectGuid guid, const std::string& strTitle)
if (!ci)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: SendTrainerList - (%s) NO CREATUREINFO!", guid.ToString().c_str());
#endif
return;
}
TrainerSpellData const* trainer_spells = unit->GetTrainerSpells();
if (!trainer_spells)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: SendTrainerList - Training spells not found for creature (%s)", guid.ToString().c_str());
#endif
return;
}
@@ -243,16 +229,12 @@ void WorldSession::HandleTrainerBuySpellOpcode(WorldPacket& recvData)
uint32 spellId = 0;
recvData >> guid >> spellId;
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: Received CMSG_TRAINER_BUY_SPELL Npc %s, learn spell id is: %u", guid.ToString().c_str(), spellId);
#endif
Creature* unit = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_TRAINER);
if (!unit)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: HandleTrainerBuySpellOpcode - Unit (%s) not found or you can not interact with him.", guid.ToString().c_str());
#endif
return;
}
@@ -300,9 +282,7 @@ void WorldSession::HandleTrainerBuySpellOpcode(WorldPacket& recvData)
void WorldSession::HandleGossipHelloOpcode(WorldPacket& recvData)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: Received CMSG_GOSSIP_HELLO");
#endif
ObjectGuid guid;
recvData >> guid;
@@ -310,9 +290,7 @@ void WorldSession::HandleGossipHelloOpcode(WorldPacket& recvData)
Creature* unit = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_NONE);
if (!unit)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: HandleGossipHelloOpcode - Unit (%s) not found or you can not interact with him.", guid.ToString().c_str());
#endif
return;
}
@@ -363,9 +341,7 @@ void WorldSession::HandleGossipHelloOpcode(WorldPacket& recvData)
/*void WorldSession::HandleGossipSelectOptionOpcode(WorldPacket & recvData)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network.opcode", "WORLD: CMSG_GOSSIP_SELECT_OPTION");
#endif
uint32 option;
uint32 unk;
@@ -376,21 +352,15 @@ void WorldSession::HandleGossipHelloOpcode(WorldPacket& recvData)
if (_player->PlayerTalkClass->GossipOptionCoded(option))
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network.opcode", "reading string");
#endif
recvData >> code;
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network.opcode", "string read: %s", code.c_str());
#endif
}
Creature* unit = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_NONE);
if (!unit)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network.opcode", "WORLD: HandleGossipSelectOptionOpcode - Unit (%s) not found or you can't interact with him.", guid.ToString().c_str());
#endif
return;
}
@@ -412,9 +382,7 @@ void WorldSession::HandleGossipHelloOpcode(WorldPacket& recvData)
void WorldSession::HandleSpiritHealerActivateOpcode(WorldPacket& recvData)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: CMSG_SPIRIT_HEALER_ACTIVATE");
#endif
ObjectGuid guid;
@@ -423,9 +391,7 @@ void WorldSession::HandleSpiritHealerActivateOpcode(WorldPacket& recvData)
Creature* unit = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_SPIRITHEALER);
if (!unit)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: HandleSpiritHealerActivateOpcode - Unit (%s) not found or you can not interact with him.", guid.ToString().c_str());
#endif
return;
}
@@ -481,9 +447,7 @@ void WorldSession::HandleBinderActivateOpcode(WorldPacket& recvData)
Creature* unit = GetPlayer()->GetNPCIfCanInteractWith(npcGUID, UNIT_NPC_FLAG_INNKEEPER);
if (!unit)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: HandleBinderActivateOpcode - Unit (%s) not found or you can not interact with him.", npcGUID.ToString().c_str());
#endif
return;
}
@@ -515,9 +479,7 @@ void WorldSession::SendBindPoint(Creature* npc)
void WorldSession::HandleListStabledPetsOpcode(WorldPacket& recvData)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: Recv MSG_LIST_STABLED_PETS");
#endif
ObjectGuid npcGUID;
recvData >> npcGUID;
@@ -553,9 +515,7 @@ void WorldSession::SendStablePetCallback(PreparedQueryResult result, ObjectGuid
if (!GetPlayer())
return;
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: Recv MSG_LIST_STABLED_PETS Send.");
#endif
WorldPacket data(MSG_LIST_STABLED_PETS, 200); // guess size
@@ -628,9 +588,7 @@ void WorldSession::SendStableResult(uint8 res)
void WorldSession::HandleStablePet(WorldPacket& recvData)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: Recv CMSG_STABLE_PET");
#endif
ObjectGuid npcGUID;
recvData >> npcGUID;
@@ -735,9 +693,7 @@ void WorldSession::HandleStablePetCallback(PreparedQueryResult result)
void WorldSession::HandleUnstablePet(WorldPacket& recvData)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: Recv CMSG_UNSTABLE_PET.");
#endif
ObjectGuid npcGUID;
uint32 petnumber;
@@ -838,9 +794,7 @@ void WorldSession::HandleUnstablePetCallback(PreparedQueryResult result, uint32
void WorldSession::HandleBuyStableSlot(WorldPacket& recvData)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: Recv CMSG_BUY_STABLE_SLOT.");
#endif
ObjectGuid npcGUID;
recvData >> npcGUID;
@@ -873,16 +827,12 @@ void WorldSession::HandleBuyStableSlot(WorldPacket& recvData)
void WorldSession::HandleStableRevivePet(WorldPacket& /* recvData */)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "HandleStableRevivePet: Not implemented");
#endif
}
void WorldSession::HandleStableSwapPet(WorldPacket& recvData)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: Recv CMSG_STABLE_SWAP_PET.");
#endif
ObjectGuid npcGUID;
uint32 petId;
@@ -993,9 +943,7 @@ void WorldSession::HandleStableSwapPetCallback(PreparedQueryResult result, uint3
void WorldSession::HandleRepairItemOpcode(WorldPacket& recvData)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: CMSG_REPAIR_ITEM");
#endif
ObjectGuid npcGUID, itemGUID;
uint8 guildBank; // new in 2.3.2, bool that means from guild bank money
@@ -1005,9 +953,7 @@ void WorldSession::HandleRepairItemOpcode(WorldPacket& recvData)
Creature* unit = GetPlayer()->GetNPCIfCanInteractWith(npcGUID, UNIT_NPC_FLAG_REPAIR);
if (!unit)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: HandleRepairItemOpcode - Unit (%s) not found or you can not interact with him.", npcGUID.ToString().c_str());
#endif
return;
}
@@ -1022,9 +968,7 @@ void WorldSession::HandleRepairItemOpcode(WorldPacket& recvData)
if (itemGUID)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "ITEM: Repair item, item %s, npc %s", itemGUID.ToString().c_str(), npcGUID.ToString().c_str());
#endif
Item* item = _player->GetItemByGuid(itemGUID);
if (item)
@@ -1032,9 +976,7 @@ void WorldSession::HandleRepairItemOpcode(WorldPacket& recvData)
}
else
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "ITEM: Repair all items, npc %s", npcGUID.ToString().c_str());
#endif
_player->DurabilityRepairAll(true, discountMod, guildBank);
}
}

View File

@@ -147,7 +147,7 @@ uint8 WorldSession::HandleLoadPetFromDBFirstCallback(PreparedQueryResult result,
owner->GetClosePoint(px, py, pz, pet->GetObjectSize(), PET_FOLLOW_DIST, pet->GetFollowAngle());
if (!pet->IsPositionValid())
{
LOG_ERROR("server", "Pet (%s, entry %d) not loaded. Suggested coordinates isn't valid (X: %f Y: %f)",
LOG_ERROR("network.opcode", "Pet (%s, entry %d) not loaded. Suggested coordinates isn't valid (X: %f Y: %f)",
pet->GetGUID().ToString().c_str(), pet->GetEntry(), pet->GetPositionX(), pet->GetPositionY());
delete pet;
delete holder;
@@ -204,7 +204,7 @@ uint8 WorldSession::HandleLoadPetFromDBFirstCallback(PreparedQueryResult result,
break;
default:
if (!pet->IsPetGhoul())
LOG_ERROR("server", "Pet have incorrect type (%u) for pet loading.", pet->getPetType());
LOG_ERROR("network.opcode", "Pet have incorrect type (%u) for pet loading.", pet->getPetType());
break;
}
@@ -365,18 +365,14 @@ void WorldSession::HandleDismissCritter(WorldPacket& recvData)
ObjectGuid guid;
recvData >> guid;
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: Received CMSG_DISMISS_CRITTER for %s", guid.ToString().c_str());
#endif
Unit* pet = ObjectAccessor::GetCreatureOrPetOrVehicle(*_player, guid);
if (!pet)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "Vanitypet (%s) does not exist - player %s (%s / account: %u) attempted to dismiss it (possibly lagged out)",
guid.ToString().c_str(), GetPlayer()->GetName().c_str(), GetPlayer()->GetGUID().ToString().c_str(), GetAccountId());
#endif
return;
}
@@ -401,19 +397,17 @@ void WorldSession::HandlePetAction(WorldPacket& recvData)
// used also for charmed creature
Unit* pet = ObjectAccessor::GetUnit(*_player, guid1);
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("server", "HandlePetAction: Pet %s - flag: %u, spellid: %u, target: %s.", guid1.ToString().c_str(), uint32(flag), spellid, guid2.ToString().c_str());
#endif
LOG_DEBUG("network.opcode", "HandlePetAction: Pet %s - flag: %u, spellid: %u, target: %s.", guid1.ToString().c_str(), uint32(flag), spellid, guid2.ToString().c_str());
if (!pet)
{
LOG_ERROR("server", "HandlePetAction: Pet (%s) doesn't exist for player %s", guid1.ToString().c_str(), GetPlayer()->GetName().c_str());
LOG_ERROR("network.opcode", "HandlePetAction: Pet (%s) doesn't exist for player %s", guid1.ToString().c_str(), GetPlayer()->GetName().c_str());
return;
}
if (pet != GetPlayer()->GetFirstControlled())
{
LOG_ERROR("server", "HandlePetAction: Pet (%s) does not belong to player %s", guid1.ToString().c_str(), GetPlayer()->GetName().c_str());
LOG_ERROR("network.opcode", "HandlePetAction: Pet (%s) does not belong to player %s", guid1.ToString().c_str(), GetPlayer()->GetName().c_str());
return;
}
@@ -457,21 +451,19 @@ void WorldSession::HandlePetStopAttack(WorldPacket& recvData)
ObjectGuid guid;
recvData >> guid;
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: Received CMSG_PET_STOP_ATTACK for %s", guid.ToString().c_str());
#endif
Unit* pet = ObjectAccessor::GetCreatureOrPetOrVehicle(*_player, guid);
if (!pet)
{
LOG_ERROR("server", "HandlePetStopAttack: Pet %s does not exist", guid.ToString().c_str());
LOG_ERROR("network.opcode", "HandlePetStopAttack: Pet %s does not exist", guid.ToString().c_str());
return;
}
if (pet != GetPlayer()->GetPet() && pet != GetPlayer()->GetCharm())
{
LOG_ERROR("server", "HandlePetStopAttack: Pet %s isn't a pet or charmed creature of player %s", guid.ToString().c_str(), GetPlayer()->GetName().c_str());
LOG_ERROR("network.opcode", "HandlePetStopAttack: Pet %s isn't a pet or charmed creature of player %s", guid.ToString().c_str(), GetPlayer()->GetName().c_str());
return;
}
@@ -487,7 +479,7 @@ void WorldSession::HandlePetActionHelper(Unit* pet, ObjectGuid guid1, uint16 spe
CharmInfo* charmInfo = pet->GetCharmInfo();
if (!charmInfo)
{
LOG_ERROR("server", "WorldSession::HandlePetAction(petGuid: %s, tagGuid: %s, spellId: %u, flag: %u): object (%s) is considered pet-like but doesn't have a charminfo!",
LOG_ERROR("network.opcode", "WorldSession::HandlePetAction(petGuid: %s, tagGuid: %s, spellId: %u, flag: %u): object (%s) is considered pet-like but doesn't have a charminfo!",
guid1.ToString().c_str(), guid2.ToString().c_str(), spellid, flag, pet->GetGUID().ToString().c_str());
return;
}
@@ -644,7 +636,7 @@ void WorldSession::HandlePetActionHelper(Unit* pet, ObjectGuid guid1, uint16 spe
}
break;
default:
LOG_ERROR("server", "WORLD: unknown PET flag Action %i and spellid %i.", uint32(flag), spellid);
LOG_ERROR("network.opcode", "WORLD: unknown PET flag Action %i and spellid %i.", uint32(flag), spellid);
}
break;
case ACT_REACTION: // 0x6
@@ -676,7 +668,7 @@ void WorldSession::HandlePetActionHelper(Unit* pet, ObjectGuid guid1, uint16 spe
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellid);
if (!spellInfo)
{
LOG_ERROR("server", "WORLD: unknown PET spell id %i", spellid);
LOG_ERROR("network.opcode", "WORLD: unknown PET spell id %i", spellid);
return;
}
@@ -907,15 +899,13 @@ void WorldSession::HandlePetActionHelper(Unit* pet, ObjectGuid guid1, uint16 spe
break;
}
default:
LOG_ERROR("server", "WORLD: unknown PET flag Action %i and spellid %i.", uint32(flag), spellid);
LOG_ERROR("network.opcode", "WORLD: unknown PET flag Action %i and spellid %i.", uint32(flag), spellid);
}
}
void WorldSession::HandlePetNameQuery(WorldPacket& recvData)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("server", "HandlePetNameQuery. CMSG_PET_NAME_QUERY");
#endif
LOG_DEBUG("network.opcode", "HandlePetNameQuery. CMSG_PET_NAME_QUERY");
uint32 petnumber;
ObjectGuid petguid;
@@ -977,9 +967,7 @@ bool WorldSession::CheckStableMaster(ObjectGuid guid)
{
if (!GetPlayer()->IsGameMaster() && !GetPlayer()->HasAuraType(SPELL_AURA_OPEN_STABLE))
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("server", "Player (%s) attempt open stable in cheating way.", guid.ToString().c_str());
#endif
LOG_DEBUG("network.opcode", "Player (%s) attempt open stable in cheating way.", guid.ToString().c_str());
return false;
}
}
@@ -988,9 +976,7 @@ bool WorldSession::CheckStableMaster(ObjectGuid guid)
{
if (!GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_STABLEMASTER))
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("server", "Stablemaster (%s) not found or you can't interact with him.", guid.ToString().c_str());
#endif
LOG_DEBUG("network.opcode", "Stablemaster (%s) not found or you can't interact with him.", guid.ToString().c_str());
return false;
}
}
@@ -999,9 +985,7 @@ bool WorldSession::CheckStableMaster(ObjectGuid guid)
void WorldSession::HandlePetSetAction(WorldPacket& recvData)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("server", "HandlePetSetAction. CMSG_PET_SET_ACTION");
#endif
LOG_DEBUG("network.opcode", "HandlePetSetAction. CMSG_PET_SET_ACTION");
ObjectGuid petguid;
uint8 count;
@@ -1011,7 +995,7 @@ void WorldSession::HandlePetSetAction(WorldPacket& recvData)
Unit* checkPet = ObjectAccessor::GetUnit(*_player, petguid);
if (!checkPet || checkPet != _player->GetFirstControlled())
{
LOG_ERROR("server", "HandlePetSetAction: Unknown pet (%s) or pet owner (%s)", petguid.ToString().c_str(), _player->GetGUID().ToString().c_str());
LOG_ERROR("network.opcode", "HandlePetSetAction: Unknown pet (%s) or pet owner (%s)", petguid.ToString().c_str(), _player->GetGUID().ToString().c_str());
return;
}
@@ -1060,7 +1044,7 @@ void WorldSession::HandlePetSetAction(WorldPacket& recvData)
CharmInfo* charmInfo = pet->GetCharmInfo();
if (!charmInfo)
{
LOG_ERROR("server", "WorldSession::HandlePetSetAction: object (%s TypeId: %u) is considered pet-like but doesn't have a charminfo!",
LOG_ERROR("network.opcode", "WorldSession::HandlePetSetAction: object (%s TypeId: %u) is considered pet-like but doesn't have a charminfo!",
pet->GetGUID().ToString().c_str(), pet->GetTypeId());
continue;
}
@@ -1145,9 +1129,7 @@ void WorldSession::HandlePetSetAction(WorldPacket& recvData)
void WorldSession::HandlePetRename(WorldPacket& recvData)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("server", "HandlePetRename. CMSG_PET_RENAME");
#endif
LOG_DEBUG("network.opcode", "HandlePetRename. CMSG_PET_RENAME");
ObjectGuid petguid;
uint8 isdeclined;
@@ -1237,9 +1219,7 @@ void WorldSession::HandlePetAbandon(WorldPacket& recvData)
{
ObjectGuid guid;
recvData >> guid; //pet guid
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("server", "HandlePetAbandon. CMSG_PET_ABANDON pet is %s", guid.ToString().c_str());
#endif
LOG_DEBUG("network.opcode", "HandlePetAbandon. CMSG_PET_ABANDON pet is %s", guid.ToString().c_str());
if (!_player->IsInWorld())
return;
@@ -1265,9 +1245,7 @@ void WorldSession::HandlePetAbandon(WorldPacket& recvData)
void WorldSession::HandlePetSpellAutocastOpcode(WorldPacket& recvPacket)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("server", "CMSG_PET_SPELL_AUTOCAST");
#endif
LOG_DEBUG("network.opcode", "CMSG_PET_SPELL_AUTOCAST");
ObjectGuid guid;
uint32 spellid;
uint8 state; //1 for on, 0 for off
@@ -1286,7 +1264,7 @@ void WorldSession::HandlePetSpellAutocastOpcode(WorldPacket& recvPacket)
Creature* checkPet = ObjectAccessor::GetCreatureOrPetOrVehicle(*_player, guid);
if (!checkPet || (checkPet != _player->GetGuardianPet() && checkPet != _player->GetCharm()))
{
LOG_ERROR("server", "HandlePetSpellAutocastOpcode.Pet %s isn't pet of player %s .", guid.ToString().c_str(), GetPlayer()->GetName().c_str());
LOG_ERROR("network.opcode", "HandlePetSpellAutocastOpcode.Pet %s isn't pet of player %s .", guid.ToString().c_str(), GetPlayer()->GetName().c_str());
return;
}
@@ -1310,7 +1288,7 @@ void WorldSession::HandlePetSpellAutocastOpcode(WorldPacket& recvPacket)
CharmInfo* charmInfo = pet->GetCharmInfo();
if (!charmInfo)
{
LOG_ERROR("server", "WorldSession::HandlePetSpellAutocastOpcod: object (%s TypeId: %u) is considered pet-like but doesn't have a charminfo!",
LOG_ERROR("network.opcode", "WorldSession::HandlePetSpellAutocastOpcod: object (%s TypeId: %u) is considered pet-like but doesn't have a charminfo!",
pet->GetGUID().ToString().c_str(), pet->GetTypeId());
continue;
}
@@ -1326,9 +1304,7 @@ void WorldSession::HandlePetSpellAutocastOpcode(WorldPacket& recvPacket)
void WorldSession::HandlePetCastSpellOpcode(WorldPacket& recvPacket)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: CMSG_PET_CAST_SPELL");
#endif
ObjectGuid guid;
uint8 castCount;
@@ -1337,9 +1313,7 @@ void WorldSession::HandlePetCastSpellOpcode(WorldPacket& recvPacket)
recvPacket >> guid >> castCount >> spellId >> castFlags;
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: CMSG_PET_CAST_SPELL, guid: %s, castCount: %u, spellId %u, castFlags %u", guid.ToString().c_str(), castCount, spellId, castFlags);
#endif
// This opcode is also sent from charmed and possessed units (players and creatures)
if (!_player->GetGuardianPet() && !_player->GetCharm())
@@ -1349,14 +1323,14 @@ void WorldSession::HandlePetCastSpellOpcode(WorldPacket& recvPacket)
if (!caster || (caster != _player->GetGuardianPet() && caster != _player->GetCharm()))
{
LOG_ERROR("server", "HandlePetCastSpellOpcode: Pet %s isn't pet of player %s .", guid.ToString().c_str(), GetPlayer()->GetName().c_str());
LOG_ERROR("network.opcode", "HandlePetCastSpellOpcode: Pet %s isn't pet of player %s .", guid.ToString().c_str(), GetPlayer()->GetName().c_str());
return;
}
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId);
if (!spellInfo)
{
LOG_ERROR("server", "WORLD: unknown PET spell id %i", spellId);
LOG_ERROR("network.opcode", "WORLD: unknown PET spell id %i", spellId);
return;
}
@@ -1447,9 +1421,7 @@ void WorldSession::SendPetNameInvalid(uint32 error, const std::string& name, Dec
void WorldSession::HandlePetLearnTalent(WorldPacket& recvData)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: CMSG_PET_LEARN_TALENT");
#endif
ObjectGuid guid;
uint32 talent_id, requested_rank;
@@ -1461,9 +1433,7 @@ void WorldSession::HandlePetLearnTalent(WorldPacket& recvData)
void WorldSession::HandleLearnPreviewTalentsPet(WorldPacket& recvData)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "CMSG_LEARN_PREVIEW_TALENTS_PET");
#endif
ObjectGuid guid;
recvData >> guid;

View File

@@ -21,9 +21,7 @@
void WorldSession::HandlePetitionBuyOpcode(WorldPacket& recvData)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "Received opcode CMSG_PETITION_BUY");
#endif
ObjectGuid guidNPC;
uint32 clientIndex; // 1 for guild and arenaslot+1 for arenas in client
@@ -52,17 +50,13 @@ void WorldSession::HandlePetitionBuyOpcode(WorldPacket& recvData)
recvData >> clientIndex; // index
recvData.read_skip<uint32>(); // 0
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "Petitioner (%s) tried sell petition: name %s", guidNPC.ToString().c_str(), name.c_str());
#endif
// prevent cheating
Creature* creature = GetPlayer()->GetNPCIfCanInteractWith(guidNPC, UNIT_NPC_FLAG_PETITIONER);
if (!creature)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: HandlePetitionBuyOpcode - Unit (%s) not found or you can't interact with him.", guidNPC.ToString().c_str());
#endif
return;
}
@@ -111,9 +105,7 @@ void WorldSession::HandlePetitionBuyOpcode(WorldPacket& recvData)
type = ARENA_TEAM_CHARTER_5v5_TYPE;
break;
default:
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "unknown selection at buy arena petition: %u", clientIndex);
#endif
return;
}
@@ -197,9 +189,7 @@ void WorldSession::HandlePetitionBuyOpcode(WorldPacket& recvData)
if (petition)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "Invalid petition: %s", petition->petitionGuid.ToString().c_str());
#endif
trans->PAppend("DELETE FROM petition WHERE petitionguid = %u", petition->petitionGuid);
trans->PAppend("DELETE FROM petition_sign WHERE petitionguid = %u", petition->petitionGuid);
@@ -224,9 +214,7 @@ void WorldSession::HandlePetitionBuyOpcode(WorldPacket& recvData)
void WorldSession::HandlePetitionShowSignOpcode(WorldPacket& recvData)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "Received opcode CMSG_PETITION_SHOW_SIGNATURES");
#endif
ObjectGuid petitionguid;
recvData >> petitionguid; // petition guid
@@ -265,17 +253,13 @@ void WorldSession::HandlePetitionShowSignOpcode(WorldPacket& recvData)
void WorldSession::HandlePetitionQueryOpcode(WorldPacket& recvData)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "Received opcode CMSG_PETITION_QUERY"); // ok
#endif
ObjectGuid::LowType guildguid;
ObjectGuid petitionguid;
recvData >> guildguid; // in Trinity always same as petition low guid
recvData >> petitionguid; // petition guid
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "CMSG_PETITION_QUERY Petition (%s) Guild GUID %u", petitionguid.ToString().c_str(), guildguid);
#endif
SendPetitionQueryOpcode(petitionguid);
}
@@ -285,9 +269,7 @@ void WorldSession::SendPetitionQueryOpcode(ObjectGuid petitionguid)
Petition const* petition = sPetitionMgr->GetPetition(petitionguid);
if (!petition)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "CMSG_PETITION_QUERY failed for petition (%s)", petitionguid.ToString().c_str());
#endif
return;
}
@@ -331,9 +313,7 @@ void WorldSession::SendPetitionQueryOpcode(ObjectGuid petitionguid)
void WorldSession::HandlePetitionRenameOpcode(WorldPacket& recvData)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "Received opcode MSG_PETITION_RENAME"); // ok
#endif
ObjectGuid petitionGuid;
std::string newName;
@@ -348,9 +328,7 @@ void WorldSession::HandlePetitionRenameOpcode(WorldPacket& recvData)
Petition const* petition = sPetitionMgr->GetPetition(petitionGuid);
if (!petition)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "CMSG_PETITION_QUERY failed for petition (%s)", petitionGuid.ToString().c_str());
#endif
return;
}
@@ -391,9 +369,7 @@ void WorldSession::HandlePetitionRenameOpcode(WorldPacket& recvData)
// xinef: update petition container
const_cast<Petition*>(petition)->petitionName = newName;
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "Petition (%s) renamed to %s", petitionGuid.ToString().c_str(), newName.c_str());
#endif
WorldPacket data(MSG_PETITION_RENAME, (8 + newName.size() + 1));
data << petitionGuid;
data << newName;
@@ -402,9 +378,7 @@ void WorldSession::HandlePetitionRenameOpcode(WorldPacket& recvData)
void WorldSession::HandlePetitionSignOpcode(WorldPacket& recvData)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "Received opcode CMSG_PETITION_SIGN"); // ok
#endif
ObjectGuid petitionGuid;
uint8 unk;
@@ -414,7 +388,7 @@ void WorldSession::HandlePetitionSignOpcode(WorldPacket& recvData)
Petition const* petition = sPetitionMgr->GetPetition(petitionGuid);
if (!petition)
{
LOG_ERROR("server", "Petition %s is not found for player %s (Name: %s)", petitionGuid.ToString().c_str(), GetPlayer()->GetGUID().ToString().c_str(), GetPlayer()->GetName().c_str());
LOG_ERROR("network.opcode", "Petition %s is not found for player %s (Name: %s)", petitionGuid.ToString().c_str(), GetPlayer()->GetGUID().ToString().c_str(), GetPlayer()->GetName().c_str());
return;
}
@@ -519,9 +493,7 @@ void WorldSession::HandlePetitionSignOpcode(WorldPacket& recvData)
// xinef: fill petition store
sPetitionMgr->AddSignature(petitionGuid, GetAccountId(), playerGuid);
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "PETITION SIGN: %s by player: %s (%s, Account: %u)", petitionGuid.ToString().c_str(), _player->GetName().c_str(), playerGuid.ToString().c_str(), GetAccountId());
#endif
WorldPacket data(SMSG_PETITION_SIGN_RESULTS, (8 + 8 + 4));
data << petitionGuid;
@@ -543,16 +515,12 @@ void WorldSession::HandlePetitionSignOpcode(WorldPacket& recvData)
void WorldSession::HandlePetitionDeclineOpcode(WorldPacket& recvData)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "Received opcode MSG_PETITION_DECLINE"); // ok
#endif
ObjectGuid petitionguid;
ObjectGuid ownerguid;
recvData >> petitionguid; // petition guid
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "Petition %s declined by %s", petitionguid.ToString().c_str(), _player->GetGUID().ToString().c_str());
#endif
Petition const* petition = sPetitionMgr->GetPetition(petitionguid);
if (!petition)
@@ -568,9 +536,7 @@ void WorldSession::HandlePetitionDeclineOpcode(WorldPacket& recvData)
void WorldSession::HandleOfferPetitionOpcode(WorldPacket& recvData)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "Received opcode CMSG_OFFER_PETITION"); // ok
#endif
ObjectGuid petitionguid, plguid;
uint32 junk;
@@ -658,9 +624,7 @@ void WorldSession::HandleOfferPetitionOpcode(WorldPacket& recvData)
void WorldSession::HandleTurnInPetitionOpcode(WorldPacket& recvData)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "Received opcode CMSG_TURN_IN_PETITION");
#endif
// Get petition guid from packet
WorldPacket data;
@@ -673,14 +637,12 @@ void WorldSession::HandleTurnInPetitionOpcode(WorldPacket& recvData)
if (!item)
return;
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "Petition %s turned in by %s", petitionGuid.ToString().c_str(), _player->GetGUID().ToString().c_str());
#endif
Petition const* petition = sPetitionMgr->GetPetition(petitionGuid);
if (!petition)
{
LOG_ERROR("server", "Player %s (%s) tried to turn in petition (%s) that is not present in the database",
LOG_ERROR("network.opcode", "Player %s (%s) tried to turn in petition (%s) that is not present in the database",
_player->GetName().c_str(), _player->GetGUID().ToString().c_str(), petitionGuid.ToString().c_str());
return;
}
@@ -799,17 +761,13 @@ void WorldSession::HandleTurnInPetitionOpcode(WorldPacket& recvData)
// Register arena team
sArenaTeamMgr->AddArenaTeam(arenaTeam);
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "PetitonsHandler: Arena team (guid: %u) added to ObjectMgr", arenaTeam->GetId());
#endif
// Add members
if (signs)
for (SignatureMap::const_iterator itr = signatureCopy.begin(); itr != signatureCopy.end(); ++itr)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "PetitionsHandler: Adding arena team (guid: %u) member %s", arenaTeam->GetId(), itr->first.ToString().c_str());
#endif
arenaTeam->AddMember(itr->first);
}
}
@@ -830,9 +788,7 @@ void WorldSession::HandleTurnInPetitionOpcode(WorldPacket& recvData)
sPetitionMgr->RemovePetition(petitionGuid);
// created
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "TURN IN PETITION %s", petitionGuid.ToString().c_str());
#endif
data.Initialize(SMSG_TURN_IN_PETITION_RESULTS, 4);
data << (uint32)PETITION_TURN_OK;
@@ -841,9 +797,7 @@ void WorldSession::HandleTurnInPetitionOpcode(WorldPacket& recvData)
void WorldSession::HandlePetitionShowListOpcode(WorldPacket& recvData)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "Received CMSG_PETITION_SHOWLIST");
#endif
ObjectGuid guid;
recvData >> guid;
@@ -856,9 +810,7 @@ void WorldSession::SendPetitionShowList(ObjectGuid guid)
Creature* creature = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_PETITIONER);
if (!creature)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: HandlePetitionShowListOpcode - Unit (%s) not found or you can't interact with him.", guid.ToString().c_str());
#endif
return;
}
@@ -929,7 +881,5 @@ void WorldSession::SendPetitionShowList(ObjectGuid guid)
}
SendPacket(&data);
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "Sent SMSG_PETITION_SHOWLIST");
#endif
}

View File

@@ -58,7 +58,7 @@ void WorldSession::HandleNameQueryOpcode(WorldPacket& recvData)
recvData >> guid;
// This is disable by default to prevent lots of console spam
// LOG_INFO("server", "HandleNameQueryOpcode %u", guid);
// LOG_INFO("network.opcode", "HandleNameQueryOpcode %u", guid);
SendNameQueryOpcode(guid);
}
@@ -134,15 +134,11 @@ void WorldSession::HandleCreatureQueryOpcode(WorldPacket& recvData)
}
else
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: CMSG_CREATURE_QUERY - NO CREATURE INFO! (%s)", guid.ToString().c_str());
#endif
WorldPacket data(SMSG_CREATURE_QUERY_RESPONSE, 4);
data << uint32(entry | 0x80000000);
SendPacket(&data);
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: Sent SMSG_CREATURE_QUERY_RESPONSE");
#endif
}
}
@@ -173,9 +169,7 @@ void WorldSession::HandleGameObjectQueryOpcode(WorldPacket& recvData)
ObjectMgr::GetLocaleString(gameObjectLocale->CastBarCaption, localeConstant, CastBarCaption);
}
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: CMSG_GAMEOBJECT_QUERY '%s' - Entry: %u. ", info->name.c_str(), entry);
#endif
WorldPacket data (SMSG_GAMEOBJECT_QUERY_RESPONSE, 150);
data << uint32(entry);
data << uint32(info->type);
@@ -197,29 +191,21 @@ void WorldSession::HandleGameObjectQueryOpcode(WorldPacket& recvData)
data << uint32(0);
SendPacket(&data);
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: Sent SMSG_GAMEOBJECT_QUERY_RESPONSE");
#endif
}
else
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: CMSG_GAMEOBJECT_QUERY - Missing gameobject info for (%s)", guid.ToString().c_str());
#endif
WorldPacket data (SMSG_GAMEOBJECT_QUERY_RESPONSE, 4);
data << uint32(entry | 0x80000000);
SendPacket(&data);
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: Sent SMSG_GAMEOBJECT_QUERY_RESPONSE");
#endif
}
}
void WorldSession::HandleCorpseQueryOpcode(WorldPacket& /*recvData*/)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: Received MSG_CORPSE_QUERY");
#endif
if (!_player->HasCorpse())
{
@@ -273,9 +259,7 @@ void WorldSession::HandleNpcTextQueryOpcode(WorldPacket& recvData)
ObjectGuid guid;
recvData >> textID;
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: CMSG_NPC_TEXT_QUERY TextId: %u", textID);
#endif
recvData >> guid;
@@ -352,17 +336,13 @@ void WorldSession::HandleNpcTextQueryOpcode(WorldPacket& recvData)
SendPacket(&data);
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: Sent SMSG_NPC_TEXT_UPDATE");
#endif
}
/// Only _static_ data is sent in this packet !!!
void WorldSession::HandlePageTextQueryOpcode(WorldPacket& recvData)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: Received CMSG_PAGE_TEXT_QUERY");
#endif
uint32 pageID;
recvData >> pageID;
@@ -396,17 +376,13 @@ void WorldSession::HandlePageTextQueryOpcode(WorldPacket& recvData)
}
SendPacket(&data);
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: Sent SMSG_PAGE_TEXT_QUERY_RESPONSE");
#endif
}
}
void WorldSession::HandleCorpseMapPositionQuery(WorldPacket& recvData)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: Recv CMSG_CORPSE_MAP_POSITION_QUERY");
#endif
uint32 unk;
recvData >> unk;

View File

@@ -33,9 +33,7 @@ void WorldSession::HandleQuestgiverStatusQueryOpcode(WorldPacket& recvData)
Object* questGiver = ObjectAccessor::GetObjectByTypeMask(*_player, guid, TYPEMASK_UNIT | TYPEMASK_GAMEOBJECT);
if (!questGiver)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("server", "Error in CMSG_QUESTGIVER_STATUS_QUERY, called for not found questgiver (%s)", guid.ToString().c_str());
#endif
LOG_DEBUG("network.opcode", "Error in CMSG_QUESTGIVER_STATUS_QUERY, called for not found questgiver (%s)", guid.ToString().c_str());
return;
}
@@ -43,23 +41,19 @@ void WorldSession::HandleQuestgiverStatusQueryOpcode(WorldPacket& recvData)
{
case TYPEID_UNIT:
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: Received CMSG_QUESTGIVER_STATUS_QUERY for npc %s", guid.ToString().c_str());
#endif
if (!questGiver->ToCreature()->IsHostileTo(_player)) // do not show quest status to enemies
questStatus = _player->GetQuestDialogStatus(questGiver);
break;
}
case TYPEID_GAMEOBJECT:
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: Received CMSG_QUESTGIVER_STATUS_QUERY for GameObject %s", guid.ToString().c_str());
#endif
questStatus = _player->GetQuestDialogStatus(questGiver);
break;
}
default:
LOG_ERROR("server", "QuestGiver called for unexpected type %u", questGiver->GetTypeId());
LOG_ERROR("network.opcode", "QuestGiver called for unexpected type %u", questGiver->GetTypeId());
break;
}
@@ -72,16 +66,12 @@ void WorldSession::HandleQuestgiverHelloOpcode(WorldPacket& recvData)
ObjectGuid guid;
recvData >> guid;
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: Received CMSG_QUESTGIVER_HELLO npc %s", guid.ToString().c_str());
#endif
Creature* creature = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_NONE);
if (!creature)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: HandleQuestgiverHelloOpcode - Unit (%s) not found or you can't interact with him.", guid.ToString().c_str());
#endif
return;
}
@@ -113,9 +103,7 @@ void WorldSession::HandleQuestgiverAcceptQuestOpcode(WorldPacket& recvData)
uint32 unk1;
recvData >> guid >> questId >> unk1;
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: Received CMSG_QUESTGIVER_ACCEPT_QUEST npc %s, quest = %u, unk1 = %u", guid.ToString().c_str(), questId, unk1);
#endif
Object* object = ObjectAccessor::GetObjectByTypeMask(*_player, guid, TYPEMASK_UNIT | TYPEMASK_GAMEOBJECT | TYPEMASK_ITEM | TYPEMASK_PLAYER);
@@ -204,9 +192,7 @@ void WorldSession::HandleQuestgiverQueryQuestOpcode(WorldPacket& recvData)
uint32 questId;
uint8 unk1;
recvData >> guid >> questId >> unk1;
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: Received CMSG_QUESTGIVER_QUERY_QUEST npc %s, quest = %u, unk1 = %u", guid.ToString().c_str(), questId, unk1);
#endif
// Verify that the guid is valid and is a questgiver or involved in the requested quest
Object* object = ObjectAccessor::GetObjectByTypeMask(*_player, guid, TYPEMASK_UNIT | TYPEMASK_GAMEOBJECT | TYPEMASK_ITEM);
@@ -241,9 +227,7 @@ void WorldSession::HandleQuestQueryOpcode(WorldPacket& recvData)
uint32 questId;
recvData >> questId;
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: Received CMSG_QUEST_QUERY quest = %u", questId);
#endif
if (Quest const* quest = sObjectMgr->GetQuestTemplate(questId))
_player->PlayerTalkClass->SendQuestQueryResponse(quest);
@@ -257,14 +241,12 @@ void WorldSession::HandleQuestgiverChooseRewardOpcode(WorldPacket& recvData)
if (reward >= QUEST_REWARD_CHOICES_COUNT)
{
LOG_ERROR("server", "Error in CMSG_QUESTGIVER_CHOOSE_REWARD: player %s (%s) tried to get invalid reward (%u) (probably packet hacking)",
LOG_ERROR("network.opcode", "Error in CMSG_QUESTGIVER_CHOOSE_REWARD: player %s (%s) tried to get invalid reward (%u) (probably packet hacking)",
_player->GetName().c_str(), _player->GetGUID().ToString().c_str(), reward);
return;
}
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: Received CMSG_QUESTGIVER_CHOOSE_REWARD npc %s, quest = %u, reward = %u", guid.ToString().c_str(), questId, reward);
#endif
Object* object = ObjectAccessor::GetObjectByTypeMask(*_player, guid, TYPEMASK_UNIT | TYPEMASK_GAMEOBJECT);
if (!object || !object->hasInvolvedQuest(questId))
@@ -279,7 +261,7 @@ void WorldSession::HandleQuestgiverChooseRewardOpcode(WorldPacket& recvData)
if ((!_player->CanSeeStartQuest(quest) && _player->GetQuestStatus(questId) == QUEST_STATUS_NONE) ||
(_player->GetQuestStatus(questId) != QUEST_STATUS_COMPLETE && !quest->IsAutoComplete()))
{
LOG_ERROR("server", "HACK ALERT: Player %s (%s) is trying to complete quest (id: %u) but he has no right to do it!",
LOG_ERROR("network.opcode", "HACK ALERT: Player %s (%s) is trying to complete quest (id: %u) but he has no right to do it!",
_player->GetName().c_str(), _player->GetGUID().ToString().c_str(), questId);
return;
}
@@ -356,9 +338,7 @@ void WorldSession::HandleQuestgiverRequestRewardOpcode(WorldPacket& recvData)
ObjectGuid guid;
recvData >> guid >> questId;
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: Received CMSG_QUESTGIVER_REQUEST_REWARD npc %s, quest = %u", guid.ToString().c_str(), questId);
#endif
Object* object = ObjectAccessor::GetObjectByTypeMask(*_player, guid, TYPEMASK_UNIT | TYPEMASK_GAMEOBJECT);
if (!object || !object->hasInvolvedQuest(questId))
@@ -380,9 +360,7 @@ void WorldSession::HandleQuestgiverRequestRewardOpcode(WorldPacket& recvData)
void WorldSession::HandleQuestgiverCancel(WorldPacket& /*recvData*/)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: Received CMSG_QUESTGIVER_CANCEL");
#endif
_player->PlayerTalkClass->SendCloseGossip();
}
@@ -395,9 +373,7 @@ void WorldSession::HandleQuestLogSwapQuest(WorldPacket& recvData)
if (slot1 == slot2 || slot1 >= MAX_QUEST_LOG_SIZE || slot2 >= MAX_QUEST_LOG_SIZE)
return;
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: Received CMSG_QUESTLOG_SWAP_QUEST slot 1 = %u, slot 2 = %u", slot1, slot2);
#endif
GetPlayer()->SwapQuestSlot(slot1, slot2);
}
@@ -407,9 +383,7 @@ void WorldSession::HandleQuestLogRemoveQuest(WorldPacket& recvData)
uint8 slot;
recvData >> slot;
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: Received CMSG_QUESTLOG_REMOVE_QUEST slot = %u", slot);
#endif
if (slot < MAX_QUEST_LOG_SIZE)
{
@@ -437,9 +411,7 @@ void WorldSession::HandleQuestLogRemoveQuest(WorldPacket& recvData)
#ifdef ELUNA
sEluna->OnQuestAbandon(_player, questId);
#endif
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("server", "Player %s abandoned quest %u", _player->GetGUID().ToString().c_str(), questId);
#endif
LOG_DEBUG("network.opcode", "Player %s abandoned quest %u", _player->GetGUID().ToString().c_str(), questId);
// check if Quest Tracker is enabled
if (sWorld->getBoolConfig(CONFIG_QUEST_ENABLE_QUEST_TRACKER))
{
@@ -464,9 +436,7 @@ void WorldSession::HandleQuestConfirmAccept(WorldPacket& recvData)
uint32 questId;
recvData >> questId;
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: Received CMSG_QUEST_CONFIRM_ACCEPT quest = %u", questId);
#endif
if (Quest const* quest = sObjectMgr->GetQuestTemplate(questId))
{
@@ -503,9 +473,7 @@ void WorldSession::HandleQuestgiverCompleteQuest(WorldPacket& recvData)
recvData >> guid >> questId;
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: Received CMSG_QUESTGIVER_COMPLETE_QUEST npc %s, quest = %u", guid.ToString().c_str(), questId);
#endif
Object* object = ObjectAccessor::GetObjectByTypeMask(*_player, guid, TYPEMASK_UNIT | TYPEMASK_GAMEOBJECT);
if (!object || !object->hasInvolvedQuest(questId))
@@ -519,7 +487,7 @@ void WorldSession::HandleQuestgiverCompleteQuest(WorldPacket& recvData)
{
if (!_player->CanSeeStartQuest(quest) && _player->GetQuestStatus(questId) == QUEST_STATUS_NONE)
{
LOG_ERROR("server", "Possible hacking attempt: Player %s [%s] tried to complete quest [entry: %u] without being in possession of the quest!",
LOG_ERROR("network.opcode", "Possible hacking attempt: Player %s [%s] tried to complete quest [entry: %u] without being in possession of the quest!",
_player->GetName().c_str(), _player->GetGUID().ToString().c_str(), questId);
return;
}
@@ -547,9 +515,7 @@ void WorldSession::HandleQuestgiverCompleteQuest(WorldPacket& recvData)
void WorldSession::HandleQuestgiverQuestAutoLaunch(WorldPacket& /*recvPacket*/)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: Received CMSG_QUESTGIVER_QUEST_AUTOLAUNCH");
#endif
}
void WorldSession::HandlePushQuestToParty(WorldPacket& recvPacket)
@@ -560,9 +526,7 @@ void WorldSession::HandlePushQuestToParty(WorldPacket& recvPacket)
if (!_player->CanShareQuest(questId))
return;
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: Received CMSG_PUSHQUESTTOPARTY quest = %u", questId);
#endif
if (Quest const* quest = sObjectMgr->GetQuestTemplate(questId))
{
@@ -640,9 +604,7 @@ void WorldSession::HandleQuestPushResult(WorldPacket& recvPacket)
uint8 msg;
recvPacket >> guid >> questId >> msg;
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: Received MSG_QUEST_PUSH_RESULT");
#endif
if (_player->GetDivider() && _player->GetDivider() == guid)
{
@@ -659,9 +621,7 @@ void WorldSession::HandleQuestPushResult(WorldPacket& recvPacket)
void WorldSession::HandleQuestgiverStatusMultipleQuery(WorldPacket& /*recvPacket*/)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: Received CMSG_QUESTGIVER_STATUS_MULTIPLE_QUERY");
#endif
uint32 count = 0;

View File

@@ -11,9 +11,7 @@
void WorldSession::HandleGrantLevel(WorldPacket& recvData)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: CMSG_GRANT_LEVEL");
#endif
ObjectGuid guid;
recvData >> guid.ReadAsPacked();
@@ -56,9 +54,7 @@ void WorldSession::HandleGrantLevel(WorldPacket& recvData)
void WorldSession::HandleAcceptGrantLevel(WorldPacket& recvData)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: CMSG_ACCEPT_LEVEL_GRANT");
#endif
ObjectGuid guid;
recvData >> guid.ReadAsPacked();

View File

@@ -22,9 +22,7 @@ void WorldSession::HandleLearnTalentOpcode(WorldPacket& recvData)
void WorldSession::HandleLearnPreviewTalents(WorldPacket& recvPacket)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "CMSG_LEARN_PREVIEW_TALENTS");
#endif
uint32 talentsCount;
recvPacket >> talentsCount;
@@ -48,18 +46,14 @@ void WorldSession::HandleLearnPreviewTalents(WorldPacket& recvPacket)
void WorldSession::HandleTalentWipeConfirmOpcode(WorldPacket& recvData)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "MSG_TALENT_WIPE_CONFIRM");
#endif
ObjectGuid guid;
recvData >> guid;
Creature* unit = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_TRAINER);
if (!unit)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: HandleTalentWipeConfirmOpcode - Unit (%s) not found or you can't interact with him.", guid.ToString().c_str());
#endif
return;
}

View File

@@ -84,9 +84,7 @@ void WorldSession::HandleUseItemOpcode(WorldPacket& recvPacket)
return;
}
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: CMSG_USE_ITEM packet, bagIndex: %u, slot: %u, castCount: %u, spellId: %u, Item: %u, glyphIndex: %u, data length = %i", bagIndex, slot, castCount, spellId, pItem->GetEntry(), glyphIndex, (uint32)recvPacket.size());
#endif
ItemTemplate const* proto = pItem->GetTemplate();
if (!proto)
@@ -162,9 +160,7 @@ void WorldSession::HandleUseItemOpcode(WorldPacket& recvPacket)
void WorldSession::HandleOpenItemOpcode(WorldPacket& recvPacket)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: CMSG_OPEN_ITEM packet, data length = %i", (uint32)recvPacket.size());
#endif
Player* pUser = _player;
@@ -183,9 +179,7 @@ void WorldSession::HandleOpenItemOpcode(WorldPacket& recvPacket)
recvPacket >> bagIndex >> slot;
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("server", "bagIndex: %u, slot: %u", bagIndex, slot);
#endif
LOG_DEBUG("network.opcode", "bagIndex: %u, slot: %u", bagIndex, slot);
Item* item = pUser->GetItemByPos(bagIndex, slot);
if (!item)
@@ -205,7 +199,7 @@ void WorldSession::HandleOpenItemOpcode(WorldPacket& recvPacket)
if (!(proto->Flags & ITEM_FLAG_HAS_LOOT) && !item->HasFlag(ITEM_FIELD_FLAGS, ITEM_FIELD_FLAG_WRAPPED))
{
pUser->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW, item, nullptr);
LOG_ERROR("server", "Possible hacking attempt: Player %s [%s] tried to open item [%s, entry: %u] which is not openable!",
LOG_ERROR("network.opcode", "Possible hacking attempt: Player %s [%s] tried to open item [%s, entry: %u] which is not openable!",
pUser->GetName().c_str(), pUser->GetGUID().ToString().c_str(), item->GetGUID().ToString().c_str(), proto->ItemId);
return;
}
@@ -219,7 +213,7 @@ void WorldSession::HandleOpenItemOpcode(WorldPacket& recvPacket)
if (!lockInfo)
{
pUser->SendEquipError(EQUIP_ERR_ITEM_LOCKED, item, nullptr);
LOG_ERROR("server", "WORLD::OpenItem: item [%s] has an unknown lockId: %u!", item->GetGUID().ToString().c_str(), lockId);
LOG_ERROR("network.opcode", "WORLD::OpenItem: item [%s] has an unknown lockId: %u!", item->GetGUID().ToString().c_str(), lockId);
return;
}
@@ -260,7 +254,7 @@ void WorldSession::HandleOpenWrappedItemCallback(PreparedQueryResult result, uin
if (!result)
{
LOG_ERROR("server", "Wrapped item %s don't have record in character_gifts table and will deleted", item->GetGUID().ToString().c_str());
LOG_ERROR("network.opcode", "Wrapped item %s don't have record in character_gifts table and will deleted", item->GetGUID().ToString().c_str());
GetPlayer()->DestroyItem(item->GetBagSlot(), item->GetSlot(), true);
return;
}
@@ -291,9 +285,7 @@ void WorldSession::HandleGameObjectUseOpcode(WorldPacket& recvData)
ObjectGuid guid;
recvData >> guid;
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: Recvd CMSG_GAMEOBJ_USE Message [%s]", guid.ToString().c_str());
#endif
if (GameObject* obj = GetPlayer()->GetMap()->GetGameObject(guid))
{
@@ -314,9 +306,7 @@ void WorldSession::HandleGameobjectReportUse(WorldPacket& recvPacket)
ObjectGuid guid;
recvPacket >> guid;
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: Recvd CMSG_GAMEOBJ_REPORT_USE Message [%s]", guid.ToString().c_str());
#endif
// ignore for remote control state
if (_player->m_mover != _player)
@@ -343,9 +333,7 @@ void WorldSession::HandleCastSpellOpcode(WorldPacket& recvPacket)
uint32 oldSpellId = spellId;
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: got cast spell packet, castCount: %u, spellId: %u, castFlags: %u, data length = %u", castCount, spellId, castFlags, (uint32)recvPacket.size());
#endif
// ignore for remote control state (for player case)
Unit* mover = _player->m_mover;
@@ -359,7 +347,7 @@ void WorldSession::HandleCastSpellOpcode(WorldPacket& recvPacket)
if (!spellInfo)
{
LOG_ERROR("server", "WORLD: unknown spell id %u", spellId);
LOG_ERROR("network.opcode", "WORLD: unknown spell id %u", spellId);
recvPacket.rfinish(); // prevent spam at ignore packet
return;
}
@@ -504,7 +492,7 @@ void WorldSession::HandlePetCancelAuraOpcode(WorldPacket& recvPacket)
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId);
if (!spellInfo)
{
LOG_ERROR("server", "WORLD: unknown PET spell id %u", spellId);
LOG_ERROR("network.opcode", "WORLD: unknown PET spell id %u", spellId);
return;
}
@@ -512,13 +500,13 @@ void WorldSession::HandlePetCancelAuraOpcode(WorldPacket& recvPacket)
if (!pet)
{
LOG_ERROR("server", "HandlePetCancelAura: Attempt to cancel an aura for non-existant pet %s by player %s", guid.ToString().c_str(), GetPlayer()->GetName().c_str());
LOG_ERROR("network.opcode", "HandlePetCancelAura: Attempt to cancel an aura for non-existant pet %s by player %s", guid.ToString().c_str(), GetPlayer()->GetName().c_str());
return;
}
if (pet != GetPlayer()->GetGuardianPet() && pet != GetPlayer()->GetCharm())
{
LOG_ERROR("server", "HandlePetCancelAura: Pet %s is not a pet of player %s", guid.ToString().c_str(), GetPlayer()->GetName().c_str());
LOG_ERROR("network.opcode", "HandlePetCancelAura: Pet %s is not a pet of player %s", guid.ToString().c_str(), GetPlayer()->GetName().c_str());
return;
}
@@ -581,9 +569,7 @@ void WorldSession::HandleTotemDestroyed(WorldPacket& recvPacket)
void WorldSession::HandleSelfResOpcode(WorldPacket& /*recvData*/)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: CMSG_SELF_RES"); // empty opcode
#endif
if (_player->HasAuraType(SPELL_AURA_PREVENT_RESURRECTION))
return; // silent return, client should display error by itself and not send this opcode
@@ -621,9 +607,7 @@ void WorldSession::HandleSpellClick(WorldPacket& recvData)
void WorldSession::HandleMirrorImageDataRequest(WorldPacket& recvData)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: CMSG_GET_MIRRORIMAGE_DATA");
#endif
ObjectGuid guid;
recvData >> guid;
@@ -716,9 +700,7 @@ void WorldSession::HandleMirrorImageDataRequest(WorldPacket& recvData)
void WorldSession::HandleUpdateProjectilePosition(WorldPacket& recvPacket)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: CMSG_UPDATE_PROJECTILE_POSITION");
#endif
ObjectGuid casterGuid;
uint32 spellId;

View File

@@ -15,9 +15,7 @@
void WorldSession::HandleTaxiNodeStatusQueryOpcode(WorldPacket& recvData)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: Received CMSG_TAXINODE_STATUS_QUERY");
#endif
ObjectGuid guid;
@@ -31,9 +29,7 @@ void WorldSession::SendTaxiStatus(ObjectGuid guid)
Creature* unit = GetPlayer()->GetMap()->GetCreature(guid);
if (!unit)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WorldSession::SendTaxiStatus - Unit (%s) not found.", guid.ToString().c_str());
#endif
return;
}
@@ -43,24 +39,18 @@ void WorldSession::SendTaxiStatus(ObjectGuid guid)
if (curloc == 0)
return;
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: current location %u ", curloc);
#endif
WorldPacket data(SMSG_TAXINODE_STATUS, 9);
data << guid;
data << uint8(GetPlayer()->m_taxi.IsTaximaskNodeKnown(curloc) ? 1 : 0);
SendPacket(&data);
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: Sent SMSG_TAXINODE_STATUS");
#endif
}
void WorldSession::HandleTaxiQueryAvailableNodes(WorldPacket& recvData)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: Received CMSG_TAXIQUERYAVAILABLENODES");
#endif
ObjectGuid guid;
recvData >> guid;
@@ -69,9 +59,7 @@ void WorldSession::HandleTaxiQueryAvailableNodes(WorldPacket& recvData)
Creature* unit = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_FLIGHTMASTER);
if (!unit)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: HandleTaxiQueryAvailableNodes - Unit (%s) not found or you can't interact with him.", guid.ToString().c_str());
#endif
return;
}
@@ -98,9 +86,7 @@ void WorldSession::SendTaxiMenu(Creature* unit)
bool lastTaxiCheaterState = GetPlayer()->isTaxiCheater();
if (unit->GetEntry() == 29480) GetPlayer()->SetTaxiCheater(true); // Grimwing in Ebon Hold, special case. NOTE: Not perfect, Zul'Aman should not be included according to WoWhead, and I think taxicheat includes it.
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: CMSG_TAXINODE_STATUS_QUERY %u ", curloc);
#endif
WorldPacket data(SMSG_SHOWTAXINODES, (4 + 8 + 4 + 8 * 4));
data << uint32(1);
@@ -109,9 +95,7 @@ void WorldSession::SendTaxiMenu(Creature* unit)
GetPlayer()->m_taxi.AppendTaximaskTo(data, GetPlayer()->isTaxiCheater());
SendPacket(&data);
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: Sent SMSG_SHOWTAXINODES");
#endif
GetPlayer()->SetTaxiCheater(lastTaxiCheaterState);
}
@@ -168,9 +152,7 @@ void WorldSession::SendDiscoverNewTaxiNode(uint32 nodeid)
void WorldSession::HandleActivateTaxiExpressOpcode (WorldPacket& recvData)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: Received CMSG_ACTIVATETAXIEXPRESS");
#endif
ObjectGuid guid;
uint32 node_count;
@@ -180,9 +162,7 @@ void WorldSession::HandleActivateTaxiExpressOpcode (WorldPacket& recvData)
Creature* npc = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_FLIGHTMASTER);
if (!npc)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: HandleActivateTaxiExpressOpcode - Unit (%s) not found or you can't interact with it.", guid.ToString().c_str());
#endif
return;
}
std::vector<uint32> nodes;
@@ -205,18 +185,14 @@ void WorldSession::HandleActivateTaxiExpressOpcode (WorldPacket& recvData)
if (nodes.empty())
return;
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: Received CMSG_ACTIVATETAXIEXPRESS from %d to %d", nodes.front(), nodes.back());
#endif
GetPlayer()->ActivateTaxiPathTo(nodes, npc, 0);
}
void WorldSession::HandleMoveSplineDoneOpcode(WorldPacket& recvData)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: Received CMSG_MOVE_SPLINE_DONE");
#endif
ObjectGuid guid; // used only for proper packet read
recvData >> guid.ReadAsPacked();
@@ -230,24 +206,18 @@ void WorldSession::HandleMoveSplineDoneOpcode(WorldPacket& recvData)
void WorldSession::HandleActivateTaxiOpcode(WorldPacket& recvData)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: Received CMSG_ACTIVATETAXI");
#endif
ObjectGuid guid;
std::vector<uint32> nodes;
nodes.resize(2);
recvData >> guid >> nodes[0] >> nodes[1];
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: Received CMSG_ACTIVATETAXI from %d to %d", nodes[0], nodes[1]);
#endif
Creature* npc = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_FLIGHTMASTER);
if (!npc)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: HandleActivateTaxiOpcode - Unit (%s) not found or you can't interact with it.", guid.ToString().c_str());
#endif
return;
}
@@ -269,7 +239,5 @@ void WorldSession::SendActivateTaxiReply(ActivateTaxiReply reply)
data << uint32(reply);
SendPacket(&data);
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: Sent SMSG_ACTIVATETAXIREPLY");
#endif
}

View File

@@ -77,7 +77,7 @@ void WorldSession::HandleGMTicketCreateOpcode(WorldPacket& recvData)
}
else
{
LOG_ERROR("server", "CMSG_GMTICKET_CREATE possibly corrupt. Uncompression failed.");
LOG_ERROR("network.opcode", "CMSG_GMTICKET_CREATE possibly corrupt. Uncompression failed.");
recvData.rfinish();
return;
}

View File

@@ -57,17 +57,13 @@ void WorldSession::SendTradeStatus(TradeStatus status)
void WorldSession::HandleIgnoreTradeOpcode(WorldPacket& /*recvPacket*/)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: Ignore Trade %s", _player->GetGUID().ToString().c_str());
#endif
// recvPacket.print_storage();
}
void WorldSession::HandleBusyTradeOpcode(WorldPacket& /*recvPacket*/)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: Busy Trade %s", _player->GetGUID().ToString().c_str());
#endif
// recvPacket.print_storage();
}
@@ -142,9 +138,7 @@ void WorldSession::moveItems(Item* myItems[], Item* hisItems[])
if (myItems[i])
{
// logging
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "partner storing: %s", myItems[i]->GetGUID().ToString().c_str());
#endif
// adjust time (depends on /played)
if (myItems[i]->HasFlag(ITEM_FIELD_FLAGS, ITEM_FIELD_FLAG_BOP_TRADEABLE))
@@ -155,9 +149,7 @@ void WorldSession::moveItems(Item* myItems[], Item* hisItems[])
if (hisItems[i])
{
// logging
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "player storing: %s", hisItems[i]->GetGUID().ToString().c_str());
#endif
// adjust time (depends on /played)
if (hisItems[i]->HasFlag(ITEM_FIELD_FLAGS, ITEM_FIELD_FLAG_BOP_TRADEABLE))
@@ -173,21 +165,21 @@ void WorldSession::moveItems(Item* myItems[], Item* hisItems[])
if (myItems[i])
{
if (!traderCanTrade)
LOG_ERROR("server", "trader can't store item: %s", myItems[i]->GetGUID().ToString().c_str());
LOG_ERROR("network.opcode", "trader can't store item: %s", myItems[i]->GetGUID().ToString().c_str());
if (_player->CanStoreItem(NULL_BAG, NULL_SLOT, playerDst, myItems[i], false) == EQUIP_ERR_OK)
_player->MoveItemToInventory(playerDst, myItems[i], true, true);
else
LOG_ERROR("server", "player can't take item back: %s", myItems[i]->GetGUID().ToString().c_str());
LOG_ERROR("network.opcode", "player can't take item back: %s", myItems[i]->GetGUID().ToString().c_str());
}
// return the already removed items to the original owner
if (hisItems[i])
{
if (!playerCanTrade)
LOG_ERROR("server", "player can't store item: %s", hisItems[i]->GetGUID().ToString().c_str());
LOG_ERROR("network.opcode", "player can't store item: %s", hisItems[i]->GetGUID().ToString().c_str());
if (trader->CanStoreItem(NULL_BAG, NULL_SLOT, traderDst, hisItems[i], false) == EQUIP_ERR_OK)
trader->MoveItemToInventory(traderDst, hisItems[i], true, true);
else
LOG_ERROR("server", "trader can't take item back: %s", hisItems[i]->GetGUID().ToString().c_str());
LOG_ERROR("network.opcode", "trader can't take item back: %s", hisItems[i]->GetGUID().ToString().c_str());
}
}
}
@@ -205,9 +197,7 @@ static void setAcceptTradeMode(TradeData* myTrade, TradeData* hisTrade, Item * *
{
if (Item* item = myTrade->GetItem(TradeSlots(i)))
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("server", "player trade item %s bag: %u slot: %u", item->GetGUID().ToString().c_str(), item->GetBagSlot(), item->GetSlot());
#endif
LOG_DEBUG("network.opcode", "player trade item %s bag: %u slot: %u", item->GetGUID().ToString().c_str(), item->GetBagSlot(), item->GetSlot());
//Can return nullptr
myItems[i] = item;
myItems[i]->SetInTrade();
@@ -215,9 +205,7 @@ static void setAcceptTradeMode(TradeData* myTrade, TradeData* hisTrade, Item * *
if (Item* item = hisTrade->GetItem(TradeSlots(i)))
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("server", "partner trade item %s bag: %u slot: %u", item->GetGUID().ToString().c_str(), item->GetBagSlot(), item->GetSlot());
#endif
LOG_DEBUG("network.opcode", "partner trade item %s bag: %u slot: %u", item->GetGUID().ToString().c_str(), item->GetBagSlot(), item->GetSlot());
hisItems[i] = item;
hisItems[i]->SetInTrade();
}

View File

@@ -14,9 +14,7 @@
void WorldSession::HandleDismissControlledVehicle(WorldPacket& recvData)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: Recvd CMSG_DISMISS_CONTROLLED_VEHICLE");
#endif
ObjectGuid vehicleGUID = _player->GetCharmGUID();
@@ -48,9 +46,7 @@ void WorldSession::HandleDismissControlledVehicle(WorldPacket& recvData)
void WorldSession::HandleChangeSeatsOnControlledVehicle(WorldPacket& recvData)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: Recvd CMSG_CHANGE_SEATS_ON_CONTROLLED_VEHICLE");
#endif
Unit* vehicle_base = GetPlayer()->GetVehicleBase();
if (!vehicle_base)
@@ -63,7 +59,7 @@ void WorldSession::HandleChangeSeatsOnControlledVehicle(WorldPacket& recvData)
if (!seat->CanSwitchFromSeat())
{
recvData.rfinish(); // prevent warnings spam
LOG_ERROR("server", "HandleChangeSeatsOnControlledVehicle, Opcode: %u, Player %s tried to switch seats but current seatflags %u don't permit that.",
LOG_ERROR("network.opcode", "HandleChangeSeatsOnControlledVehicle, Opcode: %u, Player %s tried to switch seats but current seatflags %u don't permit that.",
recvData.GetOpcode(), GetPlayer()->GetGUID().ToString().c_str(), seat->m_flags);
return;
}
@@ -158,7 +154,7 @@ void WorldSession::HandleEjectPassenger(WorldPacket& data)
if (!vehicle)
{
data.rfinish(); // prevent warnings spam
LOG_ERROR("server", "HandleEjectPassenger: Player %s is not in a vehicle!", GetPlayer()->GetGUID().ToString().c_str());
LOG_ERROR("network.opcode", "HandleEjectPassenger: Player %s is not in a vehicle!", GetPlayer()->GetGUID().ToString().c_str());
return;
}
@@ -170,13 +166,13 @@ void WorldSession::HandleEjectPassenger(WorldPacket& data)
Player* player = ObjectAccessor::GetPlayer(*_player, guid);
if (!player)
{
LOG_ERROR("server", "Player %s tried to eject player %s from vehicle, but the latter was not found in world!", GetPlayer()->GetGUID().ToString().c_str(), guid.ToString().c_str());
LOG_ERROR("network.opcode", "Player %s tried to eject player %s from vehicle, but the latter was not found in world!", GetPlayer()->GetGUID().ToString().c_str(), guid.ToString().c_str());
return;
}
if (!player->IsOnVehicle(vehicle->GetBase()))
{
LOG_ERROR("server", "Player %s tried to eject player %s, but they are not in the same vehicle", GetPlayer()->GetGUID().ToString().c_str(), guid.ToString().c_str());
LOG_ERROR("network.opcode", "Player %s tried to eject player %s, but they are not in the same vehicle", GetPlayer()->GetGUID().ToString().c_str(), guid.ToString().c_str());
return;
}
@@ -185,20 +181,20 @@ void WorldSession::HandleEjectPassenger(WorldPacket& data)
if (seat->IsEjectable())
player->ExitVehicle();
else
LOG_ERROR("server", "Player %s attempted to eject player %s from non-ejectable seat.", GetPlayer()->GetGUID().ToString().c_str(), guid.ToString().c_str());
LOG_ERROR("network.opcode", "Player %s attempted to eject player %s from non-ejectable seat.", GetPlayer()->GetGUID().ToString().c_str(), guid.ToString().c_str());
}
else if (guid.IsCreature())
{
Unit* unit = ObjectAccessor::GetUnit(*_player, guid);
if (!unit) // creatures can be ejected too from player mounts
{
LOG_ERROR("server", "Player %s tried to eject creature guid %s from vehicle, but the latter was not found in world!", GetPlayer()->GetGUID().ToString().c_str(), guid.ToString().c_str());
LOG_ERROR("network.opcode", "Player %s tried to eject creature guid %s from vehicle, but the latter was not found in world!", GetPlayer()->GetGUID().ToString().c_str(), guid.ToString().c_str());
return;
}
if (!unit->IsOnVehicle(vehicle->GetBase()))
{
LOG_ERROR("server", "Player %s tried to eject unit %s, but they are not in the same vehicle", GetPlayer()->GetGUID().ToString().c_str(), guid.ToString().c_str());
LOG_ERROR("network.opcode", "Player %s tried to eject unit %s, but they are not in the same vehicle", GetPlayer()->GetGUID().ToString().c_str(), guid.ToString().c_str());
return;
}
@@ -210,17 +206,15 @@ void WorldSession::HandleEjectPassenger(WorldPacket& data)
unit->ExitVehicle();
}
else
LOG_ERROR("server", "Player %s attempted to eject creature %s from non-ejectable seat.", GetPlayer()->GetGUID().ToString().c_str(), guid.ToString().c_str());
LOG_ERROR("network.opcode", "Player %s attempted to eject creature %s from non-ejectable seat.", GetPlayer()->GetGUID().ToString().c_str(), guid.ToString().c_str());
}
else
LOG_ERROR("server", "HandleEjectPassenger: Player %s tried to eject invalid %s", GetPlayer()->GetGUID().ToString().c_str(), guid.ToString().c_str());
LOG_ERROR("network.opcode", "HandleEjectPassenger: Player %s tried to eject invalid %s", GetPlayer()->GetGUID().ToString().c_str(), guid.ToString().c_str());
}
void WorldSession::HandleRequestVehicleExit(WorldPacket& /*recvData*/)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: Recvd CMSG_REQUEST_VEHICLE_EXIT");
#endif
if (Vehicle* vehicle = GetPlayer()->GetVehicle())
{
@@ -229,7 +223,7 @@ void WorldSession::HandleRequestVehicleExit(WorldPacket& /*recvData*/)
if (seat->CanEnterOrExit())
GetPlayer()->ExitVehicle();
else
LOG_ERROR("server", "Player %s tried to exit vehicle, but seatflags %u (ID: %u) don't permit that.",
LOG_ERROR("network.opcode", "Player %s tried to exit vehicle, but seatflags %u (ID: %u) don't permit that.",
GetPlayer()->GetGUID().ToString().c_str(), seat->m_ID, seat->m_flags);
}
}

View File

@@ -10,9 +10,7 @@
void WorldSession::HandleVoiceSessionEnableOpcode(WorldPacket& recvData)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: CMSG_VOICE_SESSION_ENABLE");
#endif
// uint8 isVoiceEnabled, uint8 isMicrophoneEnabled
recvData.read_skip<uint8>();
recvData.read_skip<uint8>();
@@ -20,17 +18,13 @@ void WorldSession::HandleVoiceSessionEnableOpcode(WorldPacket& recvData)
void WorldSession::HandleChannelVoiceOnOpcode(WorldPacket& /*recvData*/)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: CMSG_CHANNEL_VOICE_ON");
#endif
// Enable Voice button in channel context menu
}
void WorldSession::HandleSetActiveVoiceChannel(WorldPacket& recvData)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
LOG_DEBUG("network", "WORLD: CMSG_SET_ACTIVE_VOICE_CHANNEL");
#endif
recvData.read_skip<uint32>();
recvData.read_skip<char*>();
}