From 79c0bddf5eb535850517552cb5e3858cf052bfd0 Mon Sep 17 00:00:00 2001 From: Maverick Motherfucker Date: Thu, 2 Jun 2011 21:35:58 -0700 Subject: [PATCH] Did same kind of protection with mana --- TShockAPI/TShock.cs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/TShockAPI/TShock.cs b/TShockAPI/TShock.cs index d97d0014..3dfef609 100644 --- a/TShockAPI/TShock.cs +++ b/TShockAPI/TShock.cs @@ -197,6 +197,21 @@ namespace TShockAPI Tools.HandleCheater(ply); } } + else if (e.MsgID == 0x2a) + { + byte ply; + Int16 life, maxLife; + using (var br = new BinaryReader(new MemoryStream(e.Msg.readBuffer, e.Index, e.Length))) + { + ply = br.ReadByte(); + life = br.ReadInt16(); + maxLife = br.ReadInt16(); + } + if (maxLife > Main.player[ply].statLifeMax + 20 || life > maxLife) + { + Tools.HandleCheater(ply); + } + } } void OnGreetPlayer(int who, HandledEventArgs e)