Index: pol-core/clib/clib-2008.vcproj =================================================================== --- pol-core/clib/clib-2008.vcproj (revision 613) +++ pol-core/clib/clib-2008.vcproj (working copy) @@ -404,7 +404,6 @@ RelativePath=".\dirlist.h" > - Index: pol-core/pol/pol.cpp =================================================================== --- pol-core/pol/pol.cpp (revision 613) +++ pol-core/pol/pol.cpp (working copy) @@ -673,6 +673,17 @@ if ( (!handler[ msgtype ].msglen) && (!handler_v2[ msgtype ].msglen) ) { + + // anti flood prevention (method 1) - voicer + if(client->acct == NULL) // undefined message for unknown account is treated as flood + { + printf("Packet flood detected for account unknown, IP: %s",client->ipaddrAsString().c_str()); + client->forceDisconnect(); // disconnects and do not add any data to the core buffer + return false; + } + // end of anti flood prevention (method 1) + + printf( "Undefined message type %2.02x\n", (unsigned char) msgtype ); client->recv_remaining( sizeof client->buffer/2 ); printf( "Unexpected message type %2.02x, %u bytes (IP:%s, Account:%s)\n", @@ -843,6 +854,19 @@ AddressToString( &client->ipaddr ), client->acct ? client->acct->name() : "unknown", msgtype ); + + // anti flood prevention (method 2) - voicer + if(client->acct) + { + // account not unknown, so do nothing - probably some check methods should be placed here too. + } else + { + Log2("Account unknown sent non-allowed message. Forcing Disconnect."); + client->forceDisconnect(); + return false; + } + + // end of anti flood prevention } } client->recv_state = Client::RECV_STATE_MSGTYPE_WAIT;