Added wrapper methods that check if user statistics are enabled to GameAnalyticsManager
This commit is contained in:
@@ -214,12 +214,9 @@ namespace Barotrauma
|
|||||||
|
|
||||||
if (GameMain.GameSession != null)
|
if (GameMain.GameSession != null)
|
||||||
{
|
{
|
||||||
if (GameSettings.SendUserStatistics)
|
Mission mission = GameMain.GameSession.Mission;
|
||||||
{
|
GameAnalyticsManager.AddDesignEvent("QuitRound:" + (save ? "Save" : "NoSave"));
|
||||||
Mission mission = GameMain.GameSession.Mission;
|
GameAnalyticsManager.AddDesignEvent("EndRound:" + (mission == null ? "NoMission" : (mission.Completed ? "MissionCompleted" : "MissionFailed")));
|
||||||
GameAnalyticsSDK.Net.GameAnalytics.AddDesignEvent("QuitRound:" + (save ? "Save" : "NoSave"));
|
|
||||||
GameAnalyticsSDK.Net.GameAnalytics.AddDesignEvent("EndRound:" + (mission == null ? "NoMission" : (mission.Completed ? "MissionCompleted" : "MissionFailed")));
|
|
||||||
}
|
|
||||||
GameMain.GameSession = null;
|
GameMain.GameSession = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ namespace Barotrauma
|
|||||||
campaignUI.OnLocationSelected = SelectLocation;
|
campaignUI.OnLocationSelected = SelectLocation;
|
||||||
campaignUI.UpdateCharacterLists();
|
campaignUI.UpdateCharacterLists();
|
||||||
|
|
||||||
if (GameSettings.SendUserStatistics) GameAnalyticsSDK.Net.GameAnalytics.SetCustomDimension01("singleplayer");
|
GameAnalyticsManager.SetCustomDimension01("singleplayer");
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void AddToGUIUpdateList()
|
public override void AddToGUIUpdateList()
|
||||||
|
|||||||
@@ -143,7 +143,7 @@ namespace Barotrauma
|
|||||||
|
|
||||||
SelectTab(null, 0);
|
SelectTab(null, 0);
|
||||||
|
|
||||||
if (GameSettings.SendUserStatistics) GameAnalyticsSDK.Net.GameAnalytics.SetCustomDimension01("");
|
GameAnalyticsManager.SetCustomDimension01("");
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool SelectTab(GUIButton button, object obj)
|
public bool SelectTab(GUIButton button, object obj)
|
||||||
|
|||||||
@@ -501,7 +501,7 @@ namespace Barotrauma
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (GameSettings.SendUserStatistics) GameAnalyticsSDK.Net.GameAnalytics.SetCustomDimension01("multiplayer");
|
GameAnalyticsManager.SetCustomDimension01("multiplayer");
|
||||||
|
|
||||||
if (GameModePreset.list.Count > 0 && modeList.Selected == null) modeList.Select(0);
|
if (GameModePreset.list.Count > 0 && modeList.Selected == null) modeList.Select(0);
|
||||||
|
|
||||||
|
|||||||
@@ -349,7 +349,7 @@ namespace Barotrauma
|
|||||||
|
|
||||||
cam.UpdateTransform();
|
cam.UpdateTransform();
|
||||||
|
|
||||||
if (GameSettings.SendUserStatistics) GameAnalyticsSDK.Net.GameAnalytics.SetCustomDimension01("editor");
|
GameAnalyticsManager.SetCustomDimension01("editor");
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Deselect()
|
public override void Deselect()
|
||||||
|
|||||||
@@ -1960,7 +1960,7 @@ namespace Barotrauma
|
|||||||
characterType = "Enemy";
|
characterType = "Enemy";
|
||||||
else if (AIController is HumanAIController)
|
else if (AIController is HumanAIController)
|
||||||
characterType = "AICrew";
|
characterType = "AICrew";
|
||||||
GameAnalyticsSDK.Net.GameAnalytics.AddDesignEvent("Kill:" + characterType + ":" + SpeciesName + ":" + causeOfDeath);
|
GameAnalyticsManager.AddDesignEvent("Kill:" + characterType + ":" + SpeciesName + ":" + causeOfDeath);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (OnDeath != null) OnDeath(this, causeOfDeath);
|
if (OnDeath != null) OnDeath(this, causeOfDeath);
|
||||||
|
|||||||
@@ -62,5 +62,35 @@ namespace Barotrauma
|
|||||||
GameAnalytics.AddErrorEvent(errorSeverity, message);
|
GameAnalytics.AddErrorEvent(errorSeverity, message);
|
||||||
sentEventIdentifiers.Add(identifier);
|
sentEventIdentifiers.Add(identifier);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void AddDesignEvent(string eventID)
|
||||||
|
{
|
||||||
|
if (!GameSettings.SendUserStatistics) return;
|
||||||
|
GameAnalytics.AddDesignEvent(eventID);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void AddDesignEvent(string eventID, double value)
|
||||||
|
{
|
||||||
|
if (!GameSettings.SendUserStatistics) return;
|
||||||
|
GameAnalytics.AddDesignEvent(eventID, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void AddProgressionEvent(EGAProgressionStatus progressionStatus, string progression01)
|
||||||
|
{
|
||||||
|
if (!GameSettings.SendUserStatistics) return;
|
||||||
|
GameAnalytics.AddProgressionEvent(progressionStatus, progression01);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void AddProgressionEvent(EGAProgressionStatus progressionStatus, string progression01, string progression02)
|
||||||
|
{
|
||||||
|
if (!GameSettings.SendUserStatistics) return;
|
||||||
|
GameAnalytics.AddProgressionEvent(progressionStatus, progression01, progression02);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void SetCustomDimension01(string dimension)
|
||||||
|
{
|
||||||
|
if (!GameSettings.SendUserStatistics) return;
|
||||||
|
GameAnalytics.SetCustomDimension01(dimension);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -235,12 +235,10 @@ namespace Barotrauma
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (GameSettings.SendUserStatistics)
|
GameAnalyticsManager.AddDesignEvent("Submarine:" + submarine.Name);
|
||||||
{
|
GameAnalyticsManager.AddProgressionEvent(GameAnalyticsSDK.Net.EGAProgressionStatus.Start,
|
||||||
GameAnalyticsSDK.Net.GameAnalytics.AddDesignEvent("Submarine:" + submarine.Name);
|
|
||||||
GameAnalyticsSDK.Net.GameAnalytics.AddProgressionEvent(GameAnalyticsSDK.Net.EGAProgressionStatus.Start,
|
|
||||||
GameMode.Name, (Mission == null ? "None" : Mission.GetType().ToString()));
|
GameMode.Name, (Mission == null ? "None" : Mission.GetType().ToString()));
|
||||||
}
|
|
||||||
|
|
||||||
#if CLIENT
|
#if CLIENT
|
||||||
roundSummary = new RoundSummary(this);
|
roundSummary = new RoundSummary(this);
|
||||||
@@ -253,11 +251,10 @@ namespace Barotrauma
|
|||||||
public void EndRound(string endMessage)
|
public void EndRound(string endMessage)
|
||||||
{
|
{
|
||||||
if (Mission != null) Mission.End();
|
if (Mission != null) Mission.End();
|
||||||
if (GameSettings.SendUserStatistics)
|
GameAnalyticsManager.AddProgressionEvent(
|
||||||
{
|
(Mission == null || Mission.Completed) ? GameAnalyticsSDK.Net.EGAProgressionStatus.Complete : GameAnalyticsSDK.Net.EGAProgressionStatus.Fail,
|
||||||
GameAnalyticsSDK.Net.GameAnalytics.AddProgressionEvent((Mission == null || Mission.Completed) ? GameAnalyticsSDK.Net.EGAProgressionStatus.Complete : GameAnalyticsSDK.Net.EGAProgressionStatus.Fail,
|
GameMode.Name,
|
||||||
GameMode.Name, (Mission == null ? "None" : Mission.GetType().ToString()));
|
(Mission == null ? "None" : Mission.GetType().ToString()));
|
||||||
}
|
|
||||||
|
|
||||||
#if CLIENT
|
#if CLIENT
|
||||||
if (roundSummary != null)
|
if (roundSummary != null)
|
||||||
|
|||||||
@@ -209,7 +209,7 @@ namespace Barotrauma.Networking
|
|||||||
GameMain.NetLobbyScreen.RandomizeSettings();
|
GameMain.NetLobbyScreen.RandomizeSettings();
|
||||||
started = true;
|
started = true;
|
||||||
|
|
||||||
if (GameSettings.SendUserStatistics) GameAnalyticsSDK.Net.GameAnalytics.AddDesignEvent("GameServer:Start");
|
GameAnalyticsManager.AddDesignEvent("GameServer:Start");
|
||||||
|
|
||||||
yield return CoroutineStatus.Success;
|
yield return CoroutineStatus.Success;
|
||||||
}
|
}
|
||||||
@@ -1370,7 +1370,7 @@ namespace Barotrauma.Networking
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (GameSettings.SendUserStatistics) GameAnalyticsSDK.Net.GameAnalytics.AddDesignEvent("Traitors:" + (TraitorManager == null ? "Disabled" : "Enabled"));
|
GameAnalyticsManager.AddDesignEvent("Traitors:" + (TraitorManager == null ? "Disabled" : "Enabled"));
|
||||||
|
|
||||||
SendStartMessage(roundStartSeed, Submarine.MainSub, GameMain.GameSession.GameMode.Preset, connectedClients);
|
SendStartMessage(roundStartSeed, Submarine.MainSub, GameMain.GameSession.GameMode.Preset, connectedClients);
|
||||||
|
|
||||||
@@ -2250,10 +2250,7 @@ namespace Barotrauma.Networking
|
|||||||
log.Save();
|
log.Save();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (GameSettings.SendUserStatistics)
|
GameAnalyticsManager.AddDesignEvent("GameServer:ShutDown");
|
||||||
{
|
|
||||||
GameAnalyticsSDK.Net.GameAnalytics.AddDesignEvent("GameServer:ShutDown");
|
|
||||||
}
|
|
||||||
server.Shutdown("The server has been shut down");
|
server.Shutdown("The server has been shut down");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user