mirror of
https://github.com/mangosfour/server.git
synced 2025-12-19 22:37:05 +00:00
[9573] Add config option Network.KickOnBadPacket. If enabled, player will be kicked on badly formatted (wrong structure) packet.
This commit is contained in:
parent
bd6d27998b
commit
8f0da43638
6 changed files with 30 additions and 5 deletions
|
|
@ -713,7 +713,7 @@ int WorldSocket::ProcessIncoming (WorldPacket* new_pct)
|
|||
}
|
||||
catch (ByteBufferException &)
|
||||
{
|
||||
sLog.outError("WorldSocket::ProcessIncoming ByteBufferException occured while parsing an instant handled packet (opcode: %u) from client %s, accountid=%i. Disconnected client.",
|
||||
sLog.outError("WorldSocket::ProcessIncoming ByteBufferException occured while parsing an instant handled packet (opcode: %u) from client %s, accountid=%i.",
|
||||
opcode, GetRemoteAddress().c_str(), m_Session?m_Session->GetAccountId():-1);
|
||||
if(sLog.IsOutDebug())
|
||||
{
|
||||
|
|
@ -721,7 +721,15 @@ int WorldSocket::ProcessIncoming (WorldPacket* new_pct)
|
|||
new_pct->hexlike();
|
||||
}
|
||||
|
||||
return -1;
|
||||
if (sWorld.getConfig(CONFIG_BOOL_KICK_PLAYER_ON_BAD_PACKET))
|
||||
{
|
||||
sLog.outDetail("Disconnecting session [account id %i / address %s] for badly formatted packet.",
|
||||
m_Session?m_Session->GetAccountId():-1, GetRemoteAddress().c_str());
|
||||
|
||||
return -1;
|
||||
}
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
ACE_NOTREACHED (return 0);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue