Ejemplo n.º 1
0
        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());
            }
        }
Ejemplo n.º 2
0
        public static void InitializeGameAnalytics(string InProductVersion, MainWindow InMainWindow)
        {
            if (GAME_KEY != null && SECRET_KEY != null)
            {
                GameAnalytics.ConfigureBuild($"UE4 Binary Builder {InProductVersion}");

                // https://gameanalytics.com/docs/item/c-sharp-sdk#initializing
                GameAnalytics.Initialize(GAME_KEY, SECRET_KEY);
                mainWindow = InMainWindow;
            }
        }
Ejemplo n.º 3
0
 public MyGameAnalytics(string accessToken, string gameVersion)
 {
     GameAnalytics.ConfigureBuild(gameVersion);
     if (!string.IsNullOrWhiteSpace(accessToken) && accessToken.Contains <char>(':'))
     {
         char[]   separator = new char[] { ':' };
         string[] strArray  = accessToken.Split(separator);
         if (strArray.Length == 2)
         {
             GameAnalytics.Initialize(strArray[0], strArray[1]);
         }
     }
 }
Ejemplo n.º 4
0
        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)));
            }
        }
Ejemplo n.º 5
0
        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
            }
        }
Ejemplo n.º 6
0
        public static void init()
        {
#if DEBUG
            GameAnalytics.SetEnabledInfoLog(true);
            GameAnalytics.SetEnabledVerboseLog(false);
            GameAnalytics.SetEnabledEventSubmission(false);
#else
            GameAnalytics.SetEnabledInfoLog(true);
            GameAnalytics.SetEnabledVerboseLog(false);
            GameAnalytics.SetEnabledEventSubmission(true);
#endif
            GameAnalytics.ConfigureBuild(Constants.CURRENT_VERSION_NUMBER);

            //Comment out this line or fill in your own GameAnalytics game key and secret key
            GameAnalytics.Initialize(Secrets.GAME_ANALYTICS_GAME_KEY, Secrets.GAME_ANALYTICS_SECRET_KEY);
            GameAnalytics.StartSession();
        }
Ejemplo n.º 7
0
        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
            }
        }
Ejemplo n.º 9
0
 private static void configureBuild(string build)
 {
     GameAnalytics.ConfigureBuild(build);
 }