2020-01-26 20:26:48 +00:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using System.Reflection;
|
|
|
|
|
|
|
|
|
|
using Analytics;
|
2020-05-03 19:31:09 +00:00
|
|
|
|
using HarmonyLib;
|
2020-01-26 20:26:48 +00:00
|
|
|
|
using RobocraftX.Common;
|
|
|
|
|
using Svelto.ECS;
|
|
|
|
|
|
|
|
|
|
namespace GamecraftModdingAPI.Utility
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Patch of Analytics.AnalyticsCompositionRoot.Compose<T>(...)
|
|
|
|
|
/// This stops some analytics collection built into Gamecraft.
|
|
|
|
|
/// DO NOT USE! (This will likely crash your game on shutdown)
|
|
|
|
|
/// </summary>
|
|
|
|
|
[HarmonyPatch]
|
|
|
|
|
class AnalyticsDisablerPatch
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Don't activate gameplay analytics?
|
|
|
|
|
/// </summary>
|
|
|
|
|
public static bool DisableAnalytics = false;
|
|
|
|
|
|
|
|
|
|
public static bool Prefix(object contextHolder, EnginesRoot enginesRoot, RCXMode rcxMode)
|
|
|
|
|
{
|
|
|
|
|
return !DisableAnalytics;
|
|
|
|
|
}
|
|
|
|
|
|
2020-05-03 19:31:09 +00:00
|
|
|
|
public static MethodBase TargetMethod(Harmony instance)
|
2020-01-26 20:26:48 +00:00
|
|
|
|
{
|
|
|
|
|
return typeof(Analytics.AnalyticsCompositionRoot).GetMethod("Compose").MakeGenericMethod(typeof(object));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|