summaryrefslogtreecommitdiffstats
path: root/source/PluginManager.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/PluginManager.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/PluginManager.h')
-rw-r--r--source/PluginManager.h24
1 files changed, 21 insertions, 3 deletions
diff --git a/source/PluginManager.h b/source/PluginManager.h
index 86e357e91..d070bfabd 100644
--- a/source/PluginManager.h
+++ b/source/PluginManager.h
@@ -86,7 +86,9 @@ public: // tolua_export
class cCommandEnumCallback
{
public:
- /// Called for each command; return true to abort enumeration
+ /** Called for each command; return true to abort enumeration
+ For console commands, a_Permission is not used (set to empty string)
+ */
virtual bool Command(const AString & a_Command, const cPlugin * a_Plugin, const AString & a_Permission, const AString & a_HelpString) = 0;
} ;
@@ -170,7 +172,22 @@ public: // tolua_export
/// Executes the command, as if it was requested by a_Player. Permisssions are not checked. Returns true if executed (false if not found)
bool ForceExecuteCommand(cPlayer * a_Player, const AString & a_Command); // tolua_export
-
+
+ /// Removes all console command bindings that the specified plugin has made
+ void RemovePluginConsoleCommands(cPlugin * a_Plugin);
+
+ /// Binds a console command to the specified plugin. Returns true if successful, false if command already bound.
+ bool BindConsoleCommand(const AString & a_Command, cPlugin * a_Plugin, const AString & a_HelpString); // Exported in ManualBindings.cpp, without the a_Plugin param
+
+ /// Calls a_Callback for each bound console command, returns true if all commands were enumerated
+ bool ForEachConsoleCommand(cCommandEnumCallback & a_Callback); // Exported in ManualBindings.cpp
+
+ /// Returns true if the console command is in the command map
+ bool IsConsoleCommandBound(const AString & a_Command); // tolua_export
+
+ /// Executes the command split into a_Split, as if it was given on the console. Returns true if executed.
+ bool ExecuteConsoleCommand(const AStringVector & a_Split); // tolua_export
+
private:
friend class cRoot;
@@ -178,7 +195,7 @@ private:
{
public:
cPlugin * m_Plugin;
- AString m_Permission;
+ AString m_Permission; // Not used for console commands
AString m_HelpString;
} ;
@@ -189,6 +206,7 @@ private:
PluginMap m_Plugins;
HookMap m_Hooks;
CommandMap m_Commands;
+ CommandMap m_ConsoleCommands;
bool m_bReloadPlugins;