From f43a498efa1ca20d6ebd86f98478438612e7d35c Mon Sep 17 00:00:00 2001 From: in1tiate Date: Thu, 11 Mar 2021 23:49:42 -0600 Subject: [PATCH] add /announce, change permission names for consistency --- include/aoclient.h | 11 +++++++---- src/commands.cpp | 7 ++++++- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/include/aoclient.h b/include/aoclient.h index 42070e3..e2276b8 100644 --- a/include/aoclient.h +++ b/include/aoclient.h @@ -75,8 +75,9 @@ class AOClient : public QObject { {"MODIFY_USERS", 1ULL << 3}, {"CM", 1ULL << 4}, {"GLOBAL_TIMER", 1ULL << 5}, - {"CHANGE_EVI_MOD", 1ULL << 6}, - {"CHANGE_MOTD", 1ULL << 7}, + {"EVI_MOD", 1ULL << 6}, + {"MOTD", 1ULL << 7}, + {"ANNOUNCE", 1ULL << 8}, {"SUPER", ~0ULL} }; @@ -216,6 +217,7 @@ class AOClient : public QObject { void cmdMods(int argc, QStringList argv); void cmdBan(int argc, QStringList argv); void cmdKick(int argc, QStringList argv); + void cmdAnnounce(int argc, QStringList argv); // Casing/RP void cmdPlay(int argc, QStringList argv); void cmdNeed(int argc, QStringList argv); @@ -300,8 +302,9 @@ class AOClient : public QObject { {"forcepos", {ACLFlags.value("CM"), 2, &AOClient::cmdForcePos}}, {"currentmusic", {ACLFlags.value("NONE"), 0, &AOClient::cmdCurrentMusic}}, {"pm", {ACLFlags.value("NONE"), 2, &AOClient::cmdPM}}, - {"evidence_mod", {ACLFlags.value("CHANGE_EVI_MOD"), 1, &AOClient::cmdEvidenceMod}}, - {"motd", {ACLFlags.value("NONE"), 0, &AOClient::cmdMOTD}} + {"evidence_mod", {ACLFlags.value("EVI_MOD"), 1, &AOClient::cmdEvidenceMod}}, + {"motd", {ACLFlags.value("NONE"), 0, &AOClient::cmdMOTD}}, + {"announce", {ACLFlags.value("ANNOUNCE"), 1, &AOClient::cmdAnnounce}}, }; QString partial_packet; diff --git a/src/commands.cpp b/src/commands.cpp index e25bd8e..ce8e48e 100644 --- a/src/commands.cpp +++ b/src/commands.cpp @@ -863,7 +863,7 @@ void AOClient::cmdMOTD(int argc, QStringList argv) sendServerMessage("=== MOTD ===\r\n" + server->MOTD + "\r\n============="); } else if (argc > 0) { - if (checkAuth(ACLFlags.value("CHANGE_MOTD"))) { + if (checkAuth(ACLFlags.value("MOTD"))) { QString MOTD = argv.join(" "); server->MOTD = MOTD; sendServerMessage("MOTD has been changed."); @@ -874,6 +874,11 @@ void AOClient::cmdMOTD(int argc, QStringList argv) } } +void AOClient::cmdAnnounce(int argc, QStringList argv) +{ + sendServerBroadcast("=== Announcement ===\r\n" + argv.join(" ") + "\r\n============="); +} + QStringList AOClient::buildAreaList(int area_idx) { QStringList entries;