summaryrefslogtreecommitdiffstats
path: root/src/WebAdmin.cpp
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2015-04-19 10:57:41 +0200
committerMattes D <github@xoft.cz>2015-04-19 10:57:41 +0200
commita9b5a6c3a63d8500f3c512574fd802d40b562661 (patch)
treee6d0d362ed42116d6c9deaaa789287f464569514 /src/WebAdmin.cpp
parentMerge pull request #1869 from mathias-gh/master (diff)
downloadcuberite-a9b5a6c3a63d8500f3c512574fd802d40b562661.tar
cuberite-a9b5a6c3a63d8500f3c512574fd802d40b562661.tar.gz
cuberite-a9b5a6c3a63d8500f3c512574fd802d40b562661.tar.bz2
cuberite-a9b5a6c3a63d8500f3c512574fd802d40b562661.tar.lz
cuberite-a9b5a6c3a63d8500f3c512574fd802d40b562661.tar.xz
cuberite-a9b5a6c3a63d8500f3c512574fd802d40b562661.tar.zst
cuberite-a9b5a6c3a63d8500f3c512574fd802d40b562661.zip
Diffstat (limited to 'src/WebAdmin.cpp')
-rw-r--r--src/WebAdmin.cpp28
1 files changed, 20 insertions, 8 deletions
diff --git a/src/WebAdmin.cpp b/src/WebAdmin.cpp
index 13cf3cc41..ec265ea5b 100644
--- a/src/WebAdmin.cpp
+++ b/src/WebAdmin.cpp
@@ -489,20 +489,32 @@ AString cWebAdmin::GetDefaultPage(void)
Content += "<h4>Server Name:</h4>";
Content += "<p>" + AString( cRoot::Get()->GetServer()->GetServerID()) + "</p>";
+ // Display a list of all plugins:
Content += "<h4>Plugins:</h4><ul>";
- cPluginManager * PM = cPluginManager::Get();
- const cPluginManager::PluginMap & List = PM->GetAllPlugins();
- for (cPluginManager::PluginMap::const_iterator itr = List.begin(); itr != List.end(); ++itr)
+ struct cPluginCallback:
+ public cPluginManager::cPluginCallback
{
- if (itr->second == nullptr)
+ AString & m_Content;
+
+ cPluginCallback(AString & a_Content):
+ m_Content(a_Content)
{
- continue;
}
- AppendPrintf(Content, "<li>%s V.%i</li>", itr->second->GetName().c_str(), itr->second->GetVersion());
- }
+
+ virtual bool Item(cPlugin * a_Plugin) override
+ {
+ if (a_Plugin->IsLoaded())
+ {
+ AppendPrintf(m_Content, "<li>%s V.%i</li>", a_Plugin->GetName().c_str(), a_Plugin->GetVersion());
+ }
+ return false;
+ }
+ } Callback(Content);
+ cPluginManager::Get()->ForEachPlugin(Callback);
Content += "</ul>";
- Content += "<h4>Players:</h4><ul>";
+ // Display a list of all players:
+ Content += "<h4>Players:</h4><ul>";
cPlayerAccum PlayerAccum;
cWorld * World = cRoot::Get()->GetDefaultWorld(); // TODO - Create a list of worlds and players
if (World != nullptr)