TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
MapSessionFilter Class Reference

#include <WorldSession.h>

Public Member Functions

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

Additional Inherited Members

- Protected Attributes inherited from PacketFilter
WorldSession *const m_pSession
 

Constructor & Destructor Documentation

MapSessionFilter::MapSessionFilter ( WorldSession pSession)
inlineexplicit
857 : PacketFilter(pSession) { }
PacketFilter(WorldSession *pSession)
Definition: WorldSession.h:839
MapSessionFilter::~MapSessionFilter ( )
inline
858 { }

Member Function Documentation

bool MapSessionFilter::Process ( WorldPacket packet)
overridevirtual

Implements PacketFilter.

64 {
65  ClientOpcodeHandler const* opHandle = opcodeTable[static_cast<OpcodeClient>(packet->GetOpcode())];
66 
67  //let's check if our opcode 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
72  if (opHandle->ProcessingPlace == PROCESS_THREADUNSAFE)
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 }
OpcodeTable opcodeTable
Definition: Opcodes.cpp:49
PacketProcessing ProcessingPlace
Definition: Opcodes.h:1716
uint32 GetOpcode() const
Definition: WorldPacket.h:79
Player * GetPlayer() const
Definition: WorldSession.h:927
Definition: Opcodes.h:1688
Definition: Opcodes.h:1689
OpcodeClient
Definition: Opcodes.h:46
Definition: Opcodes.h:1708
WorldSession *const m_pSession
Definition: WorldSession.h:846

+ Here is the call graph for this function:


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