Decompiled source of LogMute v1.0.4

LogMute.dll

Decompiled 2 weeks ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using System.Text.RegularExpressions;
using BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Configuration;
using BepInEx.Logging;
using HarmonyLib;
using IL.RoR2;
using IL.RoR2.UI;
using LogMute.Patches;
using Microsoft.CodeAnalysis;
using Mono.Cecil.Cil;
using MonoMod.Cil;
using MonoMod.RuntimeDetour;
using RiskOfOptions;
using RiskOfOptions.OptionConfigs;
using RiskOfOptions.Options;
using RoR2;
using UnityEngine;
using UnityEngine.Networking;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("LogMute")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+d499e3e7f47576ef7dda072463273a315406e375")]
[assembly: AssemblyProduct("LogMute")]
[assembly: AssemblyTitle("LogMute")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
[module: UnverifiableCode]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace LogMute
{
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInPlugin("_score.LogMute", "LogMute", "1.0.4")]
	public class LogMutePlugin : BaseUnityPlugin
	{
		public const string PluginGUID = "_score.LogMute";

		public const string PluginAuthor = "score";

		public const string PluginName = "LogMute";

		public const string PluginVersion = "1.0.4";

		public static bool RooInstalled => Chainloader.PluginInfos.ContainsKey("com.rune580.riskofoptions");

		public static LogMutePlugin Instance { get; private set; }

		public void Awake()
		{
			Instance = this;
			PluginConfig.Init();
			MuteHarmonyPatches.Init();
			if (PluginConfig.muteVanilla.Value)
			{
				VanillaPatches.Init();
			}
		}
	}
	internal static class PluginConfig
	{
		public static ConfigFile myConfig;

		public static ConfigEntry<bool> muteVanilla;

		public static ConfigEntry<string> exactMatch;

		public static ConfigEntry<string> prefixMatch;

		public static ConfigEntry<string> infixMatch;

		[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
		public static void Init()
		{
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Expected O, but got Unknown
			myConfig = new ConfigFile(Path.Combine(Paths.ConfigPath, "_score.LogMute.cfg"), true);
			if (LogMutePlugin.RooInstalled)
			{
				InitRoO();
			}
			muteVanilla = BindOption("General", "Mute Vanilla Logs", defaultValue: true, "Mutes a handful of the more annoying and spammy logs present in vanilla.", restartRequired: true);
			exactMatch = BindOption("General", "Exact Matches to Filter", "Teambuff", "List of exact matches to filter, separated by comma. accepts regex patterns.");
			prefixMatch = BindOption("General", "Prefix Matches to Filter", string.Empty, "List of prefix matches to filter, separated by comma. accepts regex patterns.");
			infixMatch = BindOption("General", "Infix Matches to Filter", string.Empty, "List of infix matches to filter, separated by comma. accepts regex patterns.");
		}

		[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
		public static ConfigEntry<T> BindOption<T>(string section, string name, T defaultValue, string description = "", bool restartRequired = false)
		{
			if (string.IsNullOrEmpty(description))
			{
				description = name;
			}
			if (restartRequired)
			{
				description += " (restart required)";
			}
			ConfigEntry<T> val = myConfig.Bind<T>(section, name, defaultValue, description);
			if (LogMutePlugin.RooInstalled)
			{
				TryRegisterOption<T>(val, restartRequired);
			}
			return val;
		}

		[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
		public static ConfigEntry<T> BindOptionSlider<T>(string section, string name, T defaultValue, string description = "", float min = 0f, float max = 20f, bool restartRequired = false)
		{
			if (string.IsNullOrEmpty(description))
			{
				description = name;
			}
			string text = description;
			T val = defaultValue;
			description = text + " (Default: " + val?.ToString() + ")";
			if (restartRequired)
			{
				description += " (restart required)";
			}
			ConfigEntry<T> val2 = myConfig.Bind<T>(section, name, defaultValue, description);
			if (LogMutePlugin.RooInstalled)
			{
				TryRegisterOptionSlider<T>(val2, min, max, restartRequired);
			}
			return val2;
		}

		[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
		public static void InitRoO()
		{
			ModSettingsManager.SetModDescription("Mutes annoying logs.");
		}

		[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
		public static void TryRegisterOption<T>(ConfigEntry<T> entry, bool restartRequired)
		{
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Expected O, but got Unknown
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: Expected O, but got Unknown
			//IL_004f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0059: Expected O, but got Unknown
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			//IL_0070: Expected O, but got Unknown
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0087: Expected O, but got Unknown
			//IL_0097: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a1: Expected O, but got Unknown
			//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bf: Expected O, but got Unknown
			if (entry is ConfigEntry<string> val)
			{
				ModSettingsManager.AddOption((BaseOption)new StringInputFieldOption(val, restartRequired));
			}
			else if (entry is ConfigEntry<float> val2)
			{
				ModSettingsManager.AddOption((BaseOption)new SliderOption(val2, new SliderConfig
				{
					min = 0f,
					max = 20f,
					FormatString = "{0:0.00}",
					restartRequired = restartRequired
				}));
			}
			else if (entry is ConfigEntry<int> val3)
			{
				ModSettingsManager.AddOption((BaseOption)new IntSliderOption(val3, restartRequired));
			}
			else if (entry is ConfigEntry<bool> val4)
			{
				ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(val4, restartRequired));
			}
			else if (entry is ConfigEntry<KeyboardShortcut> val5)
			{
				ModSettingsManager.AddOption((BaseOption)new KeyBindOption(val5, restartRequired));
			}
			else if (typeof(T).IsEnum)
			{
				ModSettingsManager.AddOption((BaseOption)new ChoiceOption((ConfigEntryBase)(object)entry, restartRequired));
			}
		}

		[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
		public static void TryRegisterOptionSlider<T>(ConfigEntry<T> entry, float min, float max, bool restartRequired)
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Expected O, but got Unknown
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_003c: Expected O, but got Unknown
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			//IL_004d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			//IL_005b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			//IL_0072: Expected O, but got Unknown
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0077: Expected O, but got Unknown
			if (entry is ConfigEntry<int> val)
			{
				ModSettingsManager.AddOption((BaseOption)new IntSliderOption(val, new IntSliderConfig
				{
					min = (int)min,
					max = (int)max,
					formatString = "{0:0.00}",
					restartRequired = restartRequired
				}));
			}
			else if (entry is ConfigEntry<float> val2)
			{
				ModSettingsManager.AddOption((BaseOption)new SliderOption(val2, new SliderConfig
				{
					min = min,
					max = max,
					FormatString = "{0:0.00}",
					restartRequired = restartRequired
				}));
			}
		}
	}
}
namespace LogMute.Patches
{
	public static class MuteHarmonyPatches
	{
		public static List<Regex> LogMuteCustom { get; set; }

		public static bool RegexExclude(object content)
		{
			return !LogMuteCustom.Any((Regex x) => x.IsMatch(content?.ToString() ?? "Null"));
		}

		public static void Init()
		{
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_0046: Unknown result type (might be due to invalid IL or missing references)
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			PluginConfig.myConfig.SettingChanged += ConfigReloaded;
			ConfigReloaded(null, null);
			Harmony val = new Harmony("_score.LogMute");
			val.PatchAll(typeof(ScaryClassVanilla));
			val.PatchAll(typeof(ScaryClassVanillaFormat));
			val.PatchAll(typeof(ScaryClassVanillaException));
			val.PatchAll(typeof(ScaryClassModded));
		}

		private static void ConfigReloaded(object _, EventArgs __)
		{
			List<Regex> list = new List<Regex>();
			list.AddRange(from x in CustomSplit(PluginConfig.exactMatch.Value)
				select new Regex("^\\s*" + x.Trim() + "\\s*$"));
			list.AddRange(from x in CustomSplit(PluginConfig.prefixMatch.Value)
				select new Regex("^\\s*" + x.Trim()));
			list.AddRange(from x in CustomSplit(PluginConfig.infixMatch.Value)
				select new Regex(x.Trim()));
			LogMuteCustom = list;
		}

		private static IEnumerable<string> CustomSplit(string str)
		{
			List<string> list = new List<string>();
			string text = string.Empty;
			for (int i = 0; i < str.Length; i++)
			{
				if (str[i] == ',')
				{
					list.Add(text);
					text = "";
				}
				else if (i + 1 < str.Length && str[i] == '\\' && str[i + 1] == ',')
				{
					text += ",";
					i++;
				}
				else if (i + 1 < str.Length && str[i] == '\\' && str[i + 1] == '\\')
				{
					text += "\\\\";
					i++;
				}
				else
				{
					text += str[i];
				}
			}
			list.Add(text);
			return list.Where((string x) => !string.IsNullOrWhiteSpace(x));
		}
	}
	[HarmonyPatch]
	public class ScaryClassVanilla
	{
		public static bool Prefix(ref object message)
		{
			return MuteHarmonyPatches.RegexExclude(message);
		}

		public static IEnumerable<MethodBase> TargetMethods()
		{
			return new <>z__ReadOnlyArray<MethodBase>(new MethodBase[6]
			{
				typeof(Debug).GetMethod("Log", new Type[1] { typeof(object) }),
				typeof(Debug).GetMethod("Log", new Type[2]
				{
					typeof(object),
					typeof(Object)
				}),
				typeof(Debug).GetMethod("LogError", new Type[1] { typeof(object) }),
				typeof(Debug).GetMethod("LogError", new Type[2]
				{
					typeof(object),
					typeof(Object)
				}),
				typeof(Debug).GetMethod("LogWarning", new Type[1] { typeof(object) }),
				typeof(Debug).GetMethod("LogWarning", new Type[2]
				{
					typeof(object),
					typeof(Object)
				})
			});
		}
	}
	[HarmonyPatch]
	public class ScaryClassVanillaFormat
	{
		public static bool Prefix(ref object format)
		{
			return MuteHarmonyPatches.RegexExclude(format);
		}

		public static IEnumerable<MethodBase> TargetMethods()
		{
			return new <>z__ReadOnlyArray<MethodBase>(new MethodBase[6]
			{
				typeof(Debug).GetMethod("LogFormat", new Type[2]
				{
					typeof(string),
					typeof(object[])
				}),
				typeof(Debug).GetMethod("LogFormat", new Type[3]
				{
					typeof(Object),
					typeof(string),
					typeof(object[])
				}),
				typeof(Debug).GetMethod("LogErrorFormat", new Type[2]
				{
					typeof(string),
					typeof(object[])
				}),
				typeof(Debug).GetMethod("LogErrorFormat", new Type[3]
				{
					typeof(Object),
					typeof(string),
					typeof(object[])
				}),
				typeof(Debug).GetMethod("LogWarningFormat", new Type[2]
				{
					typeof(string),
					typeof(object[])
				}),
				typeof(Debug).GetMethod("LogWarningFormat", new Type[3]
				{
					typeof(Object),
					typeof(string),
					typeof(object[])
				})
			});
		}
	}
	[HarmonyPatch]
	public class ScaryClassVanillaException
	{
		public static bool Prefix(ref Exception exception)
		{
			return MuteHarmonyPatches.RegexExclude(exception);
		}

		public static IEnumerable<MethodBase> TargetMethods()
		{
			return new <>z__ReadOnlyArray<MethodBase>(new MethodBase[2]
			{
				typeof(Debug).GetMethod("LogException", new Type[1] { typeof(Exception) }),
				typeof(Debug).GetMethod("LogException", new Type[2]
				{
					typeof(Exception),
					typeof(Object)
				})
			});
		}
	}
	[HarmonyPatch]
	public class ScaryClassModded
	{
		public static bool Prefix(ref object data)
		{
			return MuteHarmonyPatches.RegexExclude(data);
		}

		public static MethodBase TargetMethod()
		{
			return typeof(ManualLogSource).GetMethod("Log", new Type[2]
			{
				typeof(LogLevel),
				typeof(object)
			});
		}
	}
	public static class VanillaPatches
	{
		[CompilerGenerated]
		private static class <>O
		{
			public static Manipulator <0>__EffectComponent_Start;

			public static Manipulator <1>__EffectManagerHelper_Reset;

			public static Manipulator <2>__EffectManagerHelper_StopAllParticleSystems;

			public static Manipulator <3>__Tracer_PrepForPoolUsage;

			public static Manipulator <4>__EffectManager_SpawnEffect_GameObject_EffectData_bool;

			public static Manipulator <5>__InputSourceFilter_Refresh;

			public static Manipulator <6>__MapZone_TryZoneStart;

			public static Manipulator <7>__EffectManager_ClearAllPools;

			public static Manipulator <8>__EffectManager_KillAllPools;

			public static Manipulator <9>__NetworkScene_RegisterPrefab;

			public static Manipulator <10>__NetworkScene_RegisterPrefab2;

			public static Manipulator <11>__NetworkScene_RegisterSpawnHandler;

			public static Manipulator <12>__Transform_setParent;

			public static Manipulator <13>__Def_setIndex;
		}

		private static void RemoveLogFormat(this ILCursor c, string logName)
		{
			c.RemoveLog(logName, 2);
		}

		private static void RemoveLog(this ILCursor c, string logName, int count = 1)
		{
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			if (c.TryGotoNext(new Func<Instruction, bool>[1]
			{
				(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<Debug>(x, logName)
			}))
			{
				for (int i = 0; i < count; i++)
				{
					c.Emit(OpCodes.Pop);
				}
				c.Remove();
			}
		}

		public static void Init()
		{
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Expected O, but got Unknown
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Expected O, but got Unknown
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: Unknown result type (might be due to invalid IL or missing references)
			//IL_005b: Expected O, but got Unknown
			//IL_0070: Unknown result type (might be due to invalid IL or missing references)
			//IL_0075: Unknown result type (might be due to invalid IL or missing references)
			//IL_007b: Expected O, but got Unknown
			//IL_0090: Unknown result type (might be due to invalid IL or missing references)
			//IL_0095: Unknown result type (might be due to invalid IL or missing references)
			//IL_009b: Expected O, but got Unknown
			//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bb: Expected O, but got Unknown
			//IL_00d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00db: Expected O, but got Unknown
			//IL_00f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fb: Expected O, but got Unknown
			//IL_0110: Unknown result type (might be due to invalid IL or missing references)
			//IL_0115: Unknown result type (might be due to invalid IL or missing references)
			//IL_011b: Expected O, but got Unknown
			//IL_0163: Unknown result type (might be due to invalid IL or missing references)
			//IL_0158: Unknown result type (might be due to invalid IL or missing references)
			//IL_015d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0163: Expected O, but got Unknown
			//IL_01b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b9: Expected O, but got Unknown
			//IL_01f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f0: Expected O, but got Unknown
			//IL_0225: Unknown result type (might be due to invalid IL or missing references)
			//IL_021a: Unknown result type (might be due to invalid IL or missing references)
			//IL_021f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0225: Expected O, but got Unknown
			//IL_025a: Unknown result type (might be due to invalid IL or missing references)
			//IL_024f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0254: Unknown result type (might be due to invalid IL or missing references)
			//IL_025a: Expected O, but got Unknown
			//IL_028f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0284: Unknown result type (might be due to invalid IL or missing references)
			//IL_0289: Unknown result type (might be due to invalid IL or missing references)
			//IL_028f: Expected O, but got Unknown
			//IL_02c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_02be: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c4: Expected O, but got Unknown
			object obj = <>O.<0>__EffectComponent_Start;
			if (obj == null)
			{
				Manipulator val = EffectComponent_Start;
				<>O.<0>__EffectComponent_Start = val;
				obj = (object)val;
			}
			EffectComponent.Start += (Manipulator)obj;
			object obj2 = <>O.<1>__EffectManagerHelper_Reset;
			if (obj2 == null)
			{
				Manipulator val2 = EffectManagerHelper_Reset;
				<>O.<1>__EffectManagerHelper_Reset = val2;
				obj2 = (object)val2;
			}
			EffectManagerHelper.Reset += (Manipulator)obj2;
			object obj3 = <>O.<2>__EffectManagerHelper_StopAllParticleSystems;
			if (obj3 == null)
			{
				Manipulator val3 = EffectManagerHelper_StopAllParticleSystems;
				<>O.<2>__EffectManagerHelper_StopAllParticleSystems = val3;
				obj3 = (object)val3;
			}
			EffectManagerHelper.StopAllParticleSystems += (Manipulator)obj3;
			object obj4 = <>O.<3>__Tracer_PrepForPoolUsage;
			if (obj4 == null)
			{
				Manipulator val4 = Tracer_PrepForPoolUsage;
				<>O.<3>__Tracer_PrepForPoolUsage = val4;
				obj4 = (object)val4;
			}
			Tracer.PrepForPoolUsage += (Manipulator)obj4;
			object obj5 = <>O.<4>__EffectManager_SpawnEffect_GameObject_EffectData_bool;
			if (obj5 == null)
			{
				Manipulator val5 = EffectManager_SpawnEffect_GameObject_EffectData_bool;
				<>O.<4>__EffectManager_SpawnEffect_GameObject_EffectData_bool = val5;
				obj5 = (object)val5;
			}
			EffectManager.SpawnEffect_GameObject_EffectData_bool += (Manipulator)obj5;
			object obj6 = <>O.<5>__InputSourceFilter_Refresh;
			if (obj6 == null)
			{
				Manipulator val6 = InputSourceFilter_Refresh;
				<>O.<5>__InputSourceFilter_Refresh = val6;
				obj6 = (object)val6;
			}
			InputSourceFilter.Refresh += (Manipulator)obj6;
			object obj7 = <>O.<6>__MapZone_TryZoneStart;
			if (obj7 == null)
			{
				Manipulator val7 = MapZone_TryZoneStart;
				<>O.<6>__MapZone_TryZoneStart = val7;
				obj7 = (object)val7;
			}
			MapZone.TryZoneStart += (Manipulator)obj7;
			object obj8 = <>O.<7>__EffectManager_ClearAllPools;
			if (obj8 == null)
			{
				Manipulator val8 = EffectManager_ClearAllPools;
				<>O.<7>__EffectManager_ClearAllPools = val8;
				obj8 = (object)val8;
			}
			EffectManager.ClearAllPools += (Manipulator)obj8;
			object obj9 = <>O.<8>__EffectManager_KillAllPools;
			if (obj9 == null)
			{
				Manipulator val9 = EffectManager_KillAllPools;
				<>O.<8>__EffectManager_KillAllPools = val9;
				obj9 = (object)val9;
			}
			EffectManager.KillAllPools += (Manipulator)obj9;
			MethodInfo methodInfo = AccessTools.DeclaredMethod(typeof(NetworkScene), "RegisterPrefab", new Type[1] { typeof(GameObject) }, (Type[])null);
			object obj10 = <>O.<9>__NetworkScene_RegisterPrefab;
			if (obj10 == null)
			{
				Manipulator val10 = NetworkScene_RegisterPrefab;
				<>O.<9>__NetworkScene_RegisterPrefab = val10;
				obj10 = (object)val10;
			}
			new ILHook((MethodBase)methodInfo, (Manipulator)obj10);
			MethodInfo methodInfo2 = AccessTools.DeclaredMethod(typeof(NetworkScene), "RegisterPrefab", new Type[2]
			{
				typeof(GameObject),
				typeof(NetworkHash128)
			}, (Type[])null);
			object obj11 = <>O.<10>__NetworkScene_RegisterPrefab2;
			if (obj11 == null)
			{
				Manipulator val11 = NetworkScene_RegisterPrefab2;
				<>O.<10>__NetworkScene_RegisterPrefab2 = val11;
				obj11 = (object)val11;
			}
			new ILHook((MethodBase)methodInfo2, (Manipulator)obj11);
			MethodInfo methodInfo3 = AccessTools.DeclaredMethod(typeof(NetworkScene), "RegisterSpawnHandler", (Type[])null, (Type[])null);
			object obj12 = <>O.<11>__NetworkScene_RegisterSpawnHandler;
			if (obj12 == null)
			{
				Manipulator val12 = NetworkScene_RegisterSpawnHandler;
				<>O.<11>__NetworkScene_RegisterSpawnHandler = val12;
				obj12 = (object)val12;
			}
			new ILHook((MethodBase)methodInfo3, (Manipulator)obj12);
			MethodInfo methodInfo4 = AccessTools.DeclaredPropertySetter(typeof(Transform), "parent");
			object obj13 = <>O.<12>__Transform_setParent;
			if (obj13 == null)
			{
				Manipulator val13 = Transform_setParent;
				<>O.<12>__Transform_setParent = val13;
				obj13 = (object)val13;
			}
			new ILHook((MethodBase)methodInfo4, (Manipulator)obj13);
			MethodInfo methodInfo5 = AccessTools.DeclaredPropertyGetter(typeof(ItemDef), "itemIndex");
			object obj14 = <>O.<13>__Def_setIndex;
			if (obj14 == null)
			{
				Manipulator val14 = Def_setIndex;
				<>O.<13>__Def_setIndex = val14;
				obj14 = (object)val14;
			}
			new ILHook((MethodBase)methodInfo5, (Manipulator)obj14);
			MethodInfo methodInfo6 = AccessTools.DeclaredPropertyGetter(typeof(ItemTierDef), "tier");
			object obj15 = <>O.<13>__Def_setIndex;
			if (obj15 == null)
			{
				Manipulator val15 = Def_setIndex;
				<>O.<13>__Def_setIndex = val15;
				obj15 = (object)val15;
			}
			new ILHook((MethodBase)methodInfo6, (Manipulator)obj15);
			MethodInfo methodInfo7 = AccessTools.DeclaredPropertyGetter(typeof(EquipmentDef), "equipmentIndex");
			object obj16 = <>O.<13>__Def_setIndex;
			if (obj16 == null)
			{
				Manipulator val16 = Def_setIndex;
				<>O.<13>__Def_setIndex = val16;
				obj16 = (object)val16;
			}
			new ILHook((MethodBase)methodInfo7, (Manipulator)obj16);
		}

		private static void EffectManager_KillAllPools(ILContext il)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Expected O, but got Unknown
			RemoveLog(new ILCursor(il), "LogWarning");
		}

		private static void NetworkScene_RegisterPrefab(ILContext il)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Expected O, but got Unknown
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: Expected O, but got Unknown
			//IL_0029: Expected O, but got Unknown
			ILCursor val = new ILCursor(il);
			RemoveLog(val, "Log");
			RemoveLog(val, "LogWarning");
			RemoveLog(val, "LogError");
		}

		private static void NetworkScene_RegisterPrefab2(ILContext il)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Expected O, but got Unknown
			//IL_001d: Expected O, but got Unknown
			ILCursor val = new ILCursor(il);
			RemoveLog(val, "Log");
			RemoveLog(val, "LogError");
		}

		private static void NetworkScene_RegisterSpawnHandler(ILContext il)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Expected O, but got Unknown
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: Expected O, but got Unknown
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: Expected O, but got Unknown
			//IL_0035: Expected O, but got Unknown
			ILCursor val = new ILCursor(il);
			RemoveLog(val, "LogError");
			RemoveLog(val, "LogError");
			RemoveLog(val, "LogError");
			RemoveLog(val, "Log");
		}

		private static void Def_setIndex(ILContext il)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Expected O, but got Unknown
			//IL_001d: Expected O, but got Unknown
			ILCursor val = new ILCursor(il);
			RemoveLog(val, "LogError");
			RemoveLog(val, "LogError");
		}

		private static void Tracer_PrepForPoolUsage(ILContext il)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Expected O, but got Unknown
			//IL_001b: Expected O, but got Unknown
			ILCursor val = new ILCursor(il);
			RemoveLogFormat(val, "LogFormat");
			RemoveLogFormat(val, "LogFormat");
		}

		private static void EffectManager_SpawnEffect_GameObject_EffectData_bool(ILContext il)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Expected O, but got Unknown
			//IL_001d: Expected O, but got Unknown
			ILCursor val = new ILCursor(il);
			RemoveLog(val, "LogError");
			RemoveLog(val, "LogError");
		}

		private static void EffectManager_ClearAllPools(ILContext il)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Expected O, but got Unknown
			RemoveLog(new ILCursor(il), "LogWarning");
		}

		private static void MapZone_TryZoneStart(ILContext il)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0010: Expected O, but got Unknown
			RemoveLogFormat(new ILCursor(il), "LogFormat");
		}

		private static void Transform_setParent(ILContext il)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0010: Expected O, but got Unknown
			RemoveLogFormat(new ILCursor(il), "LogWarning");
		}

		private static void InputSourceFilter_Refresh(ILContext il)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0010: Expected O, but got Unknown
			RemoveLogFormat(new ILCursor(il), "LogWarningFormat");
		}

		private static void EffectManagerHelper_StopAllParticleSystems(ILContext il)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0010: Expected O, but got Unknown
			RemoveLogFormat(new ILCursor(il), "LogFormat");
		}

		private static void EffectManagerHelper_Reset(ILContext il)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0010: Expected O, but got Unknown
			RemoveLogFormat(new ILCursor(il), "LogFormat");
		}

		private static void EffectComponent_Start(ILContext il)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Expected O, but got Unknown
			RemoveLog(new ILCursor(il), "LogErrorFormat", 3);
		}
	}
}
internal sealed class <>z__ReadOnlyArray<T> : IEnumerable, ICollection, IList, IEnumerable<T>, IReadOnlyCollection<T>, IReadOnlyList<T>, ICollection<T>, IList<T>
{
	int ICollection.Count => _items.Length;

