Disable GameAnalytics if an exception is thrown during initialization.
This commit is contained in:
@@ -34,17 +34,25 @@ namespace Barotrauma
|
|||||||
{
|
{
|
||||||
DebugConsole.ThrowError("Error while calculating MD5 hash for the executable \"" + exePath + "\"", e);
|
DebugConsole.ThrowError("Error while calculating MD5 hash for the executable \"" + exePath + "\"", e);
|
||||||
}
|
}
|
||||||
|
try
|
||||||
|
{
|
||||||
|
GameAnalytics.ConfigureBuild(GameMain.Version.ToString()
|
||||||
|
+ (string.IsNullOrEmpty(exeName) ? "Unknown" : exeName) + ":"
|
||||||
|
+ ((exeHash?.ShortHash == null) ? "Unknown" : exeHash.ShortHash));
|
||||||
|
|
||||||
GameAnalytics.ConfigureBuild(GameMain.Version.ToString()
|
GameAnalytics.AddDesignEvent("Executable:"
|
||||||
+ (string.IsNullOrEmpty(exeName) ? "Unknown" : exeName) + ":"
|
+ (string.IsNullOrEmpty(exeName) ? "Unknown" : exeName) + ":"
|
||||||
+ ((exeHash?.ShortHash == null) ? "Unknown" : exeHash.ShortHash));
|
+ ((exeHash?.ShortHash == null) ? "Unknown" : exeHash.ShortHash));
|
||||||
|
|
||||||
GameAnalytics.AddDesignEvent("Executable:"
|
GameAnalytics.ConfigureAvailableCustomDimensions01("singleplayer", "multiplayer", "editor");
|
||||||
+ (string.IsNullOrEmpty(exeName) ? "Unknown" : exeName) + ":"
|
GameAnalytics.Initialize("a3a073c20982de7c15d21e840e149122", "9010ad9a671233b8d9610d76cec8c897d9ff3ba7");
|
||||||
+ ((exeHash?.ShortHash == null) ? "Unknown" : exeHash.ShortHash));
|
}
|
||||||
|
catch (Exception e)
|
||||||
GameAnalytics.ConfigureAvailableCustomDimensions01("singleplayer", "multiplayer", "editor");
|
{
|
||||||
GameAnalytics.Initialize("a3a073c20982de7c15d21e840e149122", "9010ad9a671233b8d9610d76cec8c897d9ff3ba7");
|
DebugConsole.ThrowError("Initializing GameAnalytics failed. Disabling user statistics...", e);
|
||||||
|
GameSettings.SendUserStatistics = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
string contentPackageName = GameMain.Config?.SelectedContentPackage?.Name;
|
string contentPackageName = GameMain.Config?.SelectedContentPackage?.Name;
|
||||||
if (!string.IsNullOrEmpty(contentPackageName))
|
if (!string.IsNullOrEmpty(contentPackageName))
|
||||||
|
|||||||
Reference in New Issue
Block a user