mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-22 10:05:32 +01:00
Core/Logging: Fix incorrect error level for some warden messages
Core/Logging: Fix incorrect filter type for many network messages Core/Logging: Use OPCODE filter type for network messages related to wrong packets
This commit is contained in:
@@ -205,8 +205,8 @@ LoginDatabase.WorkerThreads = 1
|
||||
# w - (Overwrite)
|
||||
#
|
||||
|
||||
Appender.Console=1,2,6
|
||||
Appender.Auth=2,2,7,Auth.log,w
|
||||
Appender.Console=1,2,0
|
||||
Appender.Auth=2,2,0,Auth.log,w
|
||||
|
||||
# LogLevel
|
||||
# 0 - (Disabled)
|
||||
|
||||
@@ -391,14 +391,14 @@ bool AchievementCriteriaData::Meets(uint32 criteria_id, Player const* source, Un
|
||||
Map* map = source->GetMap();
|
||||
if (!map->IsDungeon())
|
||||
{
|
||||
sLog->outError(LOG_FILTER_SQL, "Achievement system call ACHIEVEMENT_CRITERIA_DATA_INSTANCE_SCRIPT (%u) for achievement criteria %u for non-dungeon/non-raid map %u",
|
||||
sLog->outError(LOG_FILTER_ACHIEVEMENTSYS, "Achievement system call ACHIEVEMENT_CRITERIA_DATA_INSTANCE_SCRIPT (%u) for achievement criteria %u for non-dungeon/non-raid map %u",
|
||||
ACHIEVEMENT_CRITERIA_DATA_INSTANCE_SCRIPT, criteria_id, map->GetId());
|
||||
return false;
|
||||
}
|
||||
InstanceScript* instance = ((InstanceMap*)map)->GetInstanceScript();
|
||||
if (!instance)
|
||||
{
|
||||
sLog->outError(LOG_FILTER_SQL, "Achievement system call ACHIEVEMENT_CRITERIA_DATA_INSTANCE_SCRIPT (%u) for achievement criteria %u for map %u but map does not have a instance script",
|
||||
sLog->outError(LOG_FILTER_ACHIEVEMENTSYS, "Achievement system call ACHIEVEMENT_CRITERIA_DATA_INSTANCE_SCRIPT (%u) for achievement criteria %u for map %u but map does not have a instance script",
|
||||
ACHIEVEMENT_CRITERIA_DATA_INSTANCE_SCRIPT, criteria_id, map->GetId());
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -343,7 +343,7 @@ void ArenaTeam::Disband(WorldSession* session)
|
||||
// Broadcast update
|
||||
if (session)
|
||||
{
|
||||
BroadcastEvent(ERR_ARENA_TEAM_DISBANDED_S, 0, 2, session->GetPlayerName(), GetName(), "");
|
||||
BroadcastEvent(ERR_ARENA_TEAM_DISBANDED_S, 0, 2, session->GetPlayerName().c_str(), GetName(), "");
|
||||
|
||||
if (Player* player = session->GetPlayer())
|
||||
sLog->outInfo(LOG_FILTER_ARENAS, "Player: %s [GUID: %u] disbanded arena team type: %u [Id: %u].", player->GetName(), player->GetGUIDLow(), GetType(), GetId());
|
||||
|
||||
@@ -247,7 +247,7 @@ void WorldSession::HandleAuctionSellItem(WorldPacket & recv_data)
|
||||
if (GetSecurity() > SEC_PLAYER && sWorld->getBoolConfig(CONFIG_GM_LOG_TRADE))
|
||||
{
|
||||
sLog->outCommand(GetAccountId(), "GM %s (Account: %u) create auction: %s (Entry: %u Count: %u)",
|
||||
GetPlayerName(), GetAccountId(), item->GetTemplate()->Name1.c_str(), item->GetEntry(), item->GetCount());
|
||||
GetPlayerName().c_str(), GetAccountId(), item->GetTemplate()->Name1.c_str(), item->GetEntry(), item->GetCount());
|
||||
}
|
||||
|
||||
AH->item_guidlow = item->GetGUIDLow();
|
||||
@@ -293,7 +293,7 @@ void WorldSession::HandleAuctionSellItem(WorldPacket & recv_data)
|
||||
if (GetSecurity() > SEC_PLAYER && sWorld->getBoolConfig(CONFIG_GM_LOG_TRADE))
|
||||
{
|
||||
sLog->outCommand(GetAccountId(), "GM %s (Account: %u) create auction: %s (Entry: %u Count: %u)",
|
||||
GetPlayerName(), GetAccountId(), newItem->GetTemplate()->Name1.c_str(), newItem->GetEntry(), newItem->GetCount());
|
||||
GetPlayerName().c_str(), GetAccountId(), newItem->GetTemplate()->Name1.c_str(), newItem->GetEntry(), newItem->GetCount());
|
||||
}
|
||||
|
||||
AH->item_guidlow = newItem->GetGUIDLow();
|
||||
|
||||
@@ -264,7 +264,7 @@ void WorldSession::HandleSendMail(WorldPacket & recv_data)
|
||||
if (!AccountMgr::IsPlayerAccount(GetSecurity()) && sWorld->getBoolConfig(CONFIG_GM_LOG_TRADE))
|
||||
{
|
||||
sLog->outCommand(GetAccountId(), "GM %s (Account: %u) mail item: %s (Entry: %u Count: %u) to player: %s (Account: %u)",
|
||||
GetPlayerName(), GetAccountId(), item->GetTemplate()->Name1.c_str(), item->GetEntry(), item->GetCount(), receiver.c_str(), rc_account);
|
||||
GetPlayerName().c_str(), GetAccountId(), item->GetTemplate()->Name1.c_str(), item->GetEntry(), item->GetCount(), receiver.c_str(), rc_account);
|
||||
}
|
||||
|
||||
item->SetNotRefundable(GetPlayer()); // makes the item no longer refundable
|
||||
@@ -284,7 +284,7 @@ void WorldSession::HandleSendMail(WorldPacket & recv_data)
|
||||
if (money > 0 && !AccountMgr::IsPlayerAccount(GetSecurity()) && sWorld->getBoolConfig(CONFIG_GM_LOG_TRADE))
|
||||
{
|
||||
sLog->outCommand(GetAccountId(), "GM %s (Account: %u) mail money: %u to player: %s (Account: %u)",
|
||||
GetPlayerName(), GetAccountId(), money, receiver.c_str(), rc_account);
|
||||
GetPlayerName().c_str(), GetAccountId(), money, receiver.c_str(), rc_account);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -479,7 +479,7 @@ void WorldSession::HandleMailTakeItem(WorldPacket & recv_data)
|
||||
sender_name = sObjectMgr->GetTrinityStringForDBCLocale(LANG_UNKNOWN);
|
||||
}
|
||||
sLog->outCommand(GetAccountId(), "GM %s (Account: %u) receive mail item: %s (Entry: %u Count: %u) and send COD money: %u to player: %s (Account: %u)",
|
||||
GetPlayerName(), GetAccountId(), it->GetTemplate()->Name1.c_str(), it->GetEntry(), it->GetCount(), m->COD, sender_name.c_str(), sender_accId);
|
||||
GetPlayerName().c_str(), GetAccountId(), it->GetTemplate()->Name1.c_str(), it->GetEntry(), it->GetCount(), m->COD, sender_name.c_str(), sender_accId);
|
||||
}
|
||||
else if (!receive)
|
||||
sender_accId = sObjectMgr->GetPlayerAccountIdByGUID(sender_guid);
|
||||
|
||||
@@ -1385,5 +1385,13 @@ inline const char* LookupOpcodeName(uint16 id)
|
||||
return "Received unknown opcode, it's more than max!";
|
||||
return opcodeTable[id].name;
|
||||
}
|
||||
|
||||
inline std::string GetOpcodeNameForLogging(uint16 opcode)
|
||||
{
|
||||
std::ostringstream ss;
|
||||
ss << '[' << LookupOpcodeName(opcode) << " 0x" << std::hex << std::uppercase << opcode << std::nouppercase << " (" << std::dec << opcode << ")]";
|
||||
return ss.str().c_str();
|
||||
}
|
||||
|
||||
#endif
|
||||
/// @}
|
||||
|
||||
@@ -137,16 +137,29 @@ WorldSession::~WorldSession()
|
||||
LoginDatabase.PExecute("UPDATE account SET online = 0 WHERE id = %u;", GetAccountId()); // One-time query
|
||||
}
|
||||
|
||||
void WorldSession::SizeError(WorldPacket const& packet, uint32 size) const
|
||||
{
|
||||
sLog->outError(LOG_FILTER_GENERAL, "Client (account %u) send packet %s (%u) with size " SIZEFMTD " but expected %u (attempt to crash server?), skipped",
|
||||
GetAccountId(), LookupOpcodeName(packet.GetOpcode()), packet.GetOpcode(), packet.size(), size);
|
||||
}
|
||||
|
||||
/// Get the player name
|
||||
char const* WorldSession::GetPlayerName() const
|
||||
{
|
||||
return GetPlayer() ? GetPlayer()->GetName() : "<none>";
|
||||
std::string WorldSession::GetPlayerName(bool simple /* = true */) const
|
||||
{
|
||||
std::string name = "[Player: ";
|
||||
uint32 guidLow = 0;
|
||||
|
||||
if (Player* player = GetPlayer())
|
||||
{
|
||||
name.append(player->GetName());
|
||||
guidLow = player->GetGUIDLow();
|
||||
}
|
||||
else
|
||||
name.append("<none>");
|
||||
|
||||
if (!simple)
|
||||
{
|
||||
std::ostringstream ss;
|
||||
ss << " (Guid: " << guidLow << ", Account: " << GetAccountId() << ")";
|
||||
name.append(ss.str());
|
||||
}
|
||||
|
||||
name.append("]");
|
||||
return name;
|
||||
}
|
||||
|
||||
/// Get player guid if available. Use for logging purposes only
|
||||
@@ -208,16 +221,15 @@ void WorldSession::QueuePacket(WorldPacket* new_packet)
|
||||
/// Logging helper for unexpected opcodes
|
||||
void WorldSession::LogUnexpectedOpcode(WorldPacket* packet, const char* status, const char *reason)
|
||||
{
|
||||
sLog->outDebug(LOG_FILTER_NETWORKIO, "SESSION (account: %u, guidlow: %u, char: %s): received unexpected opcode %s (0x%.4X, status: %s) %s",
|
||||
GetAccountId(), m_GUIDLow, _player ? _player->GetName() : "<none>",
|
||||
LookupOpcodeName(packet->GetOpcode()), packet->GetOpcode(), status, reason);
|
||||
sLog->outError(LOG_FILTER_OPCODES, "Received unexpected opcode %s Status: %s Reason: %s from %s",
|
||||
GetOpcodeNameForLogging(packet->GetOpcode()).c_str(), status, reason, GetPlayerName(false).c_str());
|
||||
}
|
||||
|
||||
/// Logging helper for unexpected opcodes
|
||||
void WorldSession::LogUnprocessedTail(WorldPacket* packet)
|
||||
{
|
||||
sLog->outDebug(LOG_FILTER_NETWORKIO, "SESSION: opcode %s (0x%.4X) have unprocessed tail data (read stop at %u from %u)",
|
||||
LookupOpcodeName(packet->GetOpcode()), packet->GetOpcode(), uint32(packet->rpos()), uint32(packet->wpos()));
|
||||
sLog->outError(LOG_FILTER_OPCODES, "Unprocessed tail data (read stop at %u from %u) Opcode %s from %s",
|
||||
uint32(packet->rpos()), uint32(packet->wpos()), GetOpcodeNameForLogging(packet->GetOpcode()).c_str(), GetPlayerName(false).c_str());
|
||||
packet->print_storage();
|
||||
}
|
||||
|
||||
@@ -250,7 +262,8 @@ bool WorldSession::Update(uint32 diff, PacketFilter& updater)
|
||||
{
|
||||
if (packet->GetOpcode() >= NUM_MSG_TYPES)
|
||||
{
|
||||
sLog->outError(LOG_FILTER_GENERAL, "SESSION: received non-existed opcode %s (0x%.4X)", LookupOpcodeName(packet->GetOpcode()), packet->GetOpcode());
|
||||
sLog->outError(LOG_FILTER_OPCODES, "Received non-existed opcode %s from %s", GetOpcodeNameForLogging(packet->GetOpcode()).c_str()
|
||||
, GetPlayerName(false).c_str());
|
||||
sScriptMgr->OnUnknownPacketReceive(m_Socket, WorldPacket(*packet));
|
||||
}
|
||||
else
|
||||
@@ -275,10 +288,9 @@ bool WorldSession::Update(uint32 diff, PacketFilter& updater)
|
||||
deletePacket = false;
|
||||
QueuePacket(packet);
|
||||
//! Log
|
||||
sLog->outDebug(LOG_FILTER_NETWORKIO, "Re-enqueueing packet with opcode %s (0x%.4X) with with status STATUS_LOGGEDIN. "
|
||||
"Player is currently not in world yet.", opHandle.name, packet->GetOpcode());
|
||||
sLog->outDebug(LOG_FILTER_NETWORKIO, "Re-enqueueing packet with opcode %s with with status STATUS_LOGGEDIN. "
|
||||
"Player is currently not in world yet.", GetOpcodeNameForLogging(packet->GetOpcode()).c_str());
|
||||
}
|
||||
|
||||
}
|
||||
else if (_player->IsInWorld())
|
||||
{
|
||||
@@ -334,14 +346,12 @@ bool WorldSession::Update(uint32 diff, PacketFilter& updater)
|
||||
LogUnprocessedTail(packet);
|
||||
break;
|
||||
case STATUS_NEVER:
|
||||
sLog->outDebug(LOG_FILTER_NETWORKIO, "SESSION (account: %u, guidlow: %u, char: %s): received not allowed opcode %s (0x%.4X)",
|
||||
GetAccountId(), m_GUIDLow, _player ? _player->GetName() : "<none>",
|
||||
LookupOpcodeName(packet->GetOpcode()), packet->GetOpcode());
|
||||
sLog->outError(LOG_FILTER_OPCODES, "Received not allowed opcode %s from %s", GetOpcodeNameForLogging(packet->GetOpcode()).c_str()
|
||||
, GetPlayerName(false).c_str());
|
||||
break;
|
||||
case STATUS_UNHANDLED:
|
||||
sLog->outDebug(LOG_FILTER_NETWORKIO, "SESSION (account: %u, guidlow: %u, char: %s): received not handled opcode %s (0x%.4X)",
|
||||
GetAccountId(), m_GUIDLow, _player ? _player->GetName() : "<none>",
|
||||
LookupOpcodeName(packet->GetOpcode()), packet->GetOpcode());
|
||||
sLog->outDebug(LOG_FILTER_OPCODES, "Received not handled opcode %s from %s", GetOpcodeNameForLogging(packet->GetOpcode()).c_str()
|
||||
, GetPlayerName(false).c_str());
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -349,7 +359,6 @@ bool WorldSession::Update(uint32 diff, PacketFilter& updater)
|
||||
{
|
||||
sLog->outError(LOG_FILTER_GENERAL, "WorldSession::Update ByteBufferException occured while parsing a packet (opcode: %u) from client %s, accountid=%i. Skipped packet.",
|
||||
packet->GetOpcode(), GetRemoteAddress().c_str(), GetAccountId());
|
||||
sLog->outTrace(LOG_FILTER_NETWORKIO, "Dumping error causing packet:");
|
||||
packet->hexlike();
|
||||
}
|
||||
}
|
||||
@@ -607,30 +616,26 @@ const char *WorldSession::GetTrinityString(int32 entry) const
|
||||
|
||||
void WorldSession::Handle_NULL(WorldPacket& recvPacket)
|
||||
{
|
||||
sLog->outError(LOG_FILTER_GENERAL, "SESSION: received unhandled opcode %s (0x%.4X)",
|
||||
LookupOpcodeName(recvPacket.GetOpcode()),
|
||||
recvPacket.GetOpcode());
|
||||
sLog->outError(LOG_FILTER_OPCODES, "Received unhandled opcode %s from %s"
|
||||
, GetOpcodeNameForLogging(recvPacket.GetOpcode()).c_str(), GetPlayerName(false).c_str());
|
||||
}
|
||||
|
||||
void WorldSession::Handle_EarlyProccess(WorldPacket& recvPacket)
|
||||
{
|
||||
sLog->outError(LOG_FILTER_GENERAL, "SESSION: received opcode %s (0x%.4X) that must be processed in WorldSocket::OnRead",
|
||||
LookupOpcodeName(recvPacket.GetOpcode()),
|
||||
recvPacket.GetOpcode());
|
||||
sLog->outError(LOG_FILTER_OPCODES, "Received opcode %s that must be processed in WorldSocket::OnRead from %s"
|
||||
, GetOpcodeNameForLogging(recvPacket.GetOpcode()).c_str(), GetPlayerName(false).c_str());
|
||||
}
|
||||
|
||||
void WorldSession::Handle_ServerSide(WorldPacket& recvPacket)
|
||||
{
|
||||
sLog->outError(LOG_FILTER_GENERAL, "SESSION: received server-side opcode %s (0x%.4X)",
|
||||
LookupOpcodeName(recvPacket.GetOpcode()),
|
||||
recvPacket.GetOpcode());
|
||||
sLog->outError(LOG_FILTER_OPCODES, "Received server-side opcode %s from %s"
|
||||
, GetOpcodeNameForLogging(recvPacket.GetOpcode()).c_str(), GetPlayerName(false).c_str());
|
||||
}
|
||||
|
||||
void WorldSession::Handle_Deprecated(WorldPacket& recvPacket)
|
||||
{
|
||||
sLog->outError(LOG_FILTER_GENERAL, "SESSION: received deprecated opcode %s (0x%.4X)",
|
||||
LookupOpcodeName(recvPacket.GetOpcode()),
|
||||
recvPacket.GetOpcode());
|
||||
sLog->outError(LOG_FILTER_OPCODES, "Received deprecated opcode %s from %s"
|
||||
, GetOpcodeNameForLogging(recvPacket.GetOpcode()).c_str(), GetPlayerName(false).c_str());
|
||||
}
|
||||
|
||||
void WorldSession::SendAuthWaitQue(uint32 position)
|
||||
|
||||
@@ -233,8 +233,6 @@ class WorldSession
|
||||
bool PlayerLogoutWithSave() const { return m_playerLogout && m_playerSave; }
|
||||
bool PlayerRecentlyLoggedOut() const { return m_playerRecentlyLogout; }
|
||||
|
||||
void SizeError(WorldPacket const& packet, uint32 size) const;
|
||||
|
||||
void ReadAddonsInfo(WorldPacket& data);
|
||||
void SendAddonsInfo();
|
||||
|
||||
@@ -256,7 +254,7 @@ class WorldSession
|
||||
AccountTypes GetSecurity() const { return _security; }
|
||||
uint32 GetAccountId() const { return _accountId; }
|
||||
Player* GetPlayer() const { return _player; }
|
||||
char const* GetPlayerName() const;
|
||||
std::string GetPlayerName(bool simple = true) const;
|
||||
uint32 GetGuidLow() const;
|
||||
void SetSecurity(AccountTypes security) { _security = security; }
|
||||
std::string const& GetRemoteAddress() { return m_Address; }
|
||||
|
||||
@@ -193,7 +193,7 @@ int WorldSocket::SendPacket(WorldPacket const& pct)
|
||||
|
||||
if (msg_queue()->enqueue_tail(mb, (ACE_Time_Value*)&ACE_Time_Value::zero) == -1)
|
||||
{
|
||||
sLog->outError(LOG_FILTER_GENERAL, "WorldSocket::SendPacket enqueue_tail failed");
|
||||
sLog->outError(LOG_FILTER_NETWORKIO, "WorldSocket::SendPacket enqueue_tail failed");
|
||||
mb->release();
|
||||
return -1;
|
||||
}
|
||||
@@ -236,7 +236,7 @@ int WorldSocket::open (void *a)
|
||||
|
||||
if (peer().get_remote_addr(remote_addr) == -1)
|
||||
{
|
||||
sLog->outError(LOG_FILTER_GENERAL, "WorldSocket::open: peer().get_remote_addr errno = %s", ACE_OS::strerror (errno));
|
||||
sLog->outError(LOG_FILTER_NETWORKIO, "WorldSocket::open: peer().get_remote_addr errno = %s", ACE_OS::strerror (errno));
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -261,7 +261,7 @@ int WorldSocket::open (void *a)
|
||||
// Register with ACE Reactor
|
||||
if (reactor()->register_handler(this, ACE_Event_Handler::READ_MASK | ACE_Event_Handler::WRITE_MASK) == -1)
|
||||
{
|
||||
sLog->outError(LOG_FILTER_GENERAL, "WorldSocket::open: unable to register client handler errno = %s", ACE_OS::strerror (errno));
|
||||
sLog->outError(LOG_FILTER_NETWORKIO, "WorldSocket::open: unable to register client handler errno = %s", ACE_OS::strerror (errno));
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -297,14 +297,14 @@ int WorldSocket::handle_input (ACE_HANDLE)
|
||||
return Update(); // interesting line, isn't it ?
|
||||
}
|
||||
|
||||
sLog->outDebug(LOG_FILTER_GENERAL, "WorldSocket::handle_input: Peer error closing connection errno = %s", ACE_OS::strerror (errno));
|
||||
sLog->outDebug(LOG_FILTER_NETWORKIO, "WorldSocket::handle_input: Peer error closing connection errno = %s", ACE_OS::strerror (errno));
|
||||
|
||||
errno = ECONNRESET;
|
||||
return -1;
|
||||
}
|
||||
case 0:
|
||||
{
|
||||
sLog->outDebug(LOG_FILTER_GENERAL, "WorldSocket::handle_input: Peer has closed connection");
|
||||
sLog->outDebug(LOG_FILTER_NETWORKIO, "WorldSocket::handle_input: Peer has closed connection");
|
||||
|
||||
errno = ECONNRESET;
|
||||
return -1;
|
||||
@@ -373,7 +373,7 @@ int WorldSocket::handle_output_queue (GuardType& g)
|
||||
|
||||
if (msg_queue()->dequeue_head(mblk, (ACE_Time_Value*)&ACE_Time_Value::zero) == -1)
|
||||
{
|
||||
sLog->outError(LOG_FILTER_GENERAL, "WorldSocket::handle_output_queue dequeue_head");
|
||||
sLog->outError(LOG_FILTER_NETWORKIO, "WorldSocket::handle_output_queue dequeue_head");
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -408,7 +408,7 @@ int WorldSocket::handle_output_queue (GuardType& g)
|
||||
|
||||
if (msg_queue()->enqueue_head(mblk, (ACE_Time_Value*) &ACE_Time_Value::zero) == -1)
|
||||
{
|
||||
sLog->outError(LOG_FILTER_GENERAL, "WorldSocket::handle_output_queue enqueue_head");
|
||||
sLog->outError(LOG_FILTER_NETWORKIO, "WorldSocket::handle_output_queue enqueue_head");
|
||||
mblk->release();
|
||||
return -1;
|
||||
}
|
||||
@@ -480,7 +480,7 @@ int WorldSocket::handle_input_header (void)
|
||||
if ((header.size < 4) || (header.size > 10240) || (header.cmd > 10240))
|
||||
{
|
||||
Player* _player = m_Session ? m_Session->GetPlayer() : NULL;
|
||||
sLog->outError(LOG_FILTER_GENERAL, "WorldSocket::handle_input_header(): client (account: %u, char [GUID: %u, name: %s]) sent malformed packet (size: %d, cmd: %d)",
|
||||
sLog->outError(LOG_FILTER_NETWORKIO, "WorldSocket::handle_input_header(): client (account: %u, char [GUID: %u, name: %s]) sent malformed packet (size: %d, cmd: %d)",
|
||||
m_Session ? m_Session->GetAccountId() : 0,
|
||||
_player ? _player->GetGUIDLow() : 0,
|
||||
_player ? _player->GetName() : "<none>",
|
||||
@@ -586,7 +586,7 @@ int WorldSocket::handle_input_missing_data (void)
|
||||
// hope this is not hack, as proper m_RecvWPct is asserted around
|
||||
if (!m_RecvWPct)
|
||||
{
|
||||
sLog->outError(LOG_FILTER_GENERAL, "Forcing close on input m_RecvWPct = NULL");
|
||||
sLog->outError(LOG_FILTER_NETWORKIO, "Forcing close on input m_RecvWPct = NULL");
|
||||
errno = EINVAL;
|
||||
return -1;
|
||||
}
|
||||
@@ -632,7 +632,7 @@ int WorldSocket::cancel_wakeup_output (GuardType& g)
|
||||
(this, ACE_Event_Handler::WRITE_MASK) == -1)
|
||||
{
|
||||
// would be good to store errno from reactor with errno guard
|
||||
sLog->outError(LOG_FILTER_GENERAL, "WorldSocket::cancel_wakeup_output");
|
||||
sLog->outError(LOG_FILTER_NETWORKIO, "WorldSocket::cancel_wakeup_output");
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -651,7 +651,7 @@ int WorldSocket::schedule_wakeup_output (GuardType& g)
|
||||
if (reactor()->schedule_wakeup
|
||||
(this, ACE_Event_Handler::WRITE_MASK) == -1)
|
||||
{
|
||||
sLog->outError(LOG_FILTER_GENERAL, "WorldSocket::schedule_wakeup_output");
|
||||
sLog->outError(LOG_FILTER_NETWORKIO, "WorldSocket::schedule_wakeup_output");
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -683,51 +683,44 @@ int WorldSocket::ProcessIncoming(WorldPacket* new_pct)
|
||||
case CMSG_AUTH_SESSION:
|
||||
if (m_Session)
|
||||
{
|
||||
sLog->outError(LOG_FILTER_GENERAL, "WorldSocket::ProcessIncoming: Player send CMSG_AUTH_SESSION again");
|
||||
sLog->outError(LOG_FILTER_NETWORKIO, "WorldSocket::ProcessIncoming: received duplicate CMSG_AUTH_SESSION from %s", m_Session->GetPlayerName(false).c_str());
|
||||
return -1;
|
||||
}
|
||||
|
||||
sScriptMgr->OnPacketReceive(this, WorldPacket(*new_pct));
|
||||
return HandleAuthSession (*new_pct);
|
||||
case CMSG_KEEP_ALIVE:
|
||||
sLog->outDebug(LOG_FILTER_GENERAL, "CMSG_KEEP_ALIVE, size: " UI64FMTD, uint64(new_pct->size()));
|
||||
sLog->outDebug(LOG_FILTER_NETWORKIO, "%s", GetOpcodeNameForLogging(opcode).c_str());
|
||||
sScriptMgr->OnPacketReceive(this, WorldPacket(*new_pct));
|
||||
return 0;
|
||||
default:
|
||||
{
|
||||
ACE_GUARD_RETURN (LockType, Guard, m_SessionLock, -1);
|
||||
|
||||
if (m_Session != NULL)
|
||||
if (!m_Session)
|
||||
{
|
||||
// Our Idle timer will reset on any non PING opcodes.
|
||||
// Catches people idling on the login screen and any lingering ingame connections.
|
||||
m_Session->ResetTimeOutTime();
|
||||
|
||||
// OK, give the packet to WorldSession
|
||||
aptr.release();
|
||||
// WARNINIG here we call it with locks held.
|
||||
// Its possible to cause deadlock if QueuePacket calls back
|
||||
m_Session->QueuePacket (new_pct);
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
sLog->outError(LOG_FILTER_GENERAL, "WorldSocket::ProcessIncoming: Client not authed opcode = %u", uint32(opcode));
|
||||
sLog->outError(LOG_FILTER_NETWORKIO, "ProcessIncoming: Client not authed opcode = %u", uint32(opcode));
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Our Idle timer will reset on any non PING opcodes.
|
||||
// Catches people idling on the login screen and any lingering ingame connections.
|
||||
m_Session->ResetTimeOutTime();
|
||||
|
||||
// OK, give the packet to WorldSession
|
||||
aptr.release();
|
||||
// WARNINIG here we call it with locks held.
|
||||
// Its possible to cause deadlock if QueuePacket calls back
|
||||
m_Session->QueuePacket(new_pct);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (ByteBufferException &)
|
||||
{
|
||||
sLog->outError(LOG_FILTER_GENERAL, "WorldSocket::ProcessIncoming ByteBufferException occured while parsing an instant handled packet (opcode: %u) from client %s, accountid=%i. Disconnected client.",
|
||||
sLog->outError(LOG_FILTER_NETWORKIO, "WorldSocket::ProcessIncoming ByteBufferException occured while parsing an instant handled packet (opcode: %u) from client %s, accountid=%i. Disconnected client.",
|
||||
opcode, GetRemoteAddress().c_str(), m_Session ? int32(m_Session->GetAccountId()) : -1);
|
||||
if (sLog->ShouldLog(LOG_FILTER_NETWORKIO, LOG_LEVEL_DEBUG))
|
||||
{
|
||||
sLog->outDebug(LOG_FILTER_NETWORKIO, "Dumping error causing packet:");
|
||||
new_pct->hexlike();
|
||||
}
|
||||
|
||||
new_pct->hexlike();
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -758,7 +751,7 @@ int WorldSocket::HandleAuthSession(WorldPacket& recvPacket)
|
||||
packet << uint8(AUTH_REJECT);
|
||||
SendPacket(packet);
|
||||
|
||||
sLog->outError(LOG_FILTER_GENERAL, "WorldSocket::HandleAuthSession: World closed, denying client (%s).", GetRemoteAddress().c_str());
|
||||
sLog->outError(LOG_FILTER_NETWORKIO, "WorldSocket::HandleAuthSession: World closed, denying client (%s).", GetRemoteAddress().c_str());
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -772,7 +765,7 @@ int WorldSocket::HandleAuthSession(WorldPacket& recvPacket)
|
||||
recvPacket >> unk4;
|
||||
recvPacket.read(digest, 20);
|
||||
|
||||
sLog->outDebug(LOG_FILTER_GENERAL, "WorldSocket::HandleAuthSession: client %u, unk2 %u, account %s, unk3 %u, clientseed %u",
|
||||
sLog->outDebug(LOG_FILTER_NETWORKIO, "WorldSocket::HandleAuthSession: client %u, unk2 %u, account %s, unk3 %u, clientseed %u",
|
||||
BuiltNumberClient,
|
||||
unk2,
|
||||
account.c_str(),
|
||||
@@ -794,7 +787,7 @@ int WorldSocket::HandleAuthSession(WorldPacket& recvPacket)
|
||||
|
||||
SendPacket(packet);
|
||||
|
||||
sLog->outError(LOG_FILTER_GENERAL, "WorldSocket::HandleAuthSession: Sent Auth Response (unknown account).");
|
||||
sLog->outError(LOG_FILTER_NETWORKIO, "WorldSocket::HandleAuthSession: Sent Auth Response (unknown account).");
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -814,7 +807,7 @@ int WorldSocket::HandleAuthSession(WorldPacket& recvPacket)
|
||||
const char* sStr = s.AsHexStr(); //Must be freed by OPENSSL_free()
|
||||
const char* vStr = v.AsHexStr(); //Must be freed by OPENSSL_free()
|
||||
|
||||
sLog->outDebug(LOG_FILTER_GENERAL, "WorldSocket::HandleAuthSession: (s, v) check s: %s v: %s",
|
||||
sLog->outDebug(LOG_FILTER_NETWORKIO, "WorldSocket::HandleAuthSession: (s, v) check s: %s v: %s",
|
||||
sStr,
|
||||
vStr);
|
||||
|
||||
@@ -830,7 +823,7 @@ int WorldSocket::HandleAuthSession(WorldPacket& recvPacket)
|
||||
packet << uint8 (AUTH_FAILED);
|
||||
SendPacket(packet);
|
||||
|
||||
sLog->outDebug(LOG_FILTER_GENERAL, "WorldSocket::HandleAuthSession: Sent Auth Response (Account IP differs).");
|
||||
sLog->outDebug(LOG_FILTER_NETWORKIO, "WorldSocket::HandleAuthSession: Sent Auth Response (Account IP differs).");
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
@@ -894,7 +887,7 @@ int WorldSocket::HandleAuthSession(WorldPacket& recvPacket)
|
||||
packet << uint8 (AUTH_BANNED);
|
||||
SendPacket(packet);
|
||||
|
||||
sLog->outError(LOG_FILTER_GENERAL, "WorldSocket::HandleAuthSession: Sent Auth Response (Account banned).");
|
||||
sLog->outError(LOG_FILTER_NETWORKIO, "WorldSocket::HandleAuthSession: Sent Auth Response (Account banned).");
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -908,7 +901,7 @@ int WorldSocket::HandleAuthSession(WorldPacket& recvPacket)
|
||||
|
||||
SendPacket(packet);
|
||||
|
||||
sLog->outInfo(LOG_FILTER_GENERAL, "WorldSocket::HandleAuthSession: User tries to login but his security level is not enough");
|
||||
sLog->outInfo(LOG_FILTER_NETWORKIO, "WorldSocket::HandleAuthSession: User tries to login but his security level is not enough");
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -932,11 +925,11 @@ int WorldSocket::HandleAuthSession(WorldPacket& recvPacket)
|
||||
|
||||
SendPacket(packet);
|
||||
|
||||
sLog->outError(LOG_FILTER_GENERAL, "WorldSocket::HandleAuthSession: Authentication failed for account: %u ('%s') address: %s", id, account.c_str(), address.c_str());
|
||||
sLog->outError(LOG_FILTER_NETWORKIO, "WorldSocket::HandleAuthSession: Authentication failed for account: %u ('%s') address: %s", id, account.c_str(), address.c_str());
|
||||
return -1;
|
||||
}
|
||||
|
||||
sLog->outDebug(LOG_FILTER_GENERAL, "WorldSocket::HandleAuthSession: Client '%s' authenticated successfully from %s.",
|
||||
sLog->outDebug(LOG_FILTER_NETWORKIO, "WorldSocket::HandleAuthSession: Client '%s' authenticated successfully from %s.",
|
||||
account.c_str(),
|
||||
address.c_str());
|
||||
|
||||
@@ -1012,12 +1005,8 @@ int WorldSocket::HandlePing (WorldPacket& recvPacket)
|
||||
|
||||
if (m_Session && AccountMgr::IsPlayerAccount(m_Session->GetSecurity()))
|
||||
{
|
||||
Player* _player = m_Session->GetPlayer();
|
||||
sLog->outError(LOG_FILTER_GENERAL, "WorldSocket::HandlePing: Player (account: %u, GUID: %u, name: %s) kicked for over-speed pings (address: %s)",
|
||||
m_Session->GetAccountId(),
|
||||
_player ? _player->GetGUIDLow() : 0,
|
||||
_player ? _player->GetName() : "<none>",
|
||||
GetRemoteAddress().c_str());
|
||||
sLog->outError(LOG_FILTER_NETWORKIO, "WorldSocket::HandlePing: %s kicked for over-speed pings (address: %s)",
|
||||
m_Session->GetPlayerName(false).c_str(), GetRemoteAddress().c_str());
|
||||
|
||||
return -1;
|
||||
}
|
||||
@@ -1035,7 +1024,7 @@ int WorldSocket::HandlePing (WorldPacket& recvPacket)
|
||||
m_Session->SetLatency (latency);
|
||||
else
|
||||
{
|
||||
sLog->outError(LOG_FILTER_GENERAL, "WorldSocket::HandlePing: peer sent CMSG_PING, "
|
||||
sLog->outError(LOG_FILTER_NETWORKIO, "WorldSocket::HandlePing: peer sent CMSG_PING, "
|
||||
"but is not authenticated or got recently kicked, "
|
||||
" address = %s",
|
||||
GetRemoteAddress().c_str());
|
||||
|
||||
@@ -105,9 +105,8 @@ void Warden::Update()
|
||||
// Kick player if client response delays more than set in config
|
||||
if (_clientResponseTimer > maxClientResponseDelay * IN_MILLISECONDS)
|
||||
{
|
||||
sLog->outDebug(LOG_FILTER_WARDEN, "WARDEN: Player %s (guid: %u, account: %u, latency: %u, IP: %s) exceeded Warden module response delay for more than %s - disconnecting client",
|
||||
_session->GetPlayerName(), _session->GetGuidLow(), _session->GetAccountId(), _session->GetLatency(), _session->GetRemoteAddress().c_str(),
|
||||
secsToTimeString(maxClientResponseDelay, true).c_str());
|
||||
sLog->outWarn(LOG_FILTER_WARDEN, "%s (latency: %u, IP: %s) exceeded Warden module response delay for more than %s - disconnecting client",
|
||||
_session->GetPlayerName(false).c_str(), _session->GetLatency(), _session->GetRemoteAddress().c_str(), secsToTimeString(maxClientResponseDelay, true).c_str());
|
||||
_session->KickPlayer();
|
||||
}
|
||||
else
|
||||
|
||||
@@ -152,9 +152,7 @@ void WardenMac::HandleHashResult(ByteBuffer &buff)
|
||||
// Verify key
|
||||
if (memcmp(buff.contents() + 1, sha1.GetDigest(), 20) != 0)
|
||||
{
|
||||
sLog->outDebug(LOG_FILTER_WARDEN, "Request hash reply: failed");
|
||||
sLog->outDebug(LOG_FILTER_WARDEN, "WARDEN: Player %s (guid: %u, account: %u) failed hash reply. Action: %s",
|
||||
_session->GetPlayerName(), _session->GetGuidLow(), _session->GetAccountId(), Penalty().c_str());
|
||||
sLog->outWarn(LOG_FILTER_WARDEN, "%s failed hash reply. Action: %s", _session->GetPlayerName(false).c_str(), Penalty().c_str());
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -156,9 +156,7 @@ void WardenWin::HandleHashResult(ByteBuffer &buff)
|
||||
// Verify key
|
||||
if (memcmp(buff.contents() + 1, Module.ClientKeySeedHash, 20) != 0)
|
||||
{
|
||||
sLog->outDebug(LOG_FILTER_WARDEN, "Request hash reply: failed");
|
||||
sLog->outDebug(LOG_FILTER_WARDEN, "WARDEN: Player %s (guid: %u, account: %u) failed hash reply. Action: %s",
|
||||
_session->GetPlayerName(), _session->GetGuidLow(), _session->GetAccountId(), Penalty().c_str());
|
||||
sLog->outWarn(LOG_FILTER_WARDEN, "%s failed hash reply. Action: %s", _session->GetPlayerName(false).c_str(), Penalty().c_str());
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -343,9 +341,7 @@ void WardenWin::HandleData(ByteBuffer &buff)
|
||||
if (!IsValidCheckSum(Checksum, buff.contents() + buff.rpos(), Length))
|
||||
{
|
||||
buff.rpos(buff.wpos());
|
||||
sLog->outDebug(LOG_FILTER_WARDEN, "CHECKSUM FAIL");
|
||||
sLog->outDebug(LOG_FILTER_WARDEN, "WARDEN: Player %s (guid: %u, account: %u) failed checksum. Action: %s",
|
||||
_session->GetPlayerName(), _session->GetGuidLow(), _session->GetAccountId(), Penalty().c_str());
|
||||
sLog->outWarn(LOG_FILTER_WARDEN, "%s failed checksum. Action: %s", _session->GetPlayerName(false).c_str(), Penalty().c_str());
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -356,9 +352,7 @@ void WardenWin::HandleData(ByteBuffer &buff)
|
||||
// TODO: test it.
|
||||
if (result == 0x00)
|
||||
{
|
||||
sLog->outDebug(LOG_FILTER_WARDEN, "TIMING CHECK FAIL result 0x00");
|
||||
sLog->outDebug(LOG_FILTER_WARDEN, "WARDEN: Player %s (guid: %u, account: %u) failed timing check. Action: %s",
|
||||
_session->GetPlayerName(), _session->GetGuidLow(), _session->GetAccountId(), Penalty().c_str());
|
||||
sLog->outWarn(LOG_FILTER_WARDEN, "%s failed timing check. Action: %s", _session->GetPlayerName(false).c_str(), Penalty().c_str());
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -500,9 +494,7 @@ void WardenWin::HandleData(ByteBuffer &buff)
|
||||
if (checkFailed > 0)
|
||||
{
|
||||
WardenCheck* check = sWardenCheckMgr->GetWardenDataById(checkFailed);
|
||||
|
||||
sLog->outDebug(LOG_FILTER_WARDEN, "WARDEN: Player %s (guid: %u, account: %u) failed Warden check %u. Action: %s",
|
||||
_session->GetPlayerName(), _session->GetGuidLow(), _session->GetAccountId(), checkFailed, Penalty(check).c_str());
|
||||
sLog->outWarn(LOG_FILTER_WARDEN, "%s failed Warden check %u. Action: %s", _session->GetPlayerName(false).c_str(), checkFailed, Penalty(check).c_str());
|
||||
}
|
||||
|
||||
// Set hold off timer, minimum timer should at least be 1 second
|
||||
|
||||
@@ -107,7 +107,7 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
switch (sWorld->BanCharacter(name, durationStr, reasonStr, handler->GetSession() ? handler->GetSession()->GetPlayerName() : ""))
|
||||
switch (sWorld->BanCharacter(name, durationStr, reasonStr, handler->GetSession() ? handler->GetSession()->GetPlayerName().c_str() : ""))
|
||||
{
|
||||
case BAN_SUCCESS:
|
||||
{
|
||||
@@ -183,7 +183,7 @@ public:
|
||||
break;
|
||||
}
|
||||
|
||||
switch (sWorld->BanAccount(mode, nameOrIP, durationStr, reasonStr, handler->GetSession() ? handler->GetSession()->GetPlayerName() : ""))
|
||||
switch (sWorld->BanAccount(mode, nameOrIP, durationStr, reasonStr, handler->GetSession() ? handler->GetSession()->GetPlayerName().c_str() : ""))
|
||||
{
|
||||
case BAN_SUCCESS:
|
||||
if (atoi(durationStr) > 0)
|
||||
|
||||
@@ -2708,7 +2708,7 @@ Appender.GM=2,2,0,GM.log
|
||||
Appender.DBErrors=2,2,0,DBErrors.log
|
||||
Appender.Char=2,2,0,Char.log,w
|
||||
Appender.RA=2,2,0,RA.log
|
||||
Appender.Warden=2,2,0,Warden.log
|
||||
Appender.Warden=2,4,0,Warden.log
|
||||
Appender.Chat=2,2,0,Chat.log
|
||||
Appender.CharDump=2,2,0,%s.log
|
||||
Appender.Arenas=2,2,0,Arena.log
|
||||
@@ -2792,7 +2792,7 @@ Logger.Chat=22,3,Chat
|
||||
Logger.DBErrors=26,5,Console Server DBErrors
|
||||
Logger.GM=27,3,Console Server GM
|
||||
Logger.RA=28,3,RA
|
||||
Logger.Warden=29,3,Warden
|
||||
Logger.Warden=29,4,Warden
|
||||
Logger.WorldServer=31,3,Console Server
|
||||
Logger.Character=34,3,Char
|
||||
Logger.Arenas=35,3,Arenas
|
||||
|
||||
Reference in New Issue
Block a user