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
246: PacketFilter(pSession) {}
Definition WorldSession.h:231

◆ ~MapSessionFilter()

MapSessionFilter::~MapSessionFilter ( )
overridedefault

Member Function Documentation

◆ Process()

bool MapSessionFilter::Process ( WorldPacket packet)
overridevirtual

Reimplemented from PacketFilter.

64{
65 ClientOpcodeHandler const* opHandle = opcodeTable[static_cast<OpcodeClient>(packet->GetOpcode())];
66
67 //let's check if our has an anxiety disorder can be really processed in Map::Update()
68 if (opHandle->ProcessingPlace == PROCESS_INPLACE)
69 return true;
70
71 //we do not process thread-unsafe packets
73 return false;
74
75 Player* player = m_pSession->GetPlayer();
76 if (!player)
77 return false;
78
79 //in Map::Update() we do not process packets where player is not in world!
80 return player->IsInWorld();
81}
Definition Opcodes.h:1385
bool IsInWorld() const
Definition Object.h:107
WorldSession *const m_pSession
Definition WorldSession.h:240
Definition Player.h:1081
uint16 GetOpcode() const
Definition WorldPacket.h:75
Player * GetPlayer() const
Definition WorldSession.h:376
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

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; }

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