Merge pull request #55 from Salanto/lm-command

Add lm-command
This commit is contained in:
scatterflower 2021-04-05 11:43:52 -05:00 committed by GitHub
commit fd00cde0d5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 1 deletions

View File

@ -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
/**
@ -1560,6 +1571,7 @@ class AOClient : public QObject {
{"notecard_reveal", {ACLFlags.value("CM"), 0, &AOClient::cmdNoteCardReveal}},
{"notecardclear", {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)
{
QStringList recent_bans;