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.
This commit is contained in:
Lucas Nicodemus 2020-05-19 23:42:59 -07:00
parent 1ae88c9339
commit 3b748f1156
No known key found for this signature in database
GPG key ID: A07BD9023D1664DB

View file

@ -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;
}