diff --git a/include/aoclient.h b/include/aoclient.h index 1869bc6..75eaa39 100644 --- a/include/aoclient.h +++ b/include/aoclient.h @@ -79,6 +79,7 @@ class AOClient : public QObject { {"MOTD", 1ULL << 7}, {"ANNOUNCE", 1ULL << 8}, {"MODCHAT", 1ULL << 9}, + {"GM", 1ULL << 10}, {"SUPER", ~0ULL} }; @@ -220,6 +221,7 @@ class AOClient : public QObject { void cmdKick(int argc, QStringList argv); void cmdAnnounce(int argc, QStringList argv); void cmdM(int argc, QStringList argv); + void cmdGM(int argc, QStringList argv); // Casing/RP void cmdPlay(int argc, QStringList argv); void cmdNeed(int argc, QStringList argv); @@ -308,6 +310,7 @@ class AOClient : public QObject { {"motd", {ACLFlags.value("NONE"), 0, &AOClient::cmdMOTD}}, {"announce", {ACLFlags.value("ANNOUNCE"), 1, &AOClient::cmdAnnounce}}, {"m", {ACLFlags.value("MODCHAT"), 1, &AOClient::cmdM}}, + {"gm", {ACLFlags.value("GM"), 1, &AOClient::cmdGM}} }; QString partial_packet; diff --git a/src/commands.cpp b/src/commands.cpp index 8b87a42..71e7557 100644 --- a/src/commands.cpp +++ b/src/commands.cpp @@ -890,6 +890,22 @@ void AOClient::cmdM(int argc, QStringList argv) return; } +void AOClient::cmdGM(int argc, QStringList argv) +{ + if (checkAuth(ACLFlags.value("MOTD"))) { + QString sender_name = ooc_name; + QString sender_area = server->area_names.value(current_area); + QString sender_message = argv.join(" "); + for (AOClient* client : server->clients) { + if (client->global_enabled) + client->sendPacket("CT", {"[G][" + sender_area + "]" + "["+sender_name+"][M]", sender_message}); + } + } + else { + sendServerMessage("You do not have permission to use Global Mod Message."); + } +} + QStringList AOClient::buildAreaList(int area_idx) { QStringList entries;