Esempio n. 1
0
        private static void StoreConsent(MyGuiScreenMessageBox.ResultEnum confirmationResult, bool consent, Action continuation)
        {
            if (confirmationResult != MyGuiScreenMessageBox.ResultEnum.YES)
            {
                return;
            }

            if (ConsentRequested && consent == ConsentGiven)
            {
                continuation?.Invoke();
                return;
            }

            if (!StatsClient.Consent(consent))
            {
                LogFile.WriteLine("Failed to register player consent on statistics server");
                return;
            }

            var config = Main.Instance.Config;

            config.DataHandlingConsentDate = Tools.Tools.FormatDateIso8601(DateTime.Today);
            config.DataHandlingConsent     = consent;
            config.Save();

            if (consent)
            {
                StatsClient.Track(Main.Instance.TrackablePluginIds);
            }

            OnConsentChanged?.Invoke();

            continuation?.Invoke();
        }
Esempio n. 2
0
        private void ReportEnabledPlugins()
        {
            if (!PlayerConsent.ConsentGiven)
            {
                return;
            }

            Splash.SetText("Reporting plugin usage...");
            LogFile.WriteLine("Reporting plugin usage");

            // Config has already been validated at this point so all enabled plugins will have list items
            // FIXME: Move into a background thread
            if (StatsClient.Track(TrackablePluginIds))
            {
                LogFile.WriteLine("List of enabled plugins has been sent to the statistics server");
            }
            else
            {
                LogFile.WriteLine("Failed to send the list of enabled plugins to the statistics server");
            }
        }