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...
 
virtual bool OnBeforeIsInvokerVisible (std::string, Acore::Impl::ChatCommands::CommandPermissions, ChatHandler const &)
 
- 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
40{
41 // If empty - enable all available hooks.
42 if (enabledHooks.empty())
43 for (uint16 i = 0; i < ALLCOMMANDHOOK_END; ++i)
44 enabledHooks.emplace_back(i);
45
46 ScriptRegistry<AllCommandScript>::AddScript(this, std::move(enabledHooks));
47}
std::uint16_t uint16
Definition: Define.h:108
@ ALLCOMMANDHOOK_END
Definition: AllCommandScript.h:30
static void AddScript(TScript *const script, std::vector< uint16 > enabledHooks={})
Definition: ScriptMgr.h:738
Definition: ScriptObject.h:43

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

Member Function Documentation

◆ IsDatabaseBound()

bool AllCommandScript::IsDatabaseBound ( ) const
inlineoverridevirtual

Reimplemented from ScriptObject.

39{ return false; }

◆ OnBeforeIsInvokerVisible()

virtual bool AllCommandScript::OnBeforeIsInvokerVisible ( std::string  ,
Acore::Impl::ChatCommands::CommandPermissions  ,
ChatHandler const &   
)
inlinevirtual
51{ return true; }

◆ OnHandleDevCommand()

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

◆ 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
49{ return true; }