mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 16:37:01 +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
|
|
@ -248,15 +248,23 @@ bool WorldSession::Update(uint32 /*diff*/)
|
|||
break;
|
||||
}
|
||||
}
|
||||
catch(ByteBufferException &)
|
||||
catch (ByteBufferException &)
|
||||
{
|
||||
sLog.outError("WorldSession::Update ByteBufferException occured while parsing a packet (opcode: %u) from client %s, accountid=%i. Skipped packet.",
|
||||
sLog.outError("WorldSession::Update ByteBufferException occured while parsing a packet (opcode: %u) from client %s, accountid=%i.",
|
||||
packet->GetOpcode(), GetRemoteAddress().c_str(), GetAccountId());
|
||||
if(sLog.IsOutDebug())
|
||||
{
|
||||
sLog.outDebug("Dumping error causing packet:");
|
||||
packet->hexlike();
|
||||
}
|
||||
|
||||
if (sWorld.getConfig(CONFIG_BOOL_KICK_PLAYER_ON_BAD_PACKET))
|
||||
{
|
||||
sLog.outDetail("Disconnecting session [account id %u / address %s] for badly formatted packet.",
|
||||
GetAccountId(), GetRemoteAddress().c_str());
|
||||
|
||||
KickPlayer();
|
||||
}
|
||||
}
|
||||
|
||||
delete packet;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue