AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
MapSessionFilter Class Reference

#include "WorldSession.h"

Inheritance diagram for MapSessionFilter:
PacketFilter

Public Member Functions

 MapSessionFilter (WorldSession *pSession)
 
 ~MapSessionFilter () override=default
 
bool Process (WorldPacket *packet) override
 
bool ProcessUnsafe () const override
 
- Public Member Functions inherited from PacketFilter
 PacketFilter (WorldSession *pSession)
 
virtual ~PacketFilter ()=default
 
virtual bool Process (WorldPacket *)
 
virtual bool ProcessUnsafe () const
 

Additional Inherited Members

- Protected Attributes inherited from PacketFilter
WorldSession *const m_pSession
 

Detailed Description

Constructor & Destructor Documentation

◆ MapSessionFilter()

MapSessionFilter::MapSessionFilter ( WorldSession pSession)
inlineexplicit
246: PacketFilter(pSession) {}
Definition: WorldSession.h:231

◆ ~MapSessionFilter()

MapSessionFilter::~MapSessionFilter ( )
overridedefault

Member Function Documentation

◆ Process()

bool MapSessionFilter::Process ( WorldPacket packet)
overridevirtual

Reimplemented from PacketFilter.

63{
64 ClientOpcodeHandler const* opHandle = opcodeTable[static_cast<OpcodeClient>(packet->GetOpcode())];
65
66 //let's check if our has an anxiety disorder can be really processed in Map::Update()
67 if (opHandle->ProcessingPlace == PROCESS_INPLACE)
68 return true;
69
70 //we do not process thread-unsafe packets
72 return false;
73
74 Player* player = m_pSession->GetPlayer();
75 if (!player)
76 return false;
77
78 //in Map::Update() we do not process packets where player is not in world!
79 return player->IsInWorld();
80}
Opcodes
List of Opcodes.
Definition: Opcodes.h:30
OpcodeTable opcodeTable
Definition: Opcodes.cpp:51
PacketProcessing ProcessingPlace
Definition: Opcodes.h:1392
@ PROCESS_INPLACE
Definition: Opcodes.h:1366
@ PROCESS_THREADUNSAFE
Definition: Opcodes.h:1367
bool IsInWorld() const
Definition: Object.h:104
Definition: Player.h:1064
Definition: Opcodes.h:1385
uint16 GetOpcode() const
Definition: WorldPacket.h:76
WorldSession *const m_pSession
Definition: WorldSession.h:240
Player * GetPlayer() const
Definition: WorldSession.h:362

References WorldPacket::GetOpcode(), WorldSession::GetPlayer(), Object::IsInWorld(), PacketFilter::m_pSession, opcodeTable, PROCESS_INPLACE, PROCESS_THREADUNSAFE, and ClientOpcodeHandler::ProcessingPlace.

◆ ProcessUnsafe()

bool MapSessionFilter::ProcessUnsafe ( ) const
inlineoverridevirtual

Reimplemented from PacketFilter.

251{ return false; }