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

#include <WorldSession.h>

Public Member Functions

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

Additional Inherited Members

- Protected Attributes inherited from PacketFilter
WorldSession *const m_pSession
 

Constructor & Destructor Documentation

WorldSessionFilter::WorldSessionFilter ( WorldSession pSession)
inlineexplicit
868 : PacketFilter(pSession) { }
PacketFilter(WorldSession *pSession)
Definition: WorldSession.h:839
WorldSessionFilter::~WorldSessionFilter ( )
inline
869 { }

Member Function Documentation

bool WorldSessionFilter::Process ( WorldPacket packet)
overridevirtual

Implements PacketFilter.

86 {
87  ClientOpcodeHandler const* opHandle = opcodeTable[static_cast<OpcodeClient>(packet->GetOpcode())];
88 
89  //check if packet handler is supposed to be safe
90  if (opHandle->ProcessingPlace == PROCESS_INPLACE)
91  return true;
92 
93  //thread-unsafe packets should be processed in World::UpdateSessions()
94  if (opHandle->ProcessingPlace == PROCESS_THREADUNSAFE)
95  return true;
96 
97  //no player attached? -> our client! ^^
98  Player* player = m_pSession->GetPlayer();
99  if (!player)
100  return true;
101 
102  //lets process all packets for non-in-the-world player
103  return (player->IsInWorld() == false);
104 }
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:

bool WorldSessionFilter::ProcessUnsafe ( ) const
inlineoverridevirtual

Reimplemented from PacketFilter.

872 { return true; }

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