Blocked KillMe from other players.

This commit is contained in:
Deathmax 2011-06-04 11:51:54 +08:00
parent ab67d9f137
commit d0fe76090d

View file

@ -260,7 +260,7 @@ namespace TShockAPI
else else
players[ply].syncMP = true; players[ply].syncMP = true;
} }
else if (e.MsgID == 0x19) else if (e.MsgID == 0x19) // Chat Text
{ {
byte ply; byte ply;
using (var br = new BinaryReader(new MemoryStream(e.Msg.readBuffer, e.Index, e.Length))) using (var br = new BinaryReader(new MemoryStream(e.Msg.readBuffer, e.Index, e.Length)))
@ -273,7 +273,7 @@ namespace TShockAPI
Tools.HandleCheater(ply); Tools.HandleCheater(ply);
} }
} }
else if (e.MsgID == 0x1B) else if (e.MsgID == 0x1B) // New Projectile
{ {
Int16 ident; Int16 ident;
float posx; float posx;
@ -312,6 +312,24 @@ namespace TShockAPI
} }
} }
} }
else if (e.MsgID == 0x2C) // KillMe
{
byte id;
byte hitdirection;
short dmg;
bool pvp;
using (var br = new BinaryReader(new MemoryStream(e.Msg.readBuffer, e.Index, e.Length)))
{
id = br.ReadByte();
hitdirection = br.ReadByte();
dmg = br.ReadInt16();
pvp = br.ReadBoolean();
}
if (id != e.Msg.whoAmI)
{
Tools.HandleCheater(e.Msg.whoAmI);
}
}
} }
catch (Exception ex) catch (Exception ex)
{ {