From 0b2281967b89e9b604ccc37690c75046729fc650 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Fri, 18 Apr 2014 19:37:26 -0500 Subject: [PATCH] Added #command error message suppression for those who don't want to see 'Command is not recognized' constantly - You need to have rule 'Chat:SuppressCommandErrors' set to true, this is set to false by default - Required SQL: 2014_04_18_Suppress_Command_Error.sql --- changelog.txt | 5 +++++ common/ruletypes.h | 1 + utils/sql/git/required/2014_04_18_Suppress_Command_Error.sql | 1 + zone/client.cpp | 5 +++-- 4 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 utils/sql/git/required/2014_04_18_Suppress_Command_Error.sql diff --git a/changelog.txt b/changelog.txt index eff2f9460..2e314b440 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,5 +1,10 @@ EQEMu Changelog (Started on Sept 24, 2003 15:50) ------------------------------------------------------- +== 04/18/2014 == +Akkadius: Added #command error message suppression for those who don't want to see 'Command is not recognized' constantly + - You need to have rule 'Chat:SuppressCommandErrors' set to true, this is set to false by default + - Required SQL: 2014_04_18_Suppress_Command_Error.sql + == 04/15/2014 == Akkadius: Exported $client->SendMarqueeMessage(type, priority, fade_in, fade_out, duration, msg) - Will be available for simple plugin use Akkadius: Exported $client->ExpeditionMessage(THIS, ExpdID, Message) - In use with custom expedition mod that will be released soon diff --git a/common/ruletypes.h b/common/ruletypes.h index fa07c752e..20bd0ce78 100644 --- a/common/ruletypes.h +++ b/common/ruletypes.h @@ -464,6 +464,7 @@ RULE_BOOL ( Chat, ServerWideAuction, true) RULE_BOOL ( Chat, EnableVoiceMacros, true) RULE_BOOL ( Chat, EnableMailKeyIPVerification, true) RULE_BOOL ( Chat, EnableAntiSpam, true) +RULE_BOOL ( Chat, SuppressCommandErrors, false) // Do not suppress by default RULE_INT ( Chat, MinStatusToBypassAntiSpam, 100) RULE_INT ( Chat, MinimumMessagesPerInterval, 4) RULE_INT ( Chat, MaximumMessagesPerInterval, 12) diff --git a/utils/sql/git/required/2014_04_18_Suppress_Command_Error.sql b/utils/sql/git/required/2014_04_18_Suppress_Command_Error.sql new file mode 100644 index 000000000..2d10ea458 --- /dev/null +++ b/utils/sql/git/required/2014_04_18_Suppress_Command_Error.sql @@ -0,0 +1 @@ +INSERT INTO `rule_values` VALUES ('0', 'Chat:SuppressCommandErrors', 'true', 'This will suppress "Command is not recognized"'); \ No newline at end of file diff --git a/zone/client.cpp b/zone/client.cpp index 0f1314211..702303c5c 100644 --- a/zone/client.cpp +++ b/zone/client.cpp @@ -1022,11 +1022,12 @@ void Client::ChannelMessageReceived(uint8 chan_num, uint8 language, uint8 lang_s if(command_dispatch(this, message) == -2) { if(parse->PlayerHasQuestSub(EVENT_COMMAND)) { int i = parse->EventPlayer(EVENT_COMMAND, this, message, 0); - if(i == 0) { + if(i == 0 && !RuleB(Chat, SuppressCommandErrors)) { Message(13, "Command '%s' not recognized.", message); } } else { - Message(13, "Command '%s' not recognized.", message); + if(!RuleB(Chat, SuppressCommandErrors)) + Message(13, "Command '%s' not recognized.", message); } } break;