From 3b748f1156c12dec293185cc19504db045e21abf Mon Sep 17 00:00:00 2001 From: Lucas Nicodemus Date: Tue, 19 May 2020 23:42:59 -0700 Subject: [PATCH] Potentially fix player desync issue It was discovered that LastNetPosition is being checked to see if it's zero in Bouncer. Then, Bouncer rejects the update. The default is zero and potentially this can be zero in other ways. The original code in master (checked at 9f4892f in GetDataHandlers) had an additional write on LastNetPosition to update it, but this write was not moved over to Bouncer. Thus, there is a high probability that players are "desync'd" after LastNetPosition gets stuck at zero and never updates. --- TShockAPI/Bouncer.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/TShockAPI/Bouncer.cs b/TShockAPI/Bouncer.cs index 1c64448e..a0a5dee9 100644 --- a/TShockAPI/Bouncer.cs +++ b/TShockAPI/Bouncer.cs @@ -122,9 +122,9 @@ namespace TShockAPI if (args.Player.LastNetPosition == Vector2.Zero) { - TShock.Log.ConsoleDebug("Bouncer / OnPlayerUpdate rejected from (last network position) {0}", args.Player.Name); - args.Handled = true; - return; + TShock.Log.ConsoleInfo("Bouncer / OnPlayerUpdate *would have rejected* from (last network position zero) {0}", args.Player.Name); + // args.Handled = true; + // return; } if (!pos.Equals(args.Player.LastNetPosition)) @@ -184,6 +184,7 @@ namespace TShockAPI } } + args.Player.LastNetPosition = pos; return; }