summaryrefslogtreecommitdiffstats
path: root/source/PluginManager.cpp
diff options
context:
space:
mode:
authormadmaxoft <github@xoft.cz>2013-08-01 09:36:33 +0200
committermadmaxoft <github@xoft.cz>2013-08-01 09:36:33 +0200
commit3683601b8b64dae567f90966813ec3b7c2aff2c9 (patch)
tree03922709926f36a03f6d89e3ac0be6c72020e5f0 /source/PluginManager.cpp
parentMerged in the latest core changes. (diff)
parentProtoProxy: Tab completion logging lists the last item, too (diff)
downloadcuberite-3683601b8b64dae567f90966813ec3b7c2aff2c9.tar
cuberite-3683601b8b64dae567f90966813ec3b7c2aff2c9.tar.gz
cuberite-3683601b8b64dae567f90966813ec3b7c2aff2c9.tar.bz2
cuberite-3683601b8b64dae567f90966813ec3b7c2aff2c9.tar.lz
cuberite-3683601b8b64dae567f90966813ec3b7c2aff2c9.tar.xz
cuberite-3683601b8b64dae567f90966813ec3b7c2aff2c9.tar.zst
cuberite-3683601b8b64dae567f90966813ec3b7c2aff2c9.zip
Diffstat (limited to 'source/PluginManager.cpp')
-rw-r--r--source/PluginManager.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/source/PluginManager.cpp b/source/PluginManager.cpp
index b7a21a7ea..043390cbc 100644
--- a/source/PluginManager.cpp
+++ b/source/PluginManager.cpp
@@ -1335,6 +1335,28 @@ bool cPluginManager::ExecuteConsoleCommand(const AStringVector & a_Split, cComma
+void cPluginManager::TabCompleteCommand(const AString & a_Text, AStringVector & a_Results, cPlayer * a_Player)
+{
+ for (CommandMap::iterator itr = m_Commands.begin(), end = m_Commands.end(); itr != end; ++itr)
+ {
+ if (NoCaseCompare(itr->first.substr(0, a_Text.length()), a_Text) != 0)
+ {
+ // Command name doesn't match
+ continue;
+ }
+ if ((a_Player != NULL) && !a_Player->HasPermission(itr->second.m_Permission))
+ {
+ // Player doesn't have permission for the command
+ continue;
+ }
+ a_Results.push_back(itr->first);
+ }
+}
+
+
+
+
+
bool cPluginManager::AddPlugin(cPlugin * a_Plugin)
{
m_Plugins[a_Plugin->GetDirectory()] = a_Plugin;