示例#1
0
        private static MyProcessStartAnalytics GetProcessStartAnalyticsData()
        {
            MyProcessStartAnalytics data = new MyProcessStartAnalytics();

            try
            {
                var cpus = new ManagementObjectSearcher("root\\CIMV2", "SELECT Name FROM Win32_Processor").Get();
                // We're just reporting the first
                var cpuName = cpus.Cast <ManagementObject>().First()["Name"].ToString();

                var memoryInfo = new WinApi.MEMORYSTATUSEX();
                WinApi.GlobalMemoryStatusEx(memoryInfo);

                MyAdapterInfo gpu        = MyVideoSettingsManager.Adapters[MyVideoSettingsManager.CurrentDeviceSettings.AdapterOrdinal];
                var           deviceName = gpu.Name;

                data.ProcessorCount               = (byte)Environment.ProcessorCount;
                data.OsVersion                    = Environment.OSVersion.VersionString;
                data.CpuInfo                      = cpuName;
                data.OsPlatform                   = Environment.Is64BitOperatingSystem ? "64bit" : "32bit";
                data.HasDX11                      = MyDirectXHelper.IsDx11Supported();
                data.GameVersion                  = MyFinalBuildConstants.APP_VERSION_STRING.ToString();
                data.TotalPhysMemBytes            = memoryInfo.ullTotalPhys;
                data.GpuInfo                      = new MyGraphicsInfo();
                data.GpuInfo.AnisotropicFiltering = MyVideoSettingsManager.CurrentGraphicsSettings.Render.AnisotropicFiltering.ToString();
                data.GpuInfo.AntialiasingMode     = MyVideoSettingsManager.CurrentGraphicsSettings.Render.AntialiasingMode.ToString();
                data.GpuInfo.FoliageDetails       = MyVideoSettingsManager.CurrentGraphicsSettings.Render.FoliageDetails.ToString();
                data.GpuInfo.ShadowQuality        = MyVideoSettingsManager.CurrentGraphicsSettings.Render.ShadowQuality.ToString();
                data.GpuInfo.TextureQuality       = MyVideoSettingsManager.CurrentGraphicsSettings.Render.TextureQuality.ToString();
                data.GpuInfo.VoxelQuality         = MyVideoSettingsManager.CurrentGraphicsSettings.Render.VoxelQuality.ToString();
                data.GpuInfo.GrassDensityFactor   = MyVideoSettingsManager.CurrentGraphicsSettings.Render.GrassDensityFactor;
                data.GpuInfo.GPUModelName         = gpu.DeviceName;
                data.GpuInfo.GPUMemory            = gpu.VRAM;
                data.AudioInfo.MusicVolume        = MySandboxGame.Config.MusicVolume;
                data.AudioInfo.SoundVolume        = MySandboxGame.Config.GameVolume;
                data.AudioInfo.HudWarnings        = MySandboxGame.Config.HudWarnings;
                data.AudioInfo.MuteWhenNotInFocus = MySandboxGame.Config.EnableMuteWhenNotInFocus;
                data.Fullscreen                   = MyVideoSettingsManager.CurrentDeviceSettings.WindowMode.ToString();
                data.Resolution                   = MySandboxGame.Config.ScreenWidth.ToString() + " x " + MySandboxGame.Config.ScreenHeight.ToString();
            }
            catch (Exception exception)
            {
                MyLog.Default.WriteLine(exception);
            }

            return(data);
        }
        public void ReportProcessStart(MyProcessStartAnalytics attributes, bool firstRun, bool dedicatedServer)
        {
            Add(new MyEventAttributes
            {
                EventType       = MyInfinarioEventType.ProcessStart,
                EventTimestamp  = DateTime.UtcNow,
                ProcessStart    = attributes,
                DedicatedServer = dedicatedServer
            });

            if (firstRun && dedicatedServer == false)
            {
                Add(new MyEventAttributes
                {
                    EventType      = MyInfinarioEventType.FirstRun,
                    EventTimestamp = DateTime.UtcNow,
                    ProcessStart   = attributes
                });
            }
        }
        private static MyProcessStartAnalytics GetProcessStartAnalyticsData()
        {
            MyProcessStartAnalytics data = new MyProcessStartAnalytics();
            var cpus = new ManagementObjectSearcher("root\\CIMV2", "SELECT Name FROM Win32_Processor").Get();
            // We're just reporting the first 
            var cpuName = cpus.Cast<ManagementObject>().First()["Name"].ToString();

            var memoryInfo = new WinApi.MEMORYSTATUSEX();
            WinApi.GlobalMemoryStatusEx(memoryInfo);

            var deviceName =
                MyVideoSettingsManager.Adapters[MyVideoSettingsManager.CurrentDeviceSettings.AdapterOrdinal]
                    .Name;

            data.OsVersion = Environment.OSVersion.VersionString;
            data.CpuInfo = cpuName;
            data.GpuInfo = deviceName;
            data.GameVersion = MyFinalBuildConstants.APP_VERSION_STRING.ToString();
            data.TotalPhysMemBytes = memoryInfo.ullTotalPhys;

            return data;
        }
