diff options
author | madmaxoft <github@xoft.cz> | 2014-07-04 15:41:48 +0200 |
---|---|---|
committer | madmaxoft <github@xoft.cz> | 2014-07-04 15:41:48 +0200 |
commit | 8f65d13d1bff2b7747a88041ad86e6c5838b0e3c (patch) | |
tree | 9f397e8d0bc629d32f54ca10c0ebb735723370eb /src/Bindings/PluginManager.h | |
parent | Fixed c1deda5d8f01811efa5094e9375166acb69d50ed (diff) | |
parent | Removed useless sentence in cPluginManager:ExecuteCommand description. (diff) | |
download | cuberite-8f65d13d1bff2b7747a88041ad86e6c5838b0e3c.tar cuberite-8f65d13d1bff2b7747a88041ad86e6c5838b0e3c.tar.gz cuberite-8f65d13d1bff2b7747a88041ad86e6c5838b0e3c.tar.bz2 cuberite-8f65d13d1bff2b7747a88041ad86e6c5838b0e3c.tar.lz cuberite-8f65d13d1bff2b7747a88041ad86e6c5838b0e3c.tar.xz cuberite-8f65d13d1bff2b7747a88041ad86e6c5838b0e3c.tar.zst cuberite-8f65d13d1bff2b7747a88041ad86e6c5838b0e3c.zip |
Diffstat (limited to 'src/Bindings/PluginManager.h')
-rw-r--r-- | src/Bindings/PluginManager.h | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/src/Bindings/PluginManager.h b/src/Bindings/PluginManager.h index 72cedfae1..d435024bb 100644 --- a/src/Bindings/PluginManager.h +++ b/src/Bindings/PluginManager.h @@ -57,8 +57,17 @@ public: // tolua_export // Called each tick virtual void Tick(float a_Dt); - + // tolua_begin + enum CommandResult + { + crExecuted, + crUnknownCommand, + crError, + crBlocked, + crNoPermission, + } ; + enum PluginHook { HOOK_BLOCK_SPREAD, @@ -246,11 +255,11 @@ public: // tolua_export /** Returns the permission needed for the specified command; empty string if command not found */ AString GetCommandPermission(const AString & a_Command); // tolua_export - /** Executes the command, as if it was requested by a_Player. Checks permissions first. Returns true if executed. */ - bool ExecuteCommand(cPlayer * a_Player, const AString & a_Command); // tolua_export + /** Executes the command, as if it was requested by a_Player. Checks permissions first. Returns crExecuted if executed. */ + CommandResult ExecuteCommand(cPlayer * a_Player, const AString & a_Command); // 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 + /** Executes the command, as if it was requested by a_Player. Permisssions are not checked. Returns crExecuted if executed. */ + CommandResult 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); @@ -323,13 +332,8 @@ private: /** Adds the plugin into the internal list of plugins and initializes it. If initialization fails, the plugin is removed again. */ bool AddPlugin(cPlugin * a_Plugin); - /** Tries to match a_Command to the internal table of commands, if a match is found, the corresponding plugin is called. Returns true if the command is handled. */ - bool HandleCommand(cPlayer * a_Player, const AString & a_Command, bool a_ShouldCheckPermissions, bool & a_WasCommandForbidden); - bool HandleCommand(cPlayer * a_Player, const AString & a_Command, bool a_ShouldCheckPermissions) - { - bool DummyBoolean = false; - return HandleCommand(a_Player, a_Command, a_ShouldCheckPermissions, DummyBoolean); - } + /** Tries to match a_Command to the internal table of commands, if a match is found, the corresponding plugin is called. Returns crExecuted if the command is executed. */ + cPluginManager::CommandResult HandleCommand(cPlayer * a_Player, const AString & a_Command, bool a_ShouldCheckPermissions); } ; // tolua_export |