analytics: Collect controller information.

Collects the existence of a gamecube adapter, and the type of
whatever controller is configured for the first emulated gamepad.
This commit is contained in:
Scott Mansell 2016-06-21 01:21:32 +12:00
parent bb15468c90
commit 3dfea6e996

View file

@ -20,6 +20,10 @@
#include "Core/ConfigManager.h"
#include "Core/Movie.h"
#include "Core/NetPlayProto.h"
#include "Core/HW/GCPad.h"
#include "InputCommon/ControllerEmu.h"
#include "InputCommon/GCAdapter.h"
#include "InputCommon/InputConfig.h"
#include "VideoCommon/VideoBackendBase.h"
#include "VideoCommon/VideoConfig.h"
@ -242,5 +246,13 @@ void DolphinAnalytics::MakePerGameBuilder()
builder.AddData("netplay", NetPlay::IsNetPlayRunning());
builder.AddData("movie", Movie::IsMovieActive());
// Controller information
builder.AddData("gcadapter-detected", GCAdapter::IsDetected());
// For privacy reasons, limit this to type of the first controller.
// The ControllersNeedToBeCreated() check is enough to ensure GetController(0) won't return nullptr or throw exceptions.
if (!Pad::GetConfig()->ControllersNeedToBeCreated())
builder.AddData("controller-type", Pad::GetConfig()->GetController(0)->default_device.name);
m_per_game_builder = builder;
}