Fixed GameAnalytics thread becoming active despite user statistics being disabled, causing the game to stay active in the background when quitting.

This commit is contained in:
Joonas Rikkonen
2018-07-13 11:29:11 +03:00
parent 4f874a276b
commit 015eacbcb0
8 changed files with 43 additions and 31 deletions
@@ -1949,18 +1949,20 @@ namespace Barotrauma
AnimController.Frozen = false;
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 (GameSettings.SendUserStatistics)
{
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();