add /mods
This commit is contained in:
parent
49071e6936
commit
f0d6b4eb53
@ -197,6 +197,7 @@ class AOClient : public QObject {
|
|||||||
void cmdBgLock(int argc, QStringList argv);
|
void cmdBgLock(int argc, QStringList argv);
|
||||||
void cmdBgUnlock(int argc, QStringList argv);
|
void cmdBgUnlock(int argc, QStringList argv);
|
||||||
// Moderation
|
// Moderation
|
||||||
|
void cmdMods(int argc, QStringList argv);
|
||||||
void cmdBan(int argc, QStringList argv);
|
void cmdBan(int argc, QStringList argv);
|
||||||
void cmdKick(int argc, QStringList argv);
|
void cmdKick(int argc, QStringList argv);
|
||||||
// Casing/RP
|
// Casing/RP
|
||||||
@ -270,6 +271,7 @@ class AOClient : public QObject {
|
|||||||
{"randomchar", {ACLFlags.value("NONE"), 0, &AOClient::cmdRandomChar}},
|
{"randomchar", {ACLFlags.value("NONE"), 0, &AOClient::cmdRandomChar}},
|
||||||
{"switch", {ACLFlags.value("NONE"), 1, &AOClient::cmdSwitch}},
|
{"switch", {ACLFlags.value("NONE"), 1, &AOClient::cmdSwitch}},
|
||||||
{"toggleglobal", {ACLFlags.value("NONE"), 0, &AOClient::cmdToggleGlobal}},
|
{"toggleglobal", {ACLFlags.value("NONE"), 0, &AOClient::cmdToggleGlobal}},
|
||||||
|
{"mods", {ACLFlags.value("NONE"), 0, &AOClient::cmdMods}},
|
||||||
};
|
};
|
||||||
|
|
||||||
QString partial_packet;
|
QString partial_packet;
|
||||||
|
@ -692,6 +692,30 @@ void AOClient::cmdToggleGlobal(int argc, QStringList argv)
|
|||||||
sendServerMessage("Global chat set to " + str_en);
|
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 AOClient::buildAreaList(int area_idx)
|
||||||
{
|
{
|
||||||
QStringList entries;
|
QStringList entries;
|
||||||
|
Loading…
Reference in New Issue
Block a user