示例#4
0
        private static MyProcessStartAnalytics GetProcessStartAnalyticsData()
        {
            MyProcessStartAnalytics data = new MyProcessStartAnalytics();
            var cpus = new ManagementObjectSearcher("root\\CIMV2", "SELECT Name FROM Win32_Processor").Get();
            // We're just reporting the first
            var cpuName = cpus.Cast <ManagementObject>().First()["Name"].ToString();

            var memoryInfo = new WinApi.MEMORYSTATUSEX();

            WinApi.GlobalMemoryStatusEx(memoryInfo);

            var deviceName =
                MyVideoSettingsManager.Adapters[MyVideoSettingsManager.CurrentDeviceSettings.AdapterOrdinal]
                .Name;

            data.OsVersion         = Environment.OSVersion.VersionString;
            data.CpuInfo           = cpuName;
            data.GpuInfo           = deviceName;
            data.GameVersion       = MyFinalBuildConstants.APP_VERSION_STRING.ToString();
            data.TotalPhysMemBytes = memoryInfo.ullTotalPhys;

            return(data);
        }
        private static MyProcessStartAnalytics GetProcessStartAnalyticsData()
        {
            MyProcessStartAnalytics data = new MyProcessStartAnalytics();
            try
            {
                var cpus = new ManagementObjectSearcher("root\\CIMV2", "SELECT Name FROM Win32_Processor").Get();
                // We're just reporting the first 
                var cpuName = cpus.Cast<ManagementObject>().First()["Name"].ToString();

                var memoryInfo = new WinApi.MEMORYSTATUSEX();
                WinApi.GlobalMemoryStatusEx(memoryInfo);

                MyAdapterInfo gpu = MyVideoSettingsManager.Adapters[MyVideoSettingsManager.CurrentDeviceSettings.AdapterOrdinal];
                var deviceName = gpu.Name;
                
                data.ProcessorCount = (byte)Environment.ProcessorCount;
                data.OsVersion = Environment.OSVersion.VersionString;
                data.CpuInfo = cpuName;
                data.OsPlatform = Environment.Is64BitOperatingSystem ? "64bit" : "32bit";
                data.HasDX11 = MyDirectXHelper.IsDx11Supported();
                data.GameVersion = MyFinalBuildConstants.APP_VERSION_STRING.ToString();
                data.TotalPhysMemBytes = memoryInfo.ullTotalPhys;
                data.GpuInfo = new MyGraphicsInfo();
                data.GpuInfo.AnisotropicFiltering = MyVideoSettingsManager.CurrentGraphicsSettings.Render.AnisotropicFiltering.ToString();
                data.GpuInfo.AntialiasingMode = MyVideoSettingsManager.CurrentGraphicsSettings.Render.AntialiasingMode.ToString();
                data.GpuInfo.FoliageDetails = MyVideoSettingsManager.CurrentGraphicsSettings.Render.FoliageDetails.ToString();
                data.GpuInfo.ShadowQuality = MyVideoSettingsManager.CurrentGraphicsSettings.Render.ShadowQuality.ToString();
                data.GpuInfo.TextureQuality = MyVideoSettingsManager.CurrentGraphicsSettings.Render.TextureQuality.ToString();
                data.GpuInfo.VoxelQuality = MyVideoSettingsManager.CurrentGraphicsSettings.Render.VoxelQuality.ToString();
                data.GpuInfo.GrassDensityFactor = MyVideoSettingsManager.CurrentGraphicsSettings.Render.GrassDensityFactor;
                data.GpuInfo.GPUModelName = gpu.DeviceName;
                data.GpuInfo.GPUMemory = gpu.VRAM;
                data.AudioInfo.MusicVolume = MySandboxGame.Config.MusicVolume;
                data.AudioInfo.SoundVolume = MySandboxGame.Config.GameVolume;
                data.AudioInfo.HudWarnings = MySandboxGame.Config.HudWarnings;
                data.AudioInfo.MuteWhenNotInFocus = MySandboxGame.Config.EnableMuteWhenNotInFocus;
                data.Fullscreen = MyVideoSettingsManager.CurrentDeviceSettings.WindowMode.ToString();
                data.Resolution = MySandboxGame.Config.ScreenWidth.ToString() + " x " + MySandboxGame.Config.ScreenHeight.ToString();
            }
            catch (Exception exception)
            {
                MyLog.Default.WriteLine(exception);
            }

            return data;
        }
        public void ReportProcessStart(MyProcessStartAnalytics attributes, bool firstRun, bool dedicatedServer)
        {
            Add(new MyEventAttributes
            {
                EventType = MyInfinarioEventType.ProcessStart,
                EventTimestamp = DateTime.UtcNow,
                ProcessStart = attributes,
                DedicatedServer = dedicatedServer
            });

            if (firstRun && dedicatedServer == false)
            {
                Add(new MyEventAttributes
                {
                    EventType = MyInfinarioEventType.FirstRun,
                    EventTimestamp = DateTime.UtcNow,
                    ProcessStart = attributes
                });
            }
        }