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

#include "ServerScript.h"

Inheritance diagram for ServerScript:
ScriptObject

Public Member Functions

virtual void OnNetworkStart ()
 
virtual void OnNetworkStop ()
 
virtual void OnSocketOpen (std::shared_ptr< WorldSocket >)
 
virtual void OnSocketClose (std::shared_ptr< WorldSocket >)
 
virtual bool CanPacketSend (WorldSession *, WorldPacket &)
 This hook called when a packet is sent to a client. The packet object is a copy of the original packet, so reading and modifying it is safe.
 
virtual bool CanPacketReceive (WorldSession *, WorldPacket &)
 Called when a (valid) packet is received by a client. The packet object is a copy of the original packet, so reading and modifying it is safe. Make sure to check WorldSession pointer before usage, it might be null in case of auth packets.
 
- Public Member Functions inherited from ScriptObject
virtual bool IsDatabaseBound () const
 
virtual bool isAfterLoadScript () const
 
virtual void checkValidity ()
 
const std::string & GetName () const
 

Protected Member Functions

 ServerScript (const char *name)
 
- Protected Member Functions inherited from ScriptObject
 ScriptObject (const char *name)
 
virtual ~ScriptObject ()=default
 

Detailed Description

Constructor & Destructor Documentation

◆ ServerScript()

ServerScript::ServerScript ( const char *  name)
protected
101 : ScriptObject(name)
102{
104}
static void AddScript(TScript *const script)
Definition: ScriptMgr.h:716
Definition: ScriptObject.h:44

References ScriptRegistry< TScript >::AddScript().

Member Function Documentation

◆ CanPacketReceive()

virtual bool ServerScript::CanPacketReceive ( WorldSession ,
WorldPacket  
)
inlinevirtual

Called when a (valid) packet is received by a client. The packet object is a copy of the original packet, so reading and modifying it is safe. Make sure to check WorldSession pointer before usage, it might be null in case of auth packets.

Parameters
sessionContains information about the WorldSession
packetContains information about the WorldPacket
Returns
True if you want to continue receive the packet, false if you want to disallow receive the packet
59{ return true; }

Referenced by ScriptMgr::CanPacketReceive().

◆ CanPacketSend()

virtual bool ServerScript::CanPacketSend ( WorldSession ,
WorldPacket  
)
inlinevirtual

This hook called when a packet is sent to a client. The packet object is a copy of the original packet, so reading and modifying it is safe.

Parameters
sessionContains information about the WorldSession
packetContains information about the WorldPacket
Returns
True if you want to continue sending the packet, false if you want to disallow sending the packet
49{ return true; }

Referenced by ScriptMgr::CanPacketSend().

◆ OnNetworkStart()

virtual void ServerScript::OnNetworkStart ( )
inlinevirtual
30{ }

Referenced by ScriptMgr::OnNetworkStart().

◆ OnNetworkStop()

virtual void ServerScript::OnNetworkStop ( )
inlinevirtual
33{ }

Referenced by ScriptMgr::OnNetworkStop().

◆ OnSocketClose()

virtual void ServerScript::OnSocketClose ( std::shared_ptr< WorldSocket )
inlinevirtual
40{ }

Referenced by ScriptMgr::OnSocketClose().

◆ OnSocketOpen()

virtual void ServerScript::OnSocketOpen ( std::shared_ptr< WorldSocket )
inlinevirtual
36{ }

Referenced by ScriptMgr::OnSocketOpen().