From ec116a6b4cc4919071f3af1d6ca1a975023649a5 Mon Sep 17 00:00:00 2001 From: vharonftw Date: Sun, 11 Dec 2011 06:57:35 +0800 Subject: [PATCH 1/2] added filter to ingnore custom projectiles made by the client --- TShockAPI/GetDataHandlers.cs | 12 ++++++++++++ TShockAPI/TShockAPI.csproj | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/TShockAPI/GetDataHandlers.cs b/TShockAPI/GetDataHandlers.cs index e59a8de5..2f2779ff 100644 --- a/TShockAPI/GetDataHandlers.cs +++ b/TShockAPI/GetDataHandlers.cs @@ -525,6 +525,18 @@ namespace TShockAPI else return TShock.Utils.HandleExplosivesUser(args.Player, TShock.Config.ExplosiveAbuseReason); } + if (args.Player.Index != owner)//ignores projectiles whose senders aren't the same as their owners + { + TShock.Players[args.Player.Index].SendData(PacketTypes.ProjectileNew, "", ident);//update projectile on senders end so he knows it didnt get created + return true; + } + Projectile proj = new Projectile(); + proj.SetDefaults(type); + if (proj.hostile)//ignores all hostile projectiles from the client they shouldn't be sending them anyways + { + TShock.Players[args.Player.Index].SendData(PacketTypes.ProjectileNew, "", ident); + return true; + } return false; } diff --git a/TShockAPI/TShockAPI.csproj b/TShockAPI/TShockAPI.csproj index d9cb993b..9a60f687 100644 --- a/TShockAPI/TShockAPI.csproj +++ b/TShockAPI/TShockAPI.csproj @@ -184,7 +184,7 @@ - +