diff --git a/OpenRA.Game/Network/OrderManager.cs b/OpenRA.Game/Network/OrderManager.cs index 6f8f18587c..b861bc9673 100644 --- a/OpenRA.Game/Network/OrderManager.cs +++ b/OpenRA.Game/Network/OrderManager.cs @@ -14,6 +14,7 @@ using System.Collections.Generic; using System.Drawing; using System.Linq; using OpenRA.Primitives; +using OpenRA.Support; namespace OpenRA.Network { @@ -67,7 +68,7 @@ namespace OpenRA.Network // Generating sync reports is expensive, so only do it if we have // other players to compare against if a desync did occur - generateSyncReport = !(Connection is ReplayConnection) && LobbyInfo.NonBotClients.Count() > 1; + generateSyncReport = !(Connection is ReplayConnection) && LobbyInfo.GlobalSettings.EnableSyncReports; NetFrameNumber = 1; for (var i = NetFrameNumber; i <= FramesAhead; i++) diff --git a/OpenRA.Game/Network/Session.cs b/OpenRA.Game/Network/Session.cs index 9f08efb1d0..c2ebd20f4d 100644 --- a/OpenRA.Game/Network/Session.cs +++ b/OpenRA.Game/Network/Session.cs @@ -201,6 +201,7 @@ namespace OpenRA.Network public bool AllowVersionMismatch; public string GameUid; public bool EnableSingleplayer; + public bool EnableSyncReports; public bool Dedicated; [FieldLoader.Ignore] diff --git a/OpenRA.Game/Server/Server.cs b/OpenRA.Game/Server/Server.cs index f2aa92b3c8..8fa3abbccd 100644 --- a/OpenRA.Game/Server/Server.cs +++ b/OpenRA.Game/Server/Server.cs @@ -157,6 +157,7 @@ namespace OpenRA.Server Map = settings.Map, ServerName = settings.Name, EnableSingleplayer = settings.EnableSingleplayer || !dedicated, + EnableSyncReports = settings.EnableSyncReports, GameUid = Guid.NewGuid().ToString(), Dedicated = dedicated } diff --git a/OpenRA.Game/Settings.cs b/OpenRA.Game/Settings.cs index 40bae6633c..80906cda93 100644 --- a/OpenRA.Game/Settings.cs +++ b/OpenRA.Game/Settings.cs @@ -74,6 +74,9 @@ namespace OpenRA [Desc("Query map information from the Resource Center if they are not available locally.")] public bool QueryMapRepository = true; + [Desc("Enable client-side report generation to help debug desync errors.")] + public bool EnableSyncReports = false; + public string TimestampFormat = "s"; public ServerSettings Clone()