Merge pull request #78 from AttorneyOnline/fix-ooc-mute

add missing commands to the command table
This commit is contained in:
Marisa P 2021-04-17 20:42:16 -05:00 committed by GitHub
commit c70d2afbeb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 20 additions and 4 deletions

View File

@ -1850,6 +1850,18 @@ class AOClient : public QObject {
{"allowiniswap", {ACLFlags.value("CM"), 0, &AOClient::cmdAllowIniswap}}, {"allowiniswap", {ACLFlags.value("CM"), 0, &AOClient::cmdAllowIniswap}},
{"allow_iniswap", {ACLFlags.value("CM"), 0, &AOClient::cmdAllowIniswap}}, {"allow_iniswap", {ACLFlags.value("CM"), 0, &AOClient::cmdAllowIniswap}},
{"afk", {ACLFlags.value("NONE"), 0, &AOClient::cmdAfk}}, {"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}},
{"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}},
{"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}},
}; };
/** /**

View File

@ -22,6 +22,10 @@
void AOClient::cmdPlay(int argc, QStringList argv) 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]; AreaData* area = server->areas[current_area];
QString song = argv.join(" "); QString song = argv.join(" ");
area->current_music = song; area->current_music = song;

View File

@ -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) 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 // Due to historical reasons, this
// packet has two functions: // packet has two functions:
// Change area, and set music. // 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) { for (QString song : server->music_list) {
if (song == argument || song == "~stop.mp3") { // ~stop.mp3 is a dummy track used by 2.9+ if (song == argument || song == "~stop.mp3") { // ~stop.mp3 is a dummy track used by 2.9+
// We have a song here // We have a song here
if (is_dj_blocked) {
sendServerMessage("You are blocked from changing the music.");
return;
}
QString effects; QString effects;
if (argc >= 4) if (argc >= 4)
effects = argv[3]; effects = argv[3];