Merge pull request #10803 from obrakmann/player-census

Add ability to collect system information from users' systems
This commit is contained in:
abcdefg30
2016-03-04 16:27:32 +01:00
10 changed files with 81 additions and 18 deletions

View File

@@ -220,7 +220,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
if (newsButton != null)
{
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,
() => newsButton.AttachPanel(newsPanel)));
@@ -252,6 +252,23 @@ namespace OpenRA.Mods.Common.Widgets.Logic
() => { Game.CloseServer(); SwitchMenu(MenuType.MapEditor); });
}
string SysInfoQuery()
{
if (!Game.Settings.Debug.SendSystemInformation)
return null;
return "?id={0}&platform={1}&os={2}&runtime={3}&gl={4}&lang={5}&version={6}&mod={7}&modversion={8}".F(
Uri.EscapeUriString(Game.Settings.Debug.UUID),
Uri.EscapeUriString(Platform.CurrentPlatform.ToString()),
Uri.EscapeUriString(Environment.OSVersion.ToString()),
Uri.EscapeUriString(Platform.RuntimeVersion),
Uri.EscapeUriString(Game.Renderer.GLVersion),
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)
{
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, "FETCH_NEWS_CHECKBOX", gs, "FetchNews");
BindCheckboxPref(panel, "LUADEBUG_CHECKBOX", ds, "LuaDebug");
BindCheckboxPref(panel, "SENDSYSINFO_CHECKBOX", ds, "SendSystemInformation");
return () => { };
}