diff --git a/TShockAPI/Commands.cs b/TShockAPI/Commands.cs index d3b763f5..b005d54a 100644 --- a/TShockAPI/Commands.cs +++ b/TShockAPI/Commands.cs @@ -180,8 +180,16 @@ namespace TShockAPI public static void Invade(CommandArgs args) { int ply = args.PlayerID; - Tools.Broadcast(Main.player[ply].name + " started an invasion."); - TShock.StartInvasion(); + if (Main.invasionSize <= 0) + { + Tools.Broadcast(Main.player[ply].name + " has started an invasion."); + TShock.StartInvasion(); + } + else + { + Tools.Broadcast(Main.player[ply].name + " has ended an invasion."); + Main.invasionSize = 0; + } } public static void Password(CommandArgs args) @@ -202,7 +210,7 @@ namespace TShockAPI public static void Spawn(CommandArgs args) { int ply = args.PlayerID; - TShock.Teleport(ply, Main.player[ply].SpawnX * 16, Main.player[ply].SpawnY * 16); + TShock.Teleport(ply, Main.spawnTileX * 16 + 8 - Main.player[ply].width / 2, Main.spawnTileY * 16 - Main.player[ply].height); Tools.SendMessage(ply, "Teleported to your spawnpoint."); } diff --git a/TShockAPI/TShock.cs b/TShockAPI/TShock.cs index 3e7afd5c..8d64a139 100644 --- a/TShockAPI/TShock.cs +++ b/TShockAPI/TShock.cs @@ -219,6 +219,19 @@ namespace TShockAPI Tools.HandleCheater(ply); } } + else if (e.MsgID == 0x19) + { + byte ply; + using (var br = new BinaryReader(new MemoryStream(e.Msg.readBuffer, e.Index, e.Length))) + { + ply = br.ReadByte(); + } + if (e.Msg.whoAmI != ply) + { + //fuck you faggot + Tools.HandleCheater(ply); + } + } } void OnGreetPlayer(int who, HandledEventArgs e) diff --git a/TShockAPI/TShockAPI.csproj b/TShockAPI/TShockAPI.csproj index 11aebcc5..d9987db5 100644 --- a/TShockAPI/TShockAPI.csproj +++ b/TShockAPI/TShockAPI.csproj @@ -69,8 +69,7 @@ - - + $(SolutionDir)\myass.bat