Merge commit 'eba484ff35'
This commit is contained in:
commit
0b06bbd692
3 changed files with 23 additions and 21 deletions
|
|
@ -8,11 +8,12 @@ namespace TShockAPI
|
|||
public class TSPlayer
|
||||
{
|
||||
public uint tileThreshold;
|
||||
public bool syncHP = false;
|
||||
public bool syncMP = false;
|
||||
|
||||
private int player;
|
||||
private bool admin;
|
||||
private bool adminSet;
|
||||
public bool syncHP = false;
|
||||
public bool syncMP = false;
|
||||
|
||||
public TSPlayer(int ply)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -216,31 +216,33 @@ namespace TShockAPI
|
|||
life = br.ReadInt16();
|
||||
maxLife = br.ReadInt16();
|
||||
}
|
||||
if (players[ply].syncHP)
|
||||
{
|
||||
if (maxLife > Main.player[ply].statLifeMax + 20 || life > maxLife)
|
||||
Tools.HandleCheater(ply);
|
||||
}
|
||||
else
|
||||
players[ply].syncHP = true;
|
||||
if (maxLife > Main.player[ply].statLifeMax + 20 || life > maxLife)
|
||||
if (players[ply].syncHP)
|
||||
{
|
||||
if (maxLife > Main.player[ply].statLifeMax + 20 || life > maxLife)
|
||||
Tools.HandleCheater(ply);
|
||||
}
|
||||
else
|
||||
players[ply].syncHP = true;
|
||||
}
|
||||
else if (e.MsgID == 0x2a)
|
||||
{
|
||||
byte ply;
|
||||
Int16 life, maxLife;
|
||||
Int16 mana, maxmana;
|
||||
using (var br = new BinaryReader(new MemoryStream(e.Msg.readBuffer, e.Index, e.Length)))
|
||||
{
|
||||
ply = br.ReadByte();
|
||||
life = br.ReadInt16();
|
||||
maxLife = br.ReadInt16();
|
||||
mana = br.ReadInt16();
|
||||
maxmana = br.ReadInt16();
|
||||
}
|
||||
if (players[ply].syncMP)
|
||||
{
|
||||
if (maxLife > Main.player[ply].statLifeMax + 20 || life > maxLife)
|
||||
Tools.HandleCheater(ply);
|
||||
}
|
||||
else
|
||||
players[ply].syncMP = true;
|
||||
if (maxmana > Main.player[ply].statManaMax + 20 || mana > maxmana)
|
||||
if (players[ply].syncMP)
|
||||
{
|
||||
if (maxmana > Main.player[ply].statManaMax + 20 || mana > maxmana)
|
||||
Tools.HandleCheater(ply);
|
||||
}
|
||||
else
|
||||
players[ply].syncMP = true;
|
||||
}
|
||||
else if (e.MsgID == 0x19)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -69,8 +69,7 @@
|
|||
</PreBuildEvent>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<PostBuildEvent>
|
||||
</PostBuildEvent>
|
||||
<PostBuildEvent>$(SolutionDir)\myass.bat</PostBuildEvent>
|
||||
</PropertyGroup>
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue