From 14e2d8ca46ed430025d0a29c87fe60bf231b7178 Mon Sep 17 00:00:00 2001 From: Zidonuke Date: Tue, 27 Dec 2011 14:53:55 -0500 Subject: [PATCH] Add max range for being restricted Change max reserved slots to 20 --- TShockAPI/ConfigFile.cs | 3 +++ TShockAPI/GetDataHandlers.cs | 2 +- TShockAPI/TShock.cs | 6 +++--- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/TShockAPI/ConfigFile.cs b/TShockAPI/ConfigFile.cs index 0945cc89..52692e9d 100644 --- a/TShockAPI/ConfigFile.cs +++ b/TShockAPI/ConfigFile.cs @@ -204,6 +204,9 @@ namespace TShockAPI [Description("Disables Invisibility potions from being used in PvP (Note, they can use them on the client, but the effect isn't sent to the rest of the server)")] public bool DisableInvisPvP = false; + + [Description("The maximum distance players disabled for various reasons can move from")] + public int MaxRangeForDisabled = 10; public static ConfigFile Read(string path) { diff --git a/TShockAPI/GetDataHandlers.cs b/TShockAPI/GetDataHandlers.cs index 7bb592de..e9e3c46c 100644 --- a/TShockAPI/GetDataHandlers.cs +++ b/TShockAPI/GetDataHandlers.cs @@ -615,7 +615,7 @@ namespace TShockAPI if (!pos.Equals(args.Player.LastNetPosition)) { float distance = Vector2.Distance(new Vector2((pos.X / 16f), (pos.Y / 16f)), new Vector2(Main.spawnTileX, Main.spawnTileY)); - if (TShock.CheckIgnores(args.Player) && distance > 6f) + if (TShock.CheckIgnores(args.Player) && distance > TShock.Config.MaxRangeForDisabled) { if(args.Player.IgnoreActionsForCheating != "none") { diff --git a/TShockAPI/TShock.cs b/TShockAPI/TShock.cs index 83fa0791..d1176ac2 100644 --- a/TShockAPI/TShock.cs +++ b/TShockAPI/TShock.cs @@ -1243,9 +1243,9 @@ namespace TShockAPI Netplay.serverPort = file.ServerPort; } - if (file.MaxSlots > 250) - file.MaxSlots = 250; - Main.maxNetPlayers = file.MaxSlots + 5; + if (file.MaxSlots > 235) + file.MaxSlots = 235; + Main.maxNetPlayers = file.MaxSlots + 20; Netplay.spamCheck = false;