diff --git a/include/aoclient.h b/include/aoclient.h index 4bd8e20..0c4d7cf 100644 --- a/include/aoclient.h +++ b/include/aoclient.h @@ -1023,7 +1023,18 @@ class AOClient : public QObject { * @see AOClient::cmdG() */ void cmdGM(int argc, QStringList argv); - + + /** + * @brief Sends out a local message that is marked with an `[M]` to mean it is coming from a moderator. + * + * @details The arguments are **the message** that the client wants to send. + * + * @iscommand + * + * @see AOClient::cmdLM() + */ + void cmdLM(int argc, QStringList argv); + // Casing/RP /** @@ -1570,6 +1581,7 @@ class AOClient : public QObject { {"notecardclear", {ACLFlags.value("NONE"), 0, &AOClient::cmdNoteCardClear}}, {"notecard_clear", {ACLFlags.value("NONE"), 0, &AOClient::cmdNoteCardClear}}, {"8ball", {ACLFlags.value("NONE"), 1, &AOClient::cmd8Ball}}, + {"lm", {ACLFlags.value("MODCHAT"), 1, &AOClient::cmdLM}}, }; /** diff --git a/src/commands.cpp b/src/commands.cpp index 6a8506c..91a492e 100644 --- a/src/commands.cpp +++ b/src/commands.cpp @@ -957,6 +957,13 @@ void AOClient::cmdGM(int argc, QStringList argv) } } +void AOClient::cmdLM(int argc, QStringList argv) +{ + QString sender_name = ooc_name; + QString sender_message = argv.join(" "); + server->broadcast(AOPacket("CT", {"["+sender_name+"][M]", sender_message}), current_area); +} + void AOClient::cmdBans(int argc, QStringList argv) { QStringList recent_bans;