public static void AddDesignEvent(string eventID, double value) { if (!GameSettings.SendUserStatistics) { return; } GameAnalytics.AddDesignEvent(eventID, value); }
public static void AddDesignEvent(string InMessage) { if (mainWindow != null) { GameAnalytics.AddDesignEvent(InMessage); mainWindow.AddLogEntry($"UE4 Binary Builder Analytics (Design): {InMessage}"); } }
public static void Init() { #if DEBUG GameAnalytics.SetEnabledInfoLog(true); #endif string exePath = Assembly.GetEntryAssembly().Location; string exeName = null; Md5Hash exeHash = null; exeName = Path.GetFileNameWithoutExtension(exePath).Replace(":", ""); var md5 = MD5.Create(); try { using (var stream = File.OpenRead(exePath)) { exeHash = new Md5Hash(stream); } } catch (Exception 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.AddDesignEvent("Executable:" + (string.IsNullOrEmpty(exeName) ? "Unknown" : exeName) + ":" + ((exeHash?.ShortHash == null) ? "Unknown" : exeHash.ShortHash)); GameAnalytics.ConfigureAvailableCustomDimensions01("singleplayer", "multiplayer", "editor"); GameAnalytics.Initialize("a3a073c20982de7c15d21e840e149122", "9010ad9a671233b8d9610d76cec8c897d9ff3ba7"); } catch (Exception e) { DebugConsole.ThrowError("Initializing GameAnalytics failed. Disabling user statistics...", e); GameSettings.SendUserStatistics = false; return; } if (GameMain.Config?.SelectedContentPackages.Count > 0) { StringBuilder sb = new StringBuilder("ContentPackage:"); int i = 0; foreach (ContentPackage cp in GameMain.Config.SelectedContentPackages) { sb.Append(cp.Name.Replace(":", "").Substring(0, Math.Min(32, cp.Name.Length))); if (i < GameMain.Config.SelectedContentPackages.Count - 1) { sb.Append(","); } } GameAnalytics.AddDesignEvent(sb.ToString()); } }
public static void AddDesignEvent(string InMessage) { if (mainWindow != null) { GameAnalytics.AddDesignEvent(InMessage); #if DEBUG mainWindow.AddLogEntry($"Unreal Binary Builder Analytics (Design): {InMessage}"); #endif } }
public void ReportServerStatus(int playerCount, int maxPlayers, float simSpeedServer, int entitiesCount, int gridsCount, int blocksCount, int movingGridsCount, string hostName, string worldType, string worldName, uint worldAge) { GameAnalytics.AddDesignEvent("world_age", (double)worldAge); GameAnalytics.AddDesignEvent("player_count", (double)playerCount); GameAnalytics.AddDesignEvent("max_players", (double)maxPlayers); GameAnalytics.AddDesignEvent("sim_speed", (double)simSpeedServer); GameAnalytics.AddDesignEvent("entities_count", (double)entitiesCount); GameAnalytics.AddDesignEvent("grids_count", (double)gridsCount); GameAnalytics.AddDesignEvent("blocks_count", (double)blocksCount); GameAnalytics.AddDesignEvent("moving_grids_count", (double)movingGridsCount); }
public static void logEvent(string eventId, IDictionary <string, object>?fields = null) { if (fields != null) { string fieldsStr = string.Join(" ", fields.Select(pair => $"{pair.Key}={pair.Value}")); Debug.WriteLine($"[EVENT] {eventId} fields: {fieldsStr}"); } else { Debug.WriteLine($"[EVENT] {eventId}"); } GameAnalytics.AddDesignEvent(eventId, fields); }
public static void Init() { #if DEBUB GameAnalytics.SetEnabledInfoLog(true); #endif 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))); } }
public static void InitializeGameAnalytics(string InProductVersion, MainWindow InMainWindow) { if (GAME_KEY != null && SECRET_KEY != null) { GameAnalytics.ConfigureBuild($"Unreal Binary Builder {InProductVersion}"); // https://gameanalytics.com/docs/item/c-sharp-sdk#initializing GameAnalytics.Initialize(GAME_KEY, SECRET_KEY); mainWindow = InMainWindow; mainWindow.AddLogEntry("Unreal Binary Builder Analytics Initialized."); #if DEBUG GameAnalytics.AddDesignEvent("Program:Start:Debug"); #else GameAnalytics.AddDesignEvent("Program:Start:Release"); #endif } }
public async Task Process(GaAddDesignEvent args) { try { if (args.Value != null) { GameAnalytics.AddDesignEvent(args.EventID, args.Value.Value); } else { GameAnalytics.AddDesignEvent(args.EventID); } } catch (Exception ex) { Trace.TraceError("Error adding GA design event {0} : {1}", args?.EventID, ex); } }
public static void Init() { #if DEBUG GameAnalytics.SetEnabledInfoLog(true); #endif string exePath = Assembly.GetEntryAssembly().Location; string exeName = null; Md5Hash exeHash = null; exeName = Path.GetFileNameWithoutExtension(exePath).Replace(":", ""); var md5 = MD5.Create(); try { using (var stream = File.OpenRead(exePath)) { exeHash = new Md5Hash(stream); } } catch (Exception e) { DebugConsole.ThrowError("Error while calculating MD5 hash for the executable \"" + exePath + "\"", e); } GameAnalytics.ConfigureBuild(GameMain.Version.ToString() + (string.IsNullOrEmpty(exeName) ? "Unknown" : exeName) + "_(" + NilMod.NilModVersionDate + ")" + ":" + ((exeHash?.ShortHash == null) ? "Unknown" : exeHash.ShortHash)); GameAnalytics.AddDesignEvent("Executable:" + (string.IsNullOrEmpty(exeName) ? "Unknown" : exeName) + ":" + ((exeHash?.ShortHash == null) ? "Unknown" : exeHash.ShortHash)); 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))); } }
public MainWindow() { InitializeComponent(); SetDefaultLineView(); NetworkChart.Plot.Legend(true, ScottPlot.Alignment.UpperLeft); DataContext = this; Title = $"Unreal Engine Network Profiler v{GetProductVersionString()}"; if (GAME_KEY != null && SECRET_KEY != null) { GameAnalytics.ConfigureBuild($"Unreal Network Profiler v{GetProductVersionString()}"); GameAnalytics.Initialize(GAME_KEY, SECRET_KEY); #if DEBUG GameAnalytics.AddDesignEvent("Program:Start:Debug"); #else GameAnalytics.AddDesignEvent("Program:Start:Release"); #endif } }
public void CloseAboutDialog() { GameAnalytics.AddDesignEvent("AboutDialogClose"); aboutDialog.Close(); }
private void AboutBtn_Click(object sender, RoutedEventArgs e) { GameAnalytics.AddDesignEvent("AboutDialogOpen"); aboutDialog = Dialog.Show(new AboutDialog(this)); }
private static void addDesignEventWithValue(string eventId, float value, string fields) { GameAnalytics.AddDesignEvent(eventId, (double)value); }
private static void addDesignEvent(string eventId, string fields) { GameAnalytics.AddDesignEvent(eventId, (IDictionary <string, object>)null); }
public static void logEvent(string eventId, double value) { Debug.WriteLine($"[EVENT] {eventId} value={value}"); GameAnalytics.AddDesignEvent(eventId, value); }