Collecting some more usage statistics: selected game mode, mission, submarine, content package, traitors on/off, kills
This commit is contained in:
@@ -1948,8 +1948,19 @@ namespace Barotrauma
|
||||
|
||||
AnimController.Frozen = false;
|
||||
|
||||
GameServer.Log(LogName+" has died (Cause of death: "+causeOfDeath+")", ServerLog.MessageType.Attack);
|
||||
GameServer.Log(LogName + " has died (Cause of death: " + causeOfDeath + ")", ServerLog.MessageType.Attack);
|
||||
|
||||
string characterType = "Unknown";
|
||||
if (this == controlled)
|
||||
characterType = "Player";
|
||||
else if (IsRemotePlayer)
|
||||
characterType = "RemotePlayer";
|
||||
else if (AIController is EnemyAIController)
|
||||
characterType = "Enemy";
|
||||
else if (AIController is HumanAIController)
|
||||
characterType = "AICrew";
|
||||
GameAnalyticsSDK.Net.GameAnalytics.AddDesignEvent("Kill:" + characterType + ":" + SpeciesName + ":" + causeOfDeath);
|
||||
|
||||
if (OnDeath != null) OnDeath(this, causeOfDeath);
|
||||
|
||||
KillProjSpecific();
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
using GameAnalyticsSDK.Net;
|
||||
using System;
|
||||
|
||||
namespace Barotrauma
|
||||
{
|
||||
public static class GameAnalyticsManager
|
||||
{
|
||||
public static void Init()
|
||||
{
|
||||
GameAnalytics.SetEnabledInfoLog(true);
|
||||
GameAnalytics.ConfigureBuild(GameMain.Version.ToString());
|
||||
GameAnalytics.ConfigureAvailableCustomDimensions01("singleplayer", "multiplayer", "editor");
|
||||
GameAnalytics.Initialize("a3a073c20982de7c15d21e840e149122", "9010ad9a671233b8d9610d76cec8c897d9ff3ba7");
|
||||
|
||||
string contentPackageName = GameMain.Config?.SelectedContentPackage?.Name;
|
||||
if (!string.IsNullOrEmpty(contentPackageName))
|
||||
{
|
||||
GameAnalytics.AddDesignEvent("ContentPackage:" +
|
||||
contentPackageName.Replace(":", "").Substring(0, Math.Min(32, contentPackageName.Length)));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -228,6 +228,10 @@ namespace Barotrauma
|
||||
|
||||
if (GameMode != null) GameMode.MsgBox();
|
||||
|
||||
GameAnalyticsSDK.Net.GameAnalytics.AddDesignEvent("Submarine:" + submarine.Name);
|
||||
GameAnalyticsSDK.Net.GameAnalytics.AddProgressionEvent(GameAnalyticsSDK.Net.EGAProgressionStatus.Start,
|
||||
GameMode.Name, (Mission == null ? "None" : Mission.GetType().ToString()));
|
||||
|
||||
#if CLIENT
|
||||
roundSummary = new RoundSummary(this);
|
||||
|
||||
@@ -239,6 +243,9 @@ namespace Barotrauma
|
||||
public void EndRound(string endMessage)
|
||||
{
|
||||
if (Mission != null) Mission.End();
|
||||
|
||||
GameAnalyticsSDK.Net.GameAnalytics.AddProgressionEvent((Mission == null || Mission.Completed) ? GameAnalyticsSDK.Net.EGAProgressionStatus.Complete : GameAnalyticsSDK.Net.EGAProgressionStatus.Fail,
|
||||
GameMode.Name, (Mission == null ? "None" : Mission.GetType().ToString()));
|
||||
|
||||
#if CLIENT
|
||||
if (roundSummary != null)
|
||||
|
||||
@@ -279,10 +279,8 @@ namespace Barotrauma
|
||||
{
|
||||
case "contentpackage":
|
||||
string path = subElement.GetAttributeString("path", "");
|
||||
|
||||
|
||||
|
||||
SelectedContentPackage = ContentPackage.list.Find(cp => cp.Path == path);
|
||||
|
||||
if (SelectedContentPackage == null) SelectedContentPackage = new ContentPackage(path);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -208,6 +208,8 @@ namespace Barotrauma.Networking
|
||||
GameMain.NetLobbyScreen.Select();
|
||||
GameMain.NetLobbyScreen.RandomizeSettings();
|
||||
started = true;
|
||||
|
||||
GameAnalyticsSDK.Net.GameAnalytics.AddDesignEvent("GameServer:Start");
|
||||
|
||||
yield return CoroutineStatus.Success;
|
||||
}
|
||||
@@ -1357,6 +1359,8 @@ namespace Barotrauma.Networking
|
||||
}
|
||||
}
|
||||
|
||||
GameAnalyticsSDK.Net.GameAnalytics.AddDesignEvent("Traitors:" + (TraitorManager == null ? "Disabled" : "Enabled"));
|
||||
|
||||
SendStartMessage(roundStartSeed, Submarine.MainSub, GameMain.GameSession.GameMode.Preset, connectedClients);
|
||||
|
||||
yield return CoroutineStatus.Running;
|
||||
@@ -2249,7 +2253,8 @@ namespace Barotrauma.Networking
|
||||
Log("Shutting down the server...", ServerLog.MessageType.ServerMessage);
|
||||
log.Save();
|
||||
}
|
||||
|
||||
|
||||
GameAnalyticsSDK.Net.GameAnalytics.AddDesignEvent("GameServer:ShutDown");
|
||||
server.Shutdown("The server has been shut down");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user