1
1
forked from 0ad/0ad

Remove disabled remains of the performance data (= profiler data + text input) upload feature from the UserReporter from 0da7e822ff.

User-submitted text upload was removed in 2779512c6e in preference of
the bugtracker.
Remove leftover mainmenu.js function that this commit should have
removed.

Profiler data upload was disabled in b9e46f386b because the data amount
was too large and because the two timing snapshots are inconclusive
without further data.
The hereby removed exposed JS functions could have been exploited by JS
mods to upload 0ad userdata to arbitrary places.

The performance data upload feature can be redesigned, implemented
without JS exposure, with a more transparent privacy policy (refs
#5257).

Differential Revision: https://code.wildfiregames.com/D1597
Performance upload feature removal accepted by: Vladislav
This was SVN commit r21858.
This commit is contained in:
elexis 2018-08-05 15:18:00 +00:00
parent bdc68f85c9
commit 2af94c5898
7 changed files with 2 additions and 68 deletions

View File

@ -5,7 +5,6 @@ The following data will be sent to our server:
• A random user ID (stored in %APPDATA%\\0ad\\config\\user.cfg on Windows, ~/.config/0ad/config/user.cfg on Unix), to let us detect repeated reports from the same user.
• Game version number and basic build settings (optimisation mode, CPU architecture, timestamp, compiler version).
• Hardware details: OS version, graphics driver version, OpenGL capabilities, screen size, CPU details, RAM size.
• Performance details: a snapshot of timing data a few seconds after you start a match or change graphics settings.
The data will only be a few kilobytes each time you run the game, so bandwidth usage is minimal.

View File

@ -79,14 +79,6 @@ function scrollBackgrounds()
}
}
function submitUserReportMessage()
{
let input = Engine.GetGUIObjectByName("userReportMessageInput");
if (input.caption.length)
Engine.SubmitUserReport("message", 1, input.caption);
input.caption = "";
}
function formatUserReportStatus(status)
{
let d = status.split(/:/, 3);

View File

@ -287,16 +287,6 @@ function init(initData, hotloadData)
sendLobbyPlayerlistUpdate();
onSimulationUpdate();
setTimeout(displayGamestateNotifications, 1000);
// Report the performance after 5 seconds (when we're still near
// the initial camera view) and a minute (when the profiler will
// have settled down if framerates as very low), to give some
// extremely rough indications of performance
//
// DISABLED: this information isn't currently useful for anything much,
// and it generates a massive amount of data to transmit and store
// setTimeout(function() { reportPerformance(5); }, 5000);
// setTimeout(function() { reportPerformance(60); }, 60000);
}
function initGUIObjects()
@ -713,18 +703,6 @@ function updateTopPanel()
Engine.GetGUIObjectByName("lobbyButton").enabled = Engine.HasXmppClient();
}
function reportPerformance(time)
{
let settings = g_GameAttributes.settings;
Engine.SubmitUserReport("profile", 3, JSON.stringify({
"time": time,
"map": settings.Name,
"seed": settings.Seed, // only defined for random maps
"size": settings.Size, // only defined for random maps
"profiler": Engine.GetProfilerState()
}));
}
/**
* Resign a player.
* @param leaveGameAfterResign If player is quitting after resignation.

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2017 Wildfire Games.
/* Copyright (C) 2018 Wildfire Games.
* This file is part of 0 A.D.
*
* 0 A.D. is free software: you can redistribute it and/or modify
@ -600,21 +600,6 @@ void CProfileViewer::SaveToFile()
m->outputStream.flush();
}
JS::Value CProfileViewer::SaveToJS(const ScriptInterface& scriptInterface)
{
JSContext* cx = scriptInterface.GetContext();
JSAutoRequest rq(cx);
JS::RootedValue root(cx);
scriptInterface.Eval("({})", &root);
std::vector<AbstractProfileTable*> tables = m->rootTables;
sort(tables.begin(), tables.end(), SortByName);
for_each(tables.begin(), tables.end(), DumpTable(scriptInterface, root));
return root;
}
void CProfileViewer::ShowTable(const CStr& table)
{
m->path.clear();

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2017 Wildfire Games.
/* Copyright (C) 2018 Wildfire Games.
* This file is part of 0 A.D.
*
* 0 A.D. is free software: you can redistribute it and/or modify
@ -187,12 +187,6 @@ public:
*/
void SaveToFile();
/**
* SaveToJS: Return a script value containing the current profiler data
* (for all profile tables).
*/
JS::Value SaveToJS(const ScriptInterface& scriptInterface);
/**
* ShowTable: Set the named profile table to be the displayed one. If it
* is not found, no profile is displayed.

View File

@ -55,11 +55,6 @@ void JSI_Debug::DisplayErrorDialog(ScriptInterface::CxPrivate* UNUSED(pCxPrivate
debug_DisplayError(msg.c_str(), DE_NO_DEBUG_INFO, NULL, NULL, NULL, 0, NULL, NULL);
}
JS::Value JSI_Debug::GetProfilerState(ScriptInterface::CxPrivate* pCxPrivate)
{
return g_ProfileViewer.SaveToJS(*(pCxPrivate->pScriptInterface));
}
// Return the date/time at which the current executable was compiled.
// params: mode OR an integer specifying
// what to display: -1 for "date time (svn revision)", 0 for date, 1 for time, 2 for svn revision
@ -137,23 +132,16 @@ std::string JSI_Debug::GetUserReportStatus(ScriptInterface::CxPrivate* UNUSED(pC
return g_UserReporter.GetStatus();
}
void JSI_Debug::SubmitUserReport(ScriptInterface::CxPrivate* UNUSED(pCxPrivate), const std::string& type, int version, const std::wstring& data)
{
g_UserReporter.SubmitReport(type.c_str(), version, utf8_from_wstring(data));
}
void JSI_Debug::RegisterScriptFunctions(const ScriptInterface& scriptInterface)
{
scriptInterface.RegisterFunction<double, &GetMicroseconds>("GetMicroseconds");
scriptInterface.RegisterFunction<int, &Crash>("Crash");
scriptInterface.RegisterFunction<void, &DebugWarn>("DebugWarn");
scriptInterface.RegisterFunction<void, std::wstring, &DisplayErrorDialog>("DisplayErrorDialog");
scriptInterface.RegisterFunction<JS::Value, &GetProfilerState>("GetProfilerState");
scriptInterface.RegisterFunction<std::wstring, int, &GetBuildTimestamp>("GetBuildTimestamp");
// User report functions
scriptInterface.RegisterFunction<bool, &IsUserReportEnabled>("IsUserReportEnabled");
scriptInterface.RegisterFunction<void, bool, &SetUserReportEnabled>("SetUserReportEnabled");
scriptInterface.RegisterFunction<std::string, &GetUserReportStatus>("GetUserReportStatus");
scriptInterface.RegisterFunction<void, std::string, int, std::wstring, &SubmitUserReport>("SubmitUserReport");
}

View File

@ -25,11 +25,9 @@ namespace JSI_Debug
int Crash(ScriptInterface::CxPrivate* UNUSED(pCxPrivate));
void DebugWarn(ScriptInterface::CxPrivate* UNUSED(pCxPrivate));
void DisplayErrorDialog(ScriptInterface::CxPrivate* UNUSED(pCxPrivate), const std::wstring& msg);
JS::Value GetProfilerState(ScriptInterface::CxPrivate* pCxPrivate);
bool IsUserReportEnabled(ScriptInterface::CxPrivate* UNUSED(pCxPrivate));
void SetUserReportEnabled(ScriptInterface::CxPrivate* UNUSED(pCxPrivate), bool enabled);
std::string GetUserReportStatus(ScriptInterface::CxPrivate* UNUSED(pCxPrivate));
void SubmitUserReport(ScriptInterface::CxPrivate* UNUSED(pCxPrivate), const std::string& type, int version, const std::wstring& data);
std::wstring GetBuildTimestamp(ScriptInterface::CxPrivate* UNUSED(pCxPrivate), int mode);
double GetMicroseconds(ScriptInterface::CxPrivate* UNUSED(pCxPrivate));