summaryrefslogtreecommitdiffstats
path: root/source/Plugin_NewLua.h
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2013-02-15 14:00:59 +0100
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2013-02-15 14:00:59 +0100
commit34b3c13404c466c8f64d198dce914a1e3fa094c2 (patch)
tree351964785344dd92f2f0043fab89878b1abf5b6b /source/Plugin_NewLua.h
parentFixed one-hit-blocks not being broken server-side (diff)
downloadcuberite-34b3c13404c466c8f64d198dce914a1e3fa094c2.tar
cuberite-34b3c13404c466c8f64d198dce914a1e3fa094c2.tar.gz
cuberite-34b3c13404c466c8f64d198dce914a1e3fa094c2.tar.bz2
cuberite-34b3c13404c466c8f64d198dce914a1e3fa094c2.tar.lz
cuberite-34b3c13404c466c8f64d198dce914a1e3fa094c2.tar.xz
cuberite-34b3c13404c466c8f64d198dce914a1e3fa094c2.tar.zst
cuberite-34b3c13404c466c8f64d198dce914a1e3fa094c2.zip
Diffstat (limited to 'source/Plugin_NewLua.h')
-rw-r--r--source/Plugin_NewLua.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/source/Plugin_NewLua.h b/source/Plugin_NewLua.h
index 529f0e0eb..ab1907a41 100644
--- a/source/Plugin_NewLua.h
+++ b/source/Plugin_NewLua.h
@@ -72,8 +72,12 @@ public:
virtual bool HandleCommand(const AStringVector & a_Split, cPlayer * a_Player) override;
+ virtual bool HandleConsoleCommand(const AStringVector & a_Split) override;
+
virtual void ClearCommands(void) override;
+ virtual void ClearConsoleCommands(void) override;
+
virtual bool CanAddHook(cPluginManager::PluginHook a_Hook) override;
// cWebPlugin override
@@ -86,6 +90,9 @@ public:
/// Binds the command to call the function specified by a Lua function reference. Simply adds to CommandMap.
void BindCommand(const AString & a_Command, int a_FnRef);
+ /// Binds the console command to call the function specified by a Lua function reference. Simply adds to CommandMap.
+ void BindConsoleCommand(const AString & a_Command, int a_FnRef);
+
lua_State* GetLuaState() { return m_LuaState; }
cCriticalSection & GetCriticalSection() { return m_CriticalSection; }
@@ -98,6 +105,7 @@ protected:
typedef std::map<AString, int> CommandMap;
CommandMap m_Commands;
+ CommandMap m_ConsoleCommands;
bool PushFunction(const char * a_FunctionName, bool a_bLogError = true);
bool CallFunction(int a_NumArgs, int a_NumResults, const char * a_FunctionName ); // a_FunctionName is only used for error messages, nothing else