Lock out reporting if harmful settings are used.

Before, if you turned it on, broke stuff, and then turned it off, we
reported the broken stuff.  This could be responsible for various
messages that have seemed strange.
This commit is contained in:
Unknown W. Brackets 2014-02-09 14:04:16 -08:00
parent ad8488ecc4
commit b46ca9f94b
5 changed files with 20 additions and 1 deletions

View file

@ -52,6 +52,8 @@ namespace Reporting
static std::string lastHostname;
// Keeps track of report-only-once identifiers.
static std::set<std::string> logOnceUsed;
// Keeps track of whether a harmful setting was ever used.
static bool everUnsupported = false;
enum RequestType
{
@ -198,6 +200,13 @@ namespace Reporting
// New game, clean slate.
spamProtectionCount = 0;
logOnceUsed.clear();
everUnsupported = false;
}
void UpdateConfig()
{
if (!IsSupported())
everUnsupported = true;
}
bool ShouldLogOnce(const char *identifier)
@ -265,7 +274,7 @@ namespace Reporting
bool IsEnabled()
{
if (g_Config.sReportHost.empty() || !IsSupported())
if (g_Config.sReportHost.empty() || !IsSupported() || everUnsupported)
return false;
// Disabled by default for now.
if (g_Config.sReportHost.compare("default") == 0)

View file

@ -40,6 +40,9 @@ namespace Reporting
// Should be called whenever a new game is loaded to forget things.
void Init();
// Should be called whenever the game configuration changes.
void UpdateConfig();
// Returns whether or not the reporting system is currently enabled.
bool IsEnabled();
@ -55,5 +58,6 @@ namespace Reporting
// Report a message string, using the format string as a key.
void ReportMessage(const char *message, ...);
// Returns true if that identifier has not been logged yet.
bool ShouldLogOnce(const char *identifier);
}

View file

@ -35,6 +35,7 @@
#include "Core/CoreParameter.h"
#include "Core/Core.h"
#include "Core/Host.h"
#include "Core/Reporting.h"
#include "Core/System.h"
#include "GPU/GPUState.h"
#include "GPU/GPUInterface.h"
@ -202,6 +203,7 @@ void EmuScreen::sendMessage(const char *message, const char *value) {
gpu->ClearCacheNextFrame();
gpu->Resized();
}
Reporting::UpdateConfig();
RecreateViews();
} else if (!strcmp(message, "gpu dump next frame")) {
if (gpu) gpu->DumpNextFrame();

View file

@ -394,6 +394,7 @@ UI::EventReturn GameSettingsScreen::OnResolutionChange(UI::EventParams &e) {
if (gpu) {
gpu->Resized();
}
Reporting::UpdateConfig();
return UI::EVENT_DONE;
}
@ -498,6 +499,7 @@ UI::EventReturn GameSettingsScreen::OnPostProcShaderChange(UI::EventParams &e) {
if (gpu) {
gpu->Resized();
}
Reporting::UpdateConfig();
return UI::EVENT_DONE;
}
UI::EventReturn GameSettingsScreen::OnDeveloperTools(UI::EventParams &e) {

View file

@ -31,6 +31,7 @@
#include "Common/FileUtil.h"
#include "Core/System.h"
#include "Core/Host.h"
#include "Core/Reporting.h"
#include "Core/SaveState.h"
#include "UI/EmuScreen.h"
@ -1045,6 +1046,7 @@ void GamePauseScreen::onFinish(DialogResult result) {
// Do we really always need to "gpu->Resized" here?
if (gpu)
gpu->Resized();
Reporting::UpdateConfig();
}
UI::EventReturn GamePauseScreen::OnExitToMenu(UI::EventParams &e) {