using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Reflection; using Analytics; using Harmony; using RobocraftX.Common; using Svelto.ECS; namespace GamecraftModdingAPI.Utility { /// /// Patch of Analytics.AnalyticsCompositionRoot.Compose(...) /// This stops some analytics collection built into Gamecraft. /// DO NOT USE! (This will likely crash your game on shutdown) /// [HarmonyPatch] class AnalyticsDisablerPatch { /// /// Don't activate gameplay analytics? /// public static bool DisableAnalytics = false; public static bool Prefix(object contextHolder, EnginesRoot enginesRoot, RCXMode rcxMode) { return !DisableAnalytics; } public static MethodBase TargetMethod(HarmonyInstance instance) { return typeof(Analytics.AnalyticsCompositionRoot).GetMethod("Compose").MakeGenericMethod(typeof(object)); } } }