	bool ICollection.IsSynchronized => false;

	object ICollection.SyncRoot => this;

	object IList.this[int index]
	{
		get
		{
			return _items[index];
		}
		set
		{
			throw new NotSupportedException();
		}
	}

	bool IList.IsFixedSize => true;

	bool IList.IsReadOnly => true;

	int IReadOnlyCollection<T>.Count => _items.Length;

	T IReadOnlyList<T>.this[int index] => _items[index];

	int ICollection<T>.Count => _items.Length;

	bool ICollection<T>.IsReadOnly => true;

	T IList<T>.this[int index]
	{
		get
		{
			return _items[index];
		}
		set
		{
			throw new NotSupportedException();
		}
	}

	public <>z__ReadOnlyArray(T[] items)
	{
		_items = items;
	}

	IEnumerator IEnumerable.GetEnumerator()
	{
		return ((IEnumerable)_items).GetEnumerator();
	}

	void ICollection.CopyTo(Array array, int index)
	{
		((ICollection)_items).CopyTo(array, index);
	}

	int IList.Add(object value)
	{
		throw new NotSupportedException();
	}

	void IList.Clear()
	{
		throw new NotSupportedException();
	}

	bool IList.Contains(object value)
	{
		return ((IList)_items).Contains(value);
	}

	int IList.IndexOf(object value)
	{
		return ((IList)_items).IndexOf(value);
	}

	void IList.Insert(int index, object value)
	{
		throw new NotSupportedException();
	}

	void IList.Remove(object value)
	{
		throw new NotSupportedException();
	}

	void IList.RemoveAt(int index)
	{
		throw new NotSupportedException();
	}

	IEnumerator<T> IEnumerable<T>.GetEnumerator()
	{
		return ((IEnumerable<T>)_items).GetEnumerator();
	}

	void ICollection<T>.Add(T item)
	{
		throw new NotSupportedException();
	}

	void ICollection<T>.Clear()
	{
		throw new NotSupportedException();
	}

	bool ICollection<T>.Contains(T item)
	{
		return ((ICollection<T>)_items).Contains(item);
	}

	void ICollection<T>.CopyTo(T[] array, int arrayIndex)
	{
		((ICollection<T>)_items).CopyTo(array, arrayIndex);
	}

	bool ICollection<T>.Remove(T item)
	{
		throw new NotSupportedException();
	}

	int IList<T>.IndexOf(T item)
	{
		return ((IList<T>)_items).IndexOf(item);
	}

	void IList<T>.Insert(int index, T item)
	{
		throw new NotSupportedException();
	}

	void IList<T>.RemoveAt(int index)
	{
		throw new NotSupportedException();
	}
}