From 353393571f99af4e45fbefb17accdeed395130cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Mail=C3=A4nder?= Date: Mon, 14 Oct 2013 21:26:22 +0200 Subject: [PATCH 1/4] added a Game ID closes #2570 --- OpenRA.Game/Network/Session.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/OpenRA.Game/Network/Session.cs b/OpenRA.Game/Network/Session.cs index 953f0ceb5a..50ddc471e0 100644 --- a/OpenRA.Game/Network/Session.cs +++ b/OpenRA.Game/Network/Session.cs @@ -138,11 +138,13 @@ namespace OpenRA.Network public int StartingCash = 5000; public string StartingUnitsClass = "none"; public bool AllowVersionMismatch; + public string GameUid; } public Session(string[] mods) { this.GlobalSettings.Mods = mods.ToArray(); + this.GlobalSettings.GameUid = System.Guid.NewGuid().ToString(); } public string Serialize() From 8c8df3bda957208949d70806cafcea46c7fd140a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Mail=C3=A4nder?= Date: Mon, 14 Oct 2013 21:39:23 +0200 Subject: [PATCH 2/4] expose Game ID and client player name to syncreport.log --- OpenRA.Game/Network/SyncReport.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/OpenRA.Game/Network/SyncReport.cs b/OpenRA.Game/Network/SyncReport.cs index 52902f9cda..27132b4fcf 100755 --- a/OpenRA.Game/Network/SyncReport.cs +++ b/OpenRA.Game/Network/SyncReport.cs @@ -178,6 +178,8 @@ namespace OpenRA.Network { if (r.Frame == frame) { + Log.Write("sync", "Player: {0}", Game.Settings.Player.Name); + Log.Write("sync", "Game ID: {0}", orderManager.LobbyInfo.GlobalSettings.GameUid); Log.Write("sync", "Sync for net frame {0} -------------", r.Frame); Log.Write("sync", "SharedRandom: {0} (#{1})", r.SyncedRandom, r.TotalCount); Log.Write("sync", "Synced Traits:"); From 70ba7fe5f6a132e254cd17cbb38df8ba3954c08c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Mail=C3=A4nder?= Date: Tue, 15 Oct 2013 17:56:31 +0200 Subject: [PATCH 3/4] added OpenRA, OS and .NET/Mono runtime version to exception.log --- OpenRA.FileFormats/Platform.cs | 17 +++++++++++++++++ OpenRA.Game/Support/Program.cs | 7 ++++++- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/OpenRA.FileFormats/Platform.cs b/OpenRA.FileFormats/Platform.cs index 352f36ae7d..93ce4479bb 100644 --- a/OpenRA.FileFormats/Platform.cs +++ b/OpenRA.FileFormats/Platform.cs @@ -11,6 +11,7 @@ using System; using System.Diagnostics; using System.IO; +using System.Reflection; using OpenRA.FileFormats; namespace OpenRA @@ -45,6 +46,22 @@ namespace OpenRA return PlatformType.Unknown; } + public static string RuntimeVersion + { + get + { + var mono = Type.GetType("Mono.Runtime"); + if (mono == null) + return ".NET CLR {0}".F(Environment.Version); + + var version = mono.GetMethod("GetDisplayName", BindingFlags.NonPublic | BindingFlags.Static); + if (version == null) + return "Mono (unknown version) CLR {0}".F(Environment.Version); + + return "Mono {0} CLR {1}".F(version.Invoke(null, null), Environment.Version); + } + } + public static string SupportDir { get diff --git a/OpenRA.Game/Support/Program.cs b/OpenRA.Game/Support/Program.cs index 46af602df8..f548a5ba75 100644 --- a/OpenRA.Game/Support/Program.cs +++ b/OpenRA.Game/Support/Program.cs @@ -46,6 +46,10 @@ namespace OpenRA static void FatalError(Exception e) { Log.AddChannel("exception", "exception.log"); + var mod = Game.CurrentMods.First().Value; + Log.Write("exception", "{0} Mod at Version {1}", mod.Title, mod.Version); + Log.Write("exception", "Operating System: {0} ({1})", Platform.CurrentPlatform, Environment.OSVersion); + Log.Write("exception", "Runtime Version: {0}", Platform.RuntimeVersion); var rpt = BuildExceptionReport(e).ToString(); Log.Write("exception", "{0}", rpt); Console.Error.WriteLine(rpt); @@ -69,7 +73,8 @@ namespace OpenRA static StringBuilder BuildExceptionReport(Exception e, StringBuilder sb, int d) { - if (e == null) return sb; + if (e == null) + return sb; sb.AppendFormat("Exception of type `{0}`: {1}", e.GetType().FullName, e.Message); From eff943b3eb626d507494c2d5fb22f8a646538857 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Mail=C3=A4nder?= Date: Wed, 16 Oct 2013 17:08:26 +0200 Subject: [PATCH 4/4] added OS and Mono/.NET runtime version to syncreport.log --- OpenRA.Game/Network/SyncReport.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/OpenRA.Game/Network/SyncReport.cs b/OpenRA.Game/Network/SyncReport.cs index 27132b4fcf..079ec31138 100755 --- a/OpenRA.Game/Network/SyncReport.cs +++ b/OpenRA.Game/Network/SyncReport.cs @@ -178,8 +178,9 @@ namespace OpenRA.Network { if (r.Frame == frame) { - Log.Write("sync", "Player: {0}", Game.Settings.Player.Name); - Log.Write("sync", "Game ID: {0}", orderManager.LobbyInfo.GlobalSettings.GameUid); + Log.Write("sync", "Player: {0} ({1} {2} {3})", Game.Settings.Player.Name, Platform.CurrentPlatform, Environment.OSVersion, Platform.RuntimeVersion); + var mod = Game.CurrentMods.First().Value; + Log.Write("sync", "Game ID: {0} (Mod: {1} at Version {2})", orderManager.LobbyInfo.GlobalSettings.GameUid, mod.Title, mod.Version); Log.Write("sync", "Sync for net frame {0} -------------", r.Frame); Log.Write("sync", "SharedRandom: {0} (#{1})", r.SyncedRandom, r.TotalCount); Log.Write("sync", "Synced Traits:");