From e9f18f8b4fcf4ae7891b631765bcc49a4a183220 Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Tue, 30 Jul 2013 22:48:59 +0200 Subject: Tab completion packet is handled and sent. This only handles the network comm and the overall design logic, the actual completion is not yet implemented, only dummy values are returned for now. --- source/PluginManager.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source/PluginManager.h') diff --git a/source/PluginManager.h b/source/PluginManager.h index 3832ee455..150132f9f 100644 --- a/source/PluginManager.h +++ b/source/PluginManager.h @@ -197,6 +197,9 @@ public: // tolua_export /// Executes the command split into a_Split, as if it was given on the console. Returns true if executed. Output is sent to the a_Output callback bool ExecuteConsoleCommand(const AStringVector & a_Split, cCommandOutputCallback & a_Output); + /// Appends all commands beginning with a_Text (case-insensitive) into a_Results + void TabCompleteCommand(const AString & a_Text, AStringVector & a_Results); + private: friend class cRoot; -- cgit v1.2.3 From e8a907d89e37bf6eeab8e852c8439ae4899cd114 Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Wed, 31 Jul 2013 11:16:11 +0200 Subject: Implemented the actual tab completion for commands and playernames. Each command is reported only if the player has the permission to use it. --- source/PluginManager.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'source/PluginManager.h') diff --git a/source/PluginManager.h b/source/PluginManager.h index 150132f9f..6bdf87fc7 100644 --- a/source/PluginManager.h +++ b/source/PluginManager.h @@ -197,8 +197,10 @@ public: // tolua_export /// Executes the command split into a_Split, as if it was given on the console. Returns true if executed. Output is sent to the a_Output callback bool ExecuteConsoleCommand(const AStringVector & a_Split, cCommandOutputCallback & a_Output); - /// Appends all commands beginning with a_Text (case-insensitive) into a_Results - void TabCompleteCommand(const AString & a_Text, AStringVector & a_Results); + /** Appends all commands beginning with a_Text (case-insensitive) into a_Results. + If a_Player is not NULL, only commands for which the player has permissions are added. + */ + void TabCompleteCommand(const AString & a_Text, AStringVector & a_Results, cPlayer * a_Player); private: friend class cRoot; -- cgit v1.2.3