Add ability to collect system information from users' systems

This commit is contained in:
Oliver Brakmann
2016-02-21 21:10:39 +01:00
parent 86e4a72dce
commit 6b4ccecabe
5 changed files with 65 additions and 16 deletions

View File

@@ -92,6 +92,8 @@ namespace OpenRA
public bool SanityCheckUnsyncedCode = false; public bool SanityCheckUnsyncedCode = false;
public int Samples = 25; public int Samples = 25;
public bool IgnoreVersionMismatch = false; public bool IgnoreVersionMismatch = false;
public bool SendSystemInformation = true;
public string UUID = System.Guid.NewGuid().ToString();
} }
public class GraphicSettings public class GraphicSettings
@@ -179,7 +181,7 @@ namespace OpenRA
public Modifiers ZoomModifier = Modifiers.Ctrl; public Modifiers ZoomModifier = Modifiers.Ctrl;
public bool FetchNews = true; public bool FetchNews = true;
public string NewsUrl = "http://www.openra.net/gamenews"; public string NewsUrl = "http://master.openra.net/gamenews";
} }
public class KeySettings public class KeySettings

View File

@@ -220,7 +220,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
if (newsButton != null) if (newsButton != null)
{ {
if (!fetchedNews) if (!fetchedNews)
new Download(Game.Settings.Game.NewsUrl, cacheFile, e => { }, new Download(Game.Settings.Game.NewsUrl + SysInfoQuery(), cacheFile, e => { },
(e, c) => NewsDownloadComplete(e, cacheFile, currentNews, (e, c) => NewsDownloadComplete(e, cacheFile, currentNews,
() => newsButton.AttachPanel(newsPanel))); () => newsButton.AttachPanel(newsPanel)));
@@ -252,6 +252,22 @@ namespace OpenRA.Mods.Common.Widgets.Logic
() => { Game.CloseServer(); SwitchMenu(MenuType.MapEditor); }); () => { Game.CloseServer(); SwitchMenu(MenuType.MapEditor); });
} }
string SysInfoQuery()
{
if (!Game.Settings.Debug.SendSystemInformation)
return null;
return "?id={0}&platform={1}&os={2}&runtime={3}&lang={4}&version={5}&mod={6}&modversion={7}".F(
Uri.EscapeUriString(Game.Settings.Debug.UUID),
Uri.EscapeUriString(Platform.CurrentPlatform.ToString()),
Uri.EscapeUriString(Environment.OSVersion.ToString()),
Uri.EscapeUriString(Platform.RuntimeVersion),
Uri.EscapeUriString(System.Globalization.CultureInfo.InstalledUICulture.TwoLetterISOLanguageName),
Uri.EscapeUriString(ModMetadata.AllMods["modchooser"].Version),
Uri.EscapeUriString(Game.ModData.Manifest.Mod.Id),
Uri.EscapeUriString(Game.ModData.Manifest.Mod.Version));
}
void SetNewsStatus(string message) void SetNewsStatus(string message)
{ {
message = WidgetUtils.WrapText(message, newsStatus.Bounds.Width, Game.Renderer.Fonts[newsStatus.Font]); message = WidgetUtils.WrapText(message, newsStatus.Bounds.Width, Game.Renderer.Fonts[newsStatus.Font]);

View File

@@ -604,6 +604,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
BindCheckboxPref(panel, "BOTDEBUG_CHECKBOX", ds, "BotDebug"); BindCheckboxPref(panel, "BOTDEBUG_CHECKBOX", ds, "BotDebug");
BindCheckboxPref(panel, "FETCH_NEWS_CHECKBOX", gs, "FetchNews"); BindCheckboxPref(panel, "FETCH_NEWS_CHECKBOX", gs, "FetchNews");
BindCheckboxPref(panel, "LUADEBUG_CHECKBOX", ds, "LuaDebug"); BindCheckboxPref(panel, "LUADEBUG_CHECKBOX", ds, "LuaDebug");
BindCheckboxPref(panel, "SENDSYSINFO_CHECKBOX", ds, "SendSystemInformation");
return () => { }; return () => { };
} }

View File

@@ -523,6 +523,13 @@ Container@SETTINGS_PANEL:
Height: 20 Height: 20
Font: Regular Font: Regular
Text: Show Performance Text Text: Show Performance Text
Checkbox@PERFGRAPH_CHECKBOX:
X: 15
Y: 100
Width: 300
Height: 20
Font: Regular
Text: Show Performance Graph
Checkbox@FETCH_NEWS_CHECKBOX: Checkbox@FETCH_NEWS_CHECKBOX:
X: 310 X: 310
Y: 40 Y: 40
@@ -530,43 +537,51 @@ Container@SETTINGS_PANEL:
Height: 20 Height: 20
Font: Regular Font: Regular
Text: Fetch Community News Text: Fetch Community News
Checkbox@PERFGRAPH_CHECKBOX: Checkbox@SENDSYSINFO_CHECKBOX:
X: 310 X: 310
Y: 70 Y: 70
Width: 300 Width: 300
Height: 20 Height: 20
Font: Regular Font: Regular
Text: Show Performance Graph Text: Send System Information
Label@SENDSYSINFO_DESC:
X: 310
Y: 85
Width: 250
Height: 30
Font: Tiny
WordWrap: True
Text: Your Operating System, OpenGL and .NET runtime versions, and language settings will be sent along with an anonymous ID to help priorise future development.
Label@DEBUG_TITLE: Label@DEBUG_TITLE:
Y: 140 Y: 170
Width: PARENT_RIGHT Width: PARENT_RIGHT
Font: Bold Font: Bold
Text: Debug Text: Debug
Align: Center Align: Center
Checkbox@BOTDEBUG_CHECKBOX: Checkbox@BOTDEBUG_CHECKBOX:
X: 15 X: 15
Y: 160 Y: 190
Width: 300 Width: 300
Height: 20 Height: 20
Font: Regular Font: Regular
Text: Show Bot Debug Messages Text: Show Bot Debug Messages
Checkbox@VERBOSE_NAT_CHECKBOX: Checkbox@VERBOSE_NAT_CHECKBOX:
X: 310 X: 310
Y: 160 Y: 190
Width: 300 Width: 300
Height: 20 Height: 20
Font: Regular Font: Regular
Text: Detailed NAT logging Text: Detailed NAT logging
Checkbox@CHECKUNSYNCED_CHECKBOX: Checkbox@CHECKUNSYNCED_CHECKBOX:
X: 15 X: 15
Y: 190 Y: 220
Width: 300 Width: 300
Height: 20 Height: 20
Font: Regular Font: Regular
Text: Check Sync around Unsynced Code Text: Check Sync around Unsynced Code
Checkbox@LUADEBUG_CHECKBOX: Checkbox@LUADEBUG_CHECKBOX:
X: 310 X: 310
Y: 190 Y: 220
Width: 300 Width: 300
Height: 20 Height: 20
Font: Regular Font: Regular

View File

@@ -524,6 +524,13 @@ Background@SETTINGS_PANEL:
Height: 20 Height: 20
Font: Regular Font: Regular
Text: Show Performance Text Text: Show Performance Text
Checkbox@PERFGRAPH_CHECKBOX:
X: 15
Y: 100
Width: 300
Height: 20
Font: Regular
Text: Show Performance Graph
Checkbox@FETCH_NEWS_CHECKBOX: Checkbox@FETCH_NEWS_CHECKBOX:
X: 310 X: 310
Y: 40 Y: 40
@@ -531,43 +538,51 @@ Background@SETTINGS_PANEL:
Height: 20 Height: 20
Font: Regular Font: Regular
Text: Fetch Community News Text: Fetch Community News
Checkbox@PERFGRAPH_CHECKBOX: Checkbox@SENDSYSINFO_CHECKBOX:
X: 310 X: 310
Y: 70 Y: 70
Width: 300 Width: 300
Height: 20 Height: 20
Font: Regular Font: Regular
Text: Show Performance Graph Text: Send System Information
Label@SENDSYSINFO_DESC:
X: 310
Y: 85
Width: 250
Height: 30
Font: Tiny
WordWrap: True
Text: Your Operating System, OpenGL and .NET runtime versions, and language settings will be sent along with an anonymous ID to help priorise future development.
Label@DEBUG_TITLE: Label@DEBUG_TITLE:
Y: 140 Y: 170
Width: PARENT_RIGHT Width: PARENT_RIGHT
Font: Bold Font: Bold
Text: Debug Text: Debug
Align: Center Align: Center
Checkbox@BOTDEBUG_CHECKBOX: Checkbox@BOTDEBUG_CHECKBOX:
X: 15 X: 15
Y: 160 Y: 190
Width: 300 Width: 300
Height: 20 Height: 20
Font: Regular Font: Regular
Text: Show Bot Debug Messages Text: Show Bot Debug Messages
Checkbox@VERBOSE_NAT_CHECKBOX: Checkbox@VERBOSE_NAT_CHECKBOX:
X: 310 X: 310
Y: 160 Y: 190
Width: 300 Width: 300
Height: 20 Height: 20
Font: Regular Font: Regular
Text: Detailed NAT logging Text: Detailed NAT logging
Checkbox@CHECKUNSYNCED_CHECKBOX: Checkbox@CHECKUNSYNCED_CHECKBOX:
X: 15 X: 15
Y: 190 Y: 220
Width: 300 Width: 300
Height: 20 Height: 20
Font: Regular Font: Regular
Text: Check Sync around Unsynced Code Text: Check Sync around Unsynced Code
Checkbox@LUADEBUG_CHECKBOX: Checkbox@LUADEBUG_CHECKBOX:
X: 310 X: 310
Y: 190 Y: 220
Width: 300 Width: 300
Height: 20 Height: 20
Font: Regular Font: Regular