From da7aa12b90a4d27b1d0fa6bd2da087643cbbdddb Mon Sep 17 00:00:00 2001 From: MangosArentLiterature <58055358+MangosArentLiterature@users.noreply.github.com> Date: Mon, 14 Jun 2021 11:24:18 -0500 Subject: [PATCH] Fix crash with /ban Sets /ban to require 3 arguments instead of 2 --- core/include/aoclient.h | 2 +- core/src/commands/moderation.cpp | 5 ----- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/core/include/aoclient.h b/core/include/aoclient.h index b3191b0..f3185f5 100644 --- a/core/include/aoclient.h +++ b/core/include/aoclient.h @@ -1937,7 +1937,7 @@ class AOClient : public QObject { {"login", {ACLFlags.value("NONE"), 0, &AOClient::cmdLogin}}, {"getareas", {ACLFlags.value("NONE"), 0, &AOClient::cmdGetAreas}}, {"getarea", {ACLFlags.value("NONE"), 0, &AOClient::cmdGetArea}}, - {"ban", {ACLFlags.value("BAN"), 2, &AOClient::cmdBan}}, + {"ban", {ACLFlags.value("BAN"), 3, &AOClient::cmdBan}}, {"kick", {ACLFlags.value("KICK"), 2, &AOClient::cmdKick}}, {"changeauth", {ACLFlags.value("SUPER"), 0, &AOClient::cmdChangeAuth}}, {"rootpass", {ACLFlags.value("SUPER"), 1, &AOClient::cmdSetRootPass}}, diff --git a/core/src/commands/moderation.cpp b/core/src/commands/moderation.cpp index 43c7f89..f5b864a 100644 --- a/core/src/commands/moderation.cpp +++ b/core/src/commands/moderation.cpp @@ -30,11 +30,6 @@ void AOClient::cmdBan(int argc, QStringList argv) DBManager::BanInfo ban; - if (argc < 3) { - sendServerMessage("Invalid syntax. Usage:\n/ban "); - return; - } - long long duration_seconds = 0; if (argv[1] == "perma") duration_seconds = -2;