mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-22 21:26:23 +00:00
feat(Core/Packet): Implement AntiDOS protection from Trinity (#2789)
* Implement AntiDOS protection from Trinity Co-authored-by: jackpoz <giacomopoz@gmail.com> Co-authored-by: Shauren <shauren.trinity@gmail.com> Co-authored-by: Vincent-Michael <trinity.michael_vincent@gmx.eu>
This commit is contained in:
@@ -13,12 +13,6 @@
|
||||
|
||||
#include "Common.h"
|
||||
|
||||
// Note: this include need for be sure have full definition of class WorldSession
|
||||
// if this class definition not complete then VS for x64 release use different size for
|
||||
// struct OpcodeHandler in this header and Opcode.cpp and get totally wrong data from
|
||||
// table opcodeTable in source when Opcode.h included but WorldSession.h not included
|
||||
#include "WorldSession.h"
|
||||
|
||||
/// List of Opcodes
|
||||
enum Opcodes
|
||||
{
|
||||
@@ -1353,8 +1347,15 @@ enum PacketProcessing
|
||||
PROCESS_THREADSAFE //packet is thread-safe - process it in Map::Update()
|
||||
};
|
||||
|
||||
class WorldSession;
|
||||
class WorldPacket;
|
||||
|
||||
#if defined(__GNUC__)
|
||||
#pragma pack(1)
|
||||
#else
|
||||
#pragma pack(push, 1)
|
||||
#endif
|
||||
|
||||
struct OpcodeHandler
|
||||
{
|
||||
char const* name;
|
||||
@@ -1365,6 +1366,12 @@ struct OpcodeHandler
|
||||
|
||||
extern OpcodeHandler opcodeTable[NUM_MSG_TYPES];
|
||||
|
||||
#if defined(__GNUC__)
|
||||
#pragma pack()
|
||||
#else
|
||||
#pragma pack(pop)
|
||||
#endif
|
||||
|
||||
/// Lookup opcode name for human understandable logging
|
||||
inline const char* LookupOpcodeName(uint16 id)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user