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:
Nefertumm
2020-03-23 15:46:00 -03:00
committed by GitHub
parent c5a7497f4d
commit 846f7862d8
13 changed files with 473 additions and 80 deletions

View File

@@ -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)
{