Merge pull request #29 from Salanto/GM-Command

Gm command
This commit is contained in:
scatterflower 2021-03-12 15:18:51 -06:00 committed by GitHub
commit e680bb9e07
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 0 deletions

View File

@ -220,6 +220,7 @@ class AOClient : public QObject {
void cmdKick(int argc, QStringList argv);
void cmdAnnounce(int argc, QStringList argv);
void cmdM(int argc, QStringList argv);
void cmdGM(int argc, QStringList argv);
// Casing/RP
void cmdPlay(int argc, QStringList argv);
void cmdNeed(int argc, QStringList argv);
@ -308,6 +309,7 @@ class AOClient : public QObject {
{"motd", {ACLFlags.value("NONE"), 0, &AOClient::cmdMOTD}},
{"announce", {ACLFlags.value("ANNOUNCE"), 1, &AOClient::cmdAnnounce}},
{"m", {ACLFlags.value("MODCHAT"), 1, &AOClient::cmdM}},
{"gm", {ACLFlags.value("MODCHAT"), 1, &AOClient::cmdGM}}
};
QString partial_packet;

View File

@ -891,6 +891,18 @@ void AOClient::cmdM(int argc, QStringList argv)
return;
}
void AOClient::cmdGM(int argc, QStringList argv)
{
QString sender_name = ooc_name;
QString sender_area = server->area_names.value(current_area);
QString sender_message = argv.join(" ");
for (AOClient* client : server->clients) {
if (client->global_enabled) {
client->sendPacket("CT", {"[G][" + sender_area + "]" + "["+sender_name+"][M]", sender_message});
}
}
}
QStringList AOClient::buildAreaList(int area_idx)
{
QStringList entries;