From 41578298b6ac27fe0ffdd058ab36dced252b3972 Mon Sep 17 00:00:00 2001 From: SilicaAndPina Date: Thu, 4 Feb 2021 14:20:12 +1300 Subject: [PATCH] Allow option to skip non-violation chat checks --- Horse Isle Server/HorseIsleServer/Game/Chat/Chat.cs | 2 ++ Horse Isle Server/HorseIsleServer/Game/Meta.cs | 3 ++- .../HorseIsleServer/Resources/server.properties | 5 +++++ Horse Isle Server/HorseIsleServer/Server/ConfigReader.cs | 4 ++++ 4 files changed, 13 insertions(+), 1 deletion(-) diff --git a/Horse Isle Server/HorseIsleServer/Game/Chat/Chat.cs b/Horse Isle Server/HorseIsleServer/Game/Chat/Chat.cs index f63cce5..d770f7a 100755 --- a/Horse Isle Server/HorseIsleServer/Game/Chat/Chat.cs +++ b/Horse Isle Server/HorseIsleServer/Game/Chat/Chat.cs @@ -440,6 +440,8 @@ namespace HISP.Game.Chat public static string NonViolationChecks(User user, string message) { + if(ConfigReader.DoNonViolations) + return null; // Check if contains password. if (message.ToLower().Contains(user.Password.ToLower())) diff --git a/Horse Isle Server/HorseIsleServer/Game/Meta.cs b/Horse Isle Server/HorseIsleServer/Game/Meta.cs index a81f764..22371c3 100755 --- a/Horse Isle Server/HorseIsleServer/Game/Meta.cs +++ b/Horse Isle Server/HorseIsleServer/Game/Meta.cs @@ -1124,7 +1124,8 @@ namespace HISP.Game if(TileCode == "MULTIROOM") { user.MetaPriority = false; // acturally want to track updates here >-< - message += buildMultiroom(TileArg, user); + if(TileArg != "") + message += buildMultiroom(TileArg, user); } if(TileCode == "PASSWORD") { diff --git a/Horse Isle Server/HorseIsleServer/Resources/server.properties b/Horse Isle Server/HorseIsleServer/Resources/server.properties index c948779..a30333d 100755 --- a/Horse Isle Server/HorseIsleServer/Resources/server.properties +++ b/Horse Isle Server/HorseIsleServer/Resources/server.properties @@ -35,6 +35,11 @@ enable_word_filter=true # (NOTE: This feature is also used to filter some less-'bad' words disabling it will allow users to say them!) enable_corrections=true +# Include non-violations +# stuff like blocking you from saying your password in chat +# and FULL CAPS messages. +non_violation=true + # Wether or not to consider all users "Subscribers" all_users_subscribed=false diff --git a/Horse Isle Server/HorseIsleServer/Server/ConfigReader.cs b/Horse Isle Server/HorseIsleServer/Server/ConfigReader.cs index 6df8691..43a2343 100755 --- a/Horse Isle Server/HorseIsleServer/Server/ConfigReader.cs +++ b/Horse Isle Server/HorseIsleServer/Server/ConfigReader.cs @@ -24,6 +24,7 @@ namespace HISP.Server public static bool AllUsersSubbed; public static bool BadWords; public static bool DoCorrections; + public static bool DoNonViolations; public const int MAX_STACK = 40; @@ -99,6 +100,9 @@ namespace HISP.Server case "enable_corrections": BadWords = data == "true"; break; + case "non_violation": + DoNonViolations = data == "true"; + break; case "enable_word_filter": DoCorrections = data == "true"; break;