From 3589d706ef7caa77ad2b98d91fb72b201c2246dd Mon Sep 17 00:00:00 2001 From: MangosArentLiterature <58055358+MangosArentLiterature@users.noreply.github.com> Date: Fri, 16 Apr 2021 01:24:24 -0500 Subject: [PATCH 1/3] add /oocmute and /oocunmute to the command table people really need to stop forgetting to do this lmao --- include/aoclient.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/aoclient.h b/include/aoclient.h index 3ab8429..f2c7d00 100644 --- a/include/aoclient.h +++ b/include/aoclient.h @@ -1850,6 +1850,10 @@ class AOClient : public QObject { {"allowiniswap", {ACLFlags.value("CM"), 0, &AOClient::cmdAllowIniswap}}, {"allow_iniswap", {ACLFlags.value("CM"), 0, &AOClient::cmdAllowIniswap}}, {"afk", {ACLFlags.value("NONE"), 0, &AOClient::cmdAfk}}, + {"oocmute", {ACLFlags.value("MUTE"), 1, &AOClient::cmdOocMute}}, + {"ooc_mute", {ACLFlags.value("MUTE"), 1, &AOClient::cmdOocMute}}, + {"oocunmute", {ACLFlags.value("MUTE"), 1, &AOClient::cmdOocUnMute}}, + {"ooc_unmute", {ACLFlags.value("MUTE"), 1, &AOClient::cmdOocUnMute}}, }; /** From 37e91708f787a26e92e1bc56ff3cc8bcf607e2eb Mon Sep 17 00:00:00 2001 From: MangosArentLiterature <58055358+MangosArentLiterature@users.noreply.github.com> Date: Fri, 16 Apr 2021 01:37:50 -0500 Subject: [PATCH 2/3] Add /blockwtce and /unblockwtce more finished commands that never got put on the commands table --- include/aoclient.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/aoclient.h b/include/aoclient.h index f2c7d00..675550f 100644 --- a/include/aoclient.h +++ b/include/aoclient.h @@ -1854,6 +1854,10 @@ class AOClient : public QObject { {"ooc_mute", {ACLFlags.value("MUTE"), 1, &AOClient::cmdOocMute}}, {"oocunmute", {ACLFlags.value("MUTE"), 1, &AOClient::cmdOocUnMute}}, {"ooc_unmute", {ACLFlags.value("MUTE"), 1, &AOClient::cmdOocUnMute}}, + {"blockwtce", {ACLFlags.value("MUTE"), 1, &AOClient::cmdBlockWtce}}, + {"block_wtce", {ACLFlags.value("MUTE"), 1, &AOClient::cmdBlockWtce}}, + {"unblockwtce", {ACLFlags.value("MUTE"), 1, &AOClient::cmdUnBlockWtce}}, + {"unblock_wtce", {ACLFlags.value("MUTE"), 1, &AOClient::cmdUnBlockWtce}}, }; /** From 96407ad4bd8a94cffda28b46c9974c9f816ef030 Mon Sep 17 00:00:00 2001 From: MangosArentLiterature <58055358+MangosArentLiterature@users.noreply.github.com> Date: Fri, 16 Apr 2021 13:22:42 -0500 Subject: [PATCH 3/3] Add /blockdj and /unblockdj - More commands that never got added to the table. - Also fixes /blockdj incorrectly blocking a client from changing areas. - Checks if a client is DJ blocked when using /play --- include/aoclient.h | 4 ++++ src/commands/music.cpp | 4 ++++ src/packets.cpp | 8 ++++---- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/include/aoclient.h b/include/aoclient.h index 675550f..3445f18 100644 --- a/include/aoclient.h +++ b/include/aoclient.h @@ -1858,6 +1858,10 @@ class AOClient : public QObject { {"block_wtce", {ACLFlags.value("MUTE"), 1, &AOClient::cmdBlockWtce}}, {"unblockwtce", {ACLFlags.value("MUTE"), 1, &AOClient::cmdUnBlockWtce}}, {"unblock_wtce", {ACLFlags.value("MUTE"), 1, &AOClient::cmdUnBlockWtce}}, + {"blockdj", {ACLFlags.value("MUTE"), 1, &AOClient::cmdBlockDj}}, + {"block_dj", {ACLFlags.value("MUTE"), 1, &AOClient::cmdBlockDj}}, + {"unblockdj", {ACLFlags.value("MUTE"), 1, &AOClient::cmdUnBlockDj}}, + {"unblock_dj", {ACLFlags.value("MUTE"), 1, &AOClient::cmdUnBlockDj}}, }; /** diff --git a/src/commands/music.cpp b/src/commands/music.cpp index 4bde396..2ae0f71 100644 --- a/src/commands/music.cpp +++ b/src/commands/music.cpp @@ -22,6 +22,10 @@ void AOClient::cmdPlay(int argc, QStringList argv) { + if (is_dj_blocked) { + sendServerMessage("You are blocked from changing the music."); + return; + } AreaData* area = server->areas[current_area]; QString song = argv.join(" "); area->current_music = song; diff --git a/src/packets.cpp b/src/packets.cpp index 6ddce8a..252845b 100644 --- a/src/packets.cpp +++ b/src/packets.cpp @@ -210,10 +210,6 @@ void AOClient::pktPing(AreaData* area, int argc, QStringList argv, AOPacket pack void AOClient::pktChangeMusic(AreaData* area, int argc, QStringList argv, AOPacket packet) { - if (is_dj_blocked) { - sendServerMessage("You are blocked from changing the music."); - return; - } // Due to historical reasons, this // packet has two functions: // Change area, and set music. @@ -225,6 +221,10 @@ void AOClient::pktChangeMusic(AreaData* area, int argc, QStringList argv, AOPack for (QString song : server->music_list) { if (song == argument || song == "~stop.mp3") { // ~stop.mp3 is a dummy track used by 2.9+ // We have a song here + if (is_dj_blocked) { + sendServerMessage("You are blocked from changing the music."); + return; + } QString effects; if (argc >= 4) effects = argv[3];