diff --git a/include/aoclient.h b/include/aoclient.h index 1869bc6..4ff94c7 100644 --- a/include/aoclient.h +++ b/include/aoclient.h @@ -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; diff --git a/src/commands.cpp b/src/commands.cpp index d4d3884..04243a9 100644 --- a/src/commands.cpp +++ b/src/commands.cpp @@ -727,7 +727,8 @@ void AOClient::cmdPlay(int argc, QStringList argv) QString song = argv.join(" "); area->current_music = song; area->music_played_by = showname; - sendPacket("MC", {song, QString::number(server->getCharID(current_char)), showname, "1", "0"}); + AOPacket music_change("MC", {song, QString::number(server->getCharID(current_char)), showname, "1", "0"}); + server->broadcast(music_change, current_area); } void AOClient::cmdAreaKick(int argc, QStringList argv) @@ -890,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;