diff --git a/include/aoclient.h b/include/aoclient.h index e2276b8..1869bc6 100644 --- a/include/aoclient.h +++ b/include/aoclient.h @@ -78,6 +78,7 @@ class AOClient : public QObject { {"EVI_MOD", 1ULL << 6}, {"MOTD", 1ULL << 7}, {"ANNOUNCE", 1ULL << 8}, + {"MODCHAT", 1ULL << 9}, {"SUPER", ~0ULL} }; @@ -218,6 +219,7 @@ class AOClient : public QObject { void cmdBan(int argc, QStringList argv); void cmdKick(int argc, QStringList argv); void cmdAnnounce(int argc, QStringList argv); + void cmdM(int argc, QStringList argv); // Casing/RP void cmdPlay(int argc, QStringList argv); void cmdNeed(int argc, QStringList argv); @@ -305,6 +307,7 @@ class AOClient : public QObject { {"evidence_mod", {ACLFlags.value("EVI_MOD"), 1, &AOClient::cmdEvidenceMod}}, {"motd", {ACLFlags.value("NONE"), 0, &AOClient::cmdMOTD}}, {"announce", {ACLFlags.value("ANNOUNCE"), 1, &AOClient::cmdAnnounce}}, + {"m", {ACLFlags.value("MODCHAT"), 1, &AOClient::cmdM}}, }; QString partial_packet; diff --git a/src/commands.cpp b/src/commands.cpp index ce8e48e..8b87a42 100644 --- a/src/commands.cpp +++ b/src/commands.cpp @@ -879,6 +879,17 @@ void AOClient::cmdAnnounce(int argc, QStringList argv) sendServerBroadcast("=== Announcement ===\r\n" + argv.join(" ") + "\r\n============="); } +void AOClient::cmdM(int argc, QStringList argv) +{ + QString sender_name = ooc_name; + QString sender_message = argv.join(" "); + for (AOClient* client : server->clients) { + if (client->checkAuth(ACLFlags.value("MODCHAT"))) + client->sendPacket("CT", {"[M]" + sender_name, sender_message}); + } + return; +} + QStringList AOClient::buildAreaList(int area_idx) { QStringList entries;