Add lm-command

Mango was disappointed when they learned I already did this several days ago and forgot about it.
This commit is contained in:
Salanto 2021-04-05 03:02:38 +02:00
parent 9aab9f30bc
commit e1c578b8ee
2 changed files with 20 additions and 1 deletions

View File

@ -1023,7 +1023,18 @@ class AOClient : public QObject {
* @see AOClient::cmdG() * @see AOClient::cmdG()
*/ */
void cmdGM(int argc, QStringList argv); 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 // Casing/RP
/** /**
@ -1560,6 +1571,7 @@ class AOClient : public QObject {
{"notecard_reveal", {ACLFlags.value("CM"), 0, &AOClient::cmdNoteCardReveal}}, {"notecard_reveal", {ACLFlags.value("CM"), 0, &AOClient::cmdNoteCardReveal}},
{"notecardclear", {ACLFlags.value("NONE"), 0, &AOClient::cmdNoteCardClear}}, {"notecardclear", {ACLFlags.value("NONE"), 0, &AOClient::cmdNoteCardClear}},
{"notecard_clear", {ACLFlags.value("NONE"), 0, &AOClient::cmdNoteCardClear}}, {"notecard_clear", {ACLFlags.value("NONE"), 0, &AOClient::cmdNoteCardClear}},
{"lm", {ACLFlags.value("MODCHAT"), 1, &AOClient::cmdLM}},
}; };
/** /**

View File

@ -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) void AOClient::cmdBans(int argc, QStringList argv)
{ {
QStringList recent_bans; QStringList recent_bans;