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

#include "AllCommandScript.h"

Inheritance diagram for AllCommandScript:
ScriptObject

Public Member Functions

bool IsDatabaseBound () const override
 
virtual void OnHandleDevCommand (Player *, bool &)
 
virtual bool OnTryExecuteCommand (ChatHandler &, std::string_view)
 This hook is triggered when a command is parsed, but before it is executed. More...
 
- Public Member Functions inherited from ScriptObject
virtual bool IsDatabaseBound () const
 
virtual bool isAfterLoadScript () const
 
virtual void checkValidity ()
 
const std::string & GetName () const
 
uint16 GetTotalAvailableHooks ()
 

Protected Member Functions

 AllCommandScript (const char *name, std::vector< uint16 > enabledHooks=std::vector< uint16 >())
 
- Protected Member Functions inherited from ScriptObject
 ScriptObject (const char *name, uint16 totalAvailableHooks=0)
 
virtual ~ScriptObject ()=default
 

Detailed Description

Constructor & Destructor Documentation

◆ AllCommandScript()

AllCommandScript::AllCommandScript ( const char *  name,
std::vector< uint16 enabledHooks = std::vector<uint16>() 
)
protected
34{
35 // If empty - enable all available hooks.
36 if (enabledHooks.empty())
37 for (uint16 i = 0; i < ALLCOMMANDHOOK_END; ++i)
38 enabledHooks.emplace_back(i);
39
40 ScriptRegistry<AllCommandScript>::AddScript(this, std::move(enabledHooks));
41}
std::uint16_t uint16
Definition: Define.h:108
@ ALLCOMMANDHOOK_END
Definition: AllCommandScript.h:28
static void AddScript(TScript *const script, std::vector< uint16 > enabledHooks={})
Definition: ScriptMgr.h:737
Definition: ScriptObject.h:44

References ScriptRegistry< TScript >::AddScript(), and ALLCOMMANDHOOK_END.

Member Function Documentation

◆ IsDatabaseBound()

bool AllCommandScript::IsDatabaseBound ( ) const
inlineoverridevirtual

Reimplemented from ScriptObject.

37{ return false; }

◆ OnHandleDevCommand()

virtual void AllCommandScript::OnHandleDevCommand ( Player ,
bool &   
)
inlinevirtual
39{ }

◆ OnTryExecuteCommand()

virtual bool AllCommandScript::OnTryExecuteCommand ( ChatHandler ,
std::string_view   
)
inlinevirtual

This hook is triggered when a command is parsed, but before it is executed.

Parameters
handlerContains information about the ChatHandler
cmdStrContains information about the command name
47{ return true; }