From cf9157bc9403215829ee981a80ee0b85086def25 Mon Sep 17 00:00:00 2001 From: Deathmax Date: Mon, 22 Aug 2011 19:16:27 +0800 Subject: [PATCH] Changed how abuse of TileGetSection is handled. (2nd request will cause a kick) - Thanks Lycaonj and UndeadMiner. --- TShockAPI/GetDataHandlers.cs | 7 +++++-- TShockAPI/TSPlayer.cs | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/TShockAPI/GetDataHandlers.cs b/TShockAPI/GetDataHandlers.cs index d487bbfa..acf4faeb 100644 --- a/TShockAPI/GetDataHandlers.cs +++ b/TShockAPI/GetDataHandlers.cs @@ -712,9 +712,12 @@ namespace TShockAPI var x = args.Data.ReadInt32(); var y = args.Data.ReadInt32(); - if (args.Player.RequestedSections.Contains(new Vector2(x, y))) + if (args.Player.RequestedSection) + { + Tools.ForceKick(args.Player, "Requested sections more than once."); return true; - args.Player.RequestedSections.Add(new Vector2(x, y)); + } + args.Player.RequestedSection = true; return false; } } diff --git a/TShockAPI/TSPlayer.cs b/TShockAPI/TSPlayer.cs index a4882f91..ce01f940 100644 --- a/TShockAPI/TSPlayer.cs +++ b/TShockAPI/TSPlayer.cs @@ -57,7 +57,7 @@ namespace TShockAPI public bool HasBeenNaggedAboutLoggingIn; public bool TpLock = false; Player FakePlayer; - public List RequestedSections = new List(); + public bool RequestedSection = false; public DateTime LastDeath { get; set; } public bool ForceSpawn = false;