#include "ServerScript.h"
◆ ServerScript()
ServerScript::ServerScript |
( |
const char * |
name, |
|
|
std::vector< uint16 > |
enabledHooks = std::vector<uint16>() |
|
) |
| |
|
protected |
70{
71
72 if (enabledHooks.empty())
74 enabledHooks.emplace_back(i);
75
77}
std::uint16_t uint16
Definition: Define.h:108
@ SERVERHOOK_END
Definition: ServerScript.h:32
static void AddScript(TScript *const script, std::vector< uint16 > enabledHooks={})
Definition: ScriptMgr.h:737
Definition: ScriptObject.h:44
References ScriptRegistry< TScript >::AddScript(), and SERVERHOOK_END.
◆ CanPacketReceive()
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
-
- Returns
- True if you want to continue receive the packet, false if you want to disallow receive the packet
◆ CanPacketSend()
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
-
- Returns
- True if you want to continue sending the packet, false if you want to disallow sending the packet
◆ OnNetworkStart()
virtual void ServerScript::OnNetworkStart |
( |
| ) |
|
|
inlinevirtual |
◆ OnNetworkStop()
virtual void ServerScript::OnNetworkStop |
( |
| ) |
|
|
inlinevirtual |
◆ OnSocketClose()
virtual void ServerScript::OnSocketClose |
( |
std::shared_ptr< WorldSocket > |
| ) |
|
|
inlinevirtual |
◆ OnSocketOpen()
virtual void ServerScript::OnSocketOpen |
( |
std::shared_ptr< WorldSocket > |
| ) |
|
|
inlinevirtual |