From ce822caf2a5f75d0c9be602b3044ce385d14c735 Mon Sep 17 00:00:00 2001 From: Lucas Nicodemus Date: Sat, 9 Dec 2017 01:39:54 -0700 Subject: [PATCH] Implement re-transmit of data if event handled in OnTilEdit Thanks to the suggestion of @bartico6, we now re-transmit packets of world data to prevent desync issues with respect to stopping a server action but not fixing the client's view of the world. --- TShockAPI/Bouncer.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/TShockAPI/Bouncer.cs b/TShockAPI/Bouncer.cs index 4a4df270..adbfd759 100644 --- a/TShockAPI/Bouncer.cs +++ b/TShockAPI/Bouncer.cs @@ -300,6 +300,7 @@ namespace TShockAPI if (!TShock.Utils.TilePlacementValid(tileX, tileY)) { + args.Player.SendTileSquare(tileX, tileY, 4); args.Handled = true; return; } @@ -312,6 +313,7 @@ namespace TShockAPI if (args.Player.Dead && TShock.Config.PreventDeadModification) { + args.Player.SendTileSquare(tileX, tileY, 4); args.Handled = true; return; } @@ -377,6 +379,7 @@ namespace TShockAPI return; } + // TODO: REMOVE. This does NOT look like Bouncer code. if (args.Player.AwaitingTempPoint > 0) { args.Player.TempPoints[args.Player.AwaitingTempPoint - 1].X = tileX; @@ -656,7 +659,8 @@ namespace TShockAPI } // Why 0.2? - // @bartico6: Because heal other player only happens when you are using the spectre armor with the hood, and the healing you can do with that is 20% of your damage. + // @bartico6: Because heal other player only happens when you are using the spectre armor with the hood, + // and the healing you can do with that is 20% of your damage. if (amount > TShock.Config.MaxDamage * 0.2) { args.Player.Disable("HealOtherPlayer cheat attempt!", DisableFlags.WriteToLogAndConsole);