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
 

Additional Inherited Members

- Protected Attributes inherited from PacketFilter
WorldSession *const m_pSession
 

Detailed Description

Constructor & Destructor Documentation

◆ MapSessionFilter()

MapSessionFilter::MapSessionFilter ( WorldSession pSession)
inlineexplicit
325: PacketFilter(pSession) {}
Definition WorldSession.h:310

◆ ~MapSessionFilter()

MapSessionFilter::~MapSessionFilter ( )
overridedefault

Member Function Documentation

◆ Process()

bool MapSessionFilter::Process ( WorldPacket packet)
overridevirtual

Reimplemented from PacketFilter.

67{
68 ClientOpcodeHandler const* opHandle = opcodeTable[static_cast<OpcodeClient>(packet->GetOpcode())];
69
70 //let's check if our has an anxiety disorder can be really processed in Map::Update()
71 if (opHandle->ProcessingPlace == PROCESS_INPLACE)
72 return true;
73
74 //we do not process thread-unsafe packets
76 return false;
77
78 Player* player = m_pSession->GetPlayer();
79 if (!player)
80 return false;
81
82 //in Map::Update() we do not process packets where player is not in world!
83 return player->IsInWorld();
84}
Definition Opcodes.h:1387
bool IsInWorld() const
Definition Object.h:109
WorldSession *const m_pSession
Definition WorldSession.h:319
Definition Player.h:1086
uint16 GetOpcode() const
Definition WorldPacket.h:75
Player * GetPlayer() const
Definition WorldSession.h:480
Opcodes
List of Opcodes.
Definition Opcodes.h:30
OpcodeTable opcodeTable
Definition Opcodes.cpp:51
PacketProcessing ProcessingPlace
Definition Opcodes.h:1394
@ PROCESS_INPLACE
Definition Opcodes.h:1368
@ PROCESS_THREADUNSAFE
Definition Opcodes.h:1369

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.

330{ return false; }

The documentation for this class was generated from the following files: