This commit is contained in:
in1tiate 2021-03-12 22:51:11 -06:00
commit 7a64521c40
2 changed files with 16 additions and 1 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

@ -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;