diff --git a/include/aoclient.h b/include/aoclient.h index 3c6abbd..65d1773 100644 --- a/include/aoclient.h +++ b/include/aoclient.h @@ -197,6 +197,7 @@ class AOClient : public QObject { void cmdBgLock(int argc, QStringList argv); void cmdBgUnlock(int argc, QStringList argv); // Moderation + void cmdMods(int argc, QStringList argv); void cmdBan(int argc, QStringList argv); void cmdKick(int argc, QStringList argv); // Casing/RP @@ -270,6 +271,7 @@ class AOClient : public QObject { {"randomchar", {ACLFlags.value("NONE"), 0, &AOClient::cmdRandomChar}}, {"switch", {ACLFlags.value("NONE"), 1, &AOClient::cmdSwitch}}, {"toggleglobal", {ACLFlags.value("NONE"), 0, &AOClient::cmdToggleGlobal}}, + {"mods", {ACLFlags.value("NONE"), 0, &AOClient::cmdMods}}, }; QString partial_packet; diff --git a/src/commands.cpp b/src/commands.cpp index 82500f0..5396260 100644 --- a/src/commands.cpp +++ b/src/commands.cpp @@ -692,6 +692,30 @@ void AOClient::cmdToggleGlobal(int argc, QStringList argv) sendServerMessage("Global chat set to " + str_en); } +void AOClient::cmdMods(int argc, QStringList argv) +{ + QStringList entries; + QSettings config("config/config.ini", QSettings::IniFormat); + config.beginGroup("Options"); + QString auth_type = config.value("auth", "simple").toString(); + int online_count = 0; + for (AOClient* client : server->clients) { + if (client->authenticated) { + entries << "---"; + if (auth_type != "simple") + entries << "Moderator: " + moderator_name; + entries << "OOC name: " + ooc_name; + entries << "ID: " + QString::number(client->id); + entries << "Area: " + QString::number(client->current_area); + entries << "Character: " + client->current_char; + online_count++; + } + } + entries << "---"; + entries << "Total online: " << QString::number(online_count); + sendServerMessage(entries.join("\n")); +} + QStringList AOClient::buildAreaList(int area_idx) { QStringList entries;