From 07c9c9ee8c45196f468e085b1e0a427c806b3ea7 Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Sat, 4 Feb 2017 16:34:18 +0000 Subject: [PATCH 1/2] Only update MostRecentFrame if the frame is the most recent. This fixes it being reset to 0 after an immediate order and not being set before dispatching (which may use it). --- OpenRA.Game/Server/Connection.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/OpenRA.Game/Server/Connection.cs b/OpenRA.Game/Server/Connection.cs index 2c78ce9169..e368c73216 100644 --- a/OpenRA.Game/Server/Connection.cs +++ b/OpenRA.Game/Server/Connection.cs @@ -104,8 +104,10 @@ namespace OpenRA.Server case ReceiveState.Data: { + if (MostRecentFrame < Frame) + MostRecentFrame = Frame; + server.DispatchOrders(this, Frame, bytes); - MostRecentFrame = Frame; ExpectLength = 8; State = ReceiveState.Header; } break; From b71d4ba7a3e23e51eeea1558bdad9d67c75ae6a8 Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Thu, 2 Feb 2017 19:13:14 +0000 Subject: [PATCH 2/2] Remove lag-drop frame workaround. --- OpenRA.Game/Server/Server.cs | 7 +------ OpenRA.Mods.Common/ServerTraits/PlayerPinger.cs | 4 ++-- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/OpenRA.Game/Server/Server.cs b/OpenRA.Game/Server/Server.cs index c7a63fcf10..3fef8bb940 100644 --- a/OpenRA.Game/Server/Server.cs +++ b/OpenRA.Game/Server/Server.cs @@ -542,11 +542,6 @@ namespace OpenRA.Server } public void DropClient(Connection toDrop) - { - DropClient(toDrop, toDrop.MostRecentFrame); - } - - public void DropClient(Connection toDrop, int frame) { if (!PreConns.Remove(toDrop)) { @@ -584,7 +579,7 @@ namespace OpenRA.Server } } - DispatchOrders(toDrop, frame, new byte[] { 0xbf }); + DispatchOrders(toDrop, toDrop.MostRecentFrame, new byte[] { 0xbf }); // All clients have left: clean up if (!Conns.Any()) diff --git a/OpenRA.Mods.Common/ServerTraits/PlayerPinger.cs b/OpenRA.Mods.Common/ServerTraits/PlayerPinger.cs index 2bbab743dc..623fec9710 100644 --- a/OpenRA.Mods.Common/ServerTraits/PlayerPinger.cs +++ b/OpenRA.Mods.Common/ServerTraits/PlayerPinger.cs @@ -49,7 +49,7 @@ namespace OpenRA.Mods.Common.Server var client = server.GetClient(c); if (client == null) { - server.DropClient(c, -1); + server.DropClient(c); server.SendMessage("A player has been dropped after timing out."); continue; } @@ -66,7 +66,7 @@ namespace OpenRA.Mods.Common.Server else { server.SendMessage(client.Name + " has been dropped after timing out."); - server.DropClient(c, -1); + server.DropClient(c); } }