From d05d18214ea0ca429755f264b09047ffdd0514d9 Mon Sep 17 00:00:00 2001 From: Lucas Nicodemus Date: Sun, 11 Dec 2011 11:16:23 -0700 Subject: [PATCH] Added a configuration option for disabling item stack checks. --- TShockAPI/ConfigFile.cs | 3 +++ TShockAPI/GetDataHandlers.cs | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/TShockAPI/ConfigFile.cs b/TShockAPI/ConfigFile.cs index 22d5f9ef..c4ad5de8 100644 --- a/TShockAPI/ConfigFile.cs +++ b/TShockAPI/ConfigFile.cs @@ -211,6 +211,9 @@ namespace TShockAPI [Description("Some weapons override the range checks, however malicious users can take advantage of this and send lots of packets of certain types. Disabling this will turn off weapons that affect this.")] public bool EnableRangeCheckOverrides = true; + [Description("Disabling this prevents players from being banned or kicked based on item stacks.")] + public bool EnableItemStackChecks = true; + public static ConfigFile Read(string path) { if (!File.Exists(path)) diff --git a/TShockAPI/GetDataHandlers.cs b/TShockAPI/GetDataHandlers.cs index b8e24b82..6bc62f20 100644 --- a/TShockAPI/GetDataHandlers.cs +++ b/TShockAPI/GetDataHandlers.cs @@ -160,7 +160,10 @@ namespace TShockAPI if (stack>it.maxStack) { string reason = string.Format("Item Stack Hack Detected: player has {0} {1}(s) in one stack", stack,itemname); - TShock.Utils.HandleCheater(args.Player, reason); + if (TShock.Config.EnableItemStackChecks) + { + TShock.Utils.HandleCheater(args.Player, reason); + } } return false;