More cheat detection, if more than 20 HP is added to max at a time, bye bye
This commit is contained in:
parent
087dfabffe
commit
bb8cf74ec0
1 changed files with 15 additions and 0 deletions
|
|
@ -182,6 +182,21 @@ namespace TShockAPI
|
||||||
Tools.Kick(e.Msg.whoAmI, "Spawn NPC abuse");
|
Tools.Kick(e.Msg.whoAmI, "Spawn NPC abuse");
|
||||||
e.Handled = true;
|
e.Handled = true;
|
||||||
}
|
}
|
||||||
|
else if (e.MsgID == 0x10)
|
||||||
|
{
|
||||||
|
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)
|
void OnGreetPlayer(int who, HandledEventArgs e)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue