From cc9a45dafffe0e93caee5b33b920370a4d6ae2fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Mail=C3=A4nder?= Date: Thu, 16 May 2013 19:49:45 +0200 Subject: [PATCH] set the order lag to 1 in single player games --- OpenRA.Game/Server/Server.cs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/OpenRA.Game/Server/Server.cs b/OpenRA.Game/Server/Server.cs index cb0d481268..8f7c3316cf 100644 --- a/OpenRA.Game/Server/Server.cs +++ b/OpenRA.Game/Server/Server.cs @@ -326,10 +326,22 @@ namespace OpenRA.Server if (mods.Any(m => m.Contains("{DEV_VERSION}"))) SendMessage("{0} is running an unversioned development build, ".F(client.Name) + "and may desynchronize the game state if they have incompatible rules."); + + SetOrderLag(); } catch (Exception) { DropClient(newConn); } } + void SetOrderLag() + { + if (lobbyInfo.IsSinglePlayer) + lobbyInfo.GlobalSettings.OrderLatency = 1; + else + lobbyInfo.GlobalSettings.OrderLatency = 3; + + SyncLobbyInfo(); + } + public static void SyncClientToPlayerReference(Session.Client c, PlayerReference pr) { if (pr == null) @@ -524,6 +536,8 @@ namespace OpenRA.Server toDrop.socket.Disconnect(false); } catch { } + + SetOrderLag(); } public void SyncLobbyInfo()