From a2a9341c24609e45e563427eecc1a927ee2b657a Mon Sep 17 00:00:00 2001 From: Alexander Harkness Date: Thu, 21 Jul 2016 12:00:30 +0100 Subject: Tab completion across worlds (#3270) Fixes #2563. --- src/ClientHandle.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'src/ClientHandle.cpp') diff --git a/src/ClientHandle.cpp b/src/ClientHandle.cpp index 772d8ad6c..997510684 100644 --- a/src/ClientHandle.cpp +++ b/src/ClientHandle.cpp @@ -1831,12 +1831,24 @@ void cClientHandle::HandleUnmount(void) void cClientHandle::HandleTabCompletion(const AString & a_Text) { AStringVector Results; - m_Player->GetWorld()->TabCompleteUserName(a_Text, Results); + // Get player name completions. + if (cRoot::Get()->GetServer()->ShouldAllowMultiWorldTabCompletion()) + { + Results = cRoot::Get()->GetPlayerTabCompletionMultiWorld(a_Text); + } + else + { + m_Player->GetWorld()->TabCompleteUserName(a_Text, Results); + } + + // Get command completions. cRoot::Get()->GetPluginManager()->TabCompleteCommand(a_Text, Results, m_Player); if (Results.empty()) { return; } + + // Sort and send results. std::sort(Results.begin(), Results.end()); SendTabCompletionResults(Results); } -- cgit v1.2.3