Decompiled source of WormUtils v1.0.1

WormUtils.dll

Decompiled a year ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Logging;
using IL;
using Microsoft.CodeAnalysis;
using Mono.Cecil.Cil;
using MonoMod.Cil;
using On;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("WormUtils")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyDescription("My first plugin")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("WormUtils")]
[assembly: AssemblyTitle("WormUtils")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
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 WormUtils
{
	[BepInPlugin("psuedopulse.WormUtils", "WormUtils", "1.0.0")]
	public class Plugin : BaseUnityPlugin
	{
		[Serializable]
		[CompilerGenerated]
		private sealed class <>c
		{
			public static readonly <>c <>9 = new <>c();

			public static hook_CheckForTeamSizeIssues <>9__1_0;

			public static hook_PickRandomWormsFromOptedInPlayersIfNeeded <>9__1_1;

			public static Func<Instruction, bool> <>9__1_3;

			public static Manipulator <>9__1_2;

			internal bool <Awake>b__1_0(orig_CheckForTeamSizeIssues orig, LobbyManager self)
			{
				return false;
			}

			internal void <Awake>b__1_1(orig_PickRandomWormsFromOptedInPlayersIfNeeded orig, LobbyManager self)
			{
			}

			internal void <Awake>b__1_2(ILContext il)
			{
				//IL_0002: Unknown result type (might be due to invalid IL or missing references)
				//IL_0008: Expected O, but got Unknown
				ILCursor val = new ILCursor(il);
				val.GotoNext((MoveType)0, new Func<Instruction, bool>[1]
				{
					(Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, 8)
				});
				val.Next.Operand = 32;
			}

			internal bool <Awake>b__1_3(Instruction x)
			{
				return ILPatternMatchingExt.MatchLdcI4(x, 8);
			}
		}

		public static ManualLogSource logger;

		private void Awake()
		{
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Expected O, but got Unknown
			//IL_0045: Unknown result type (might be due to invalid IL or missing references)
			//IL_004a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: Expected O, but got Unknown
			//IL_006a: Unknown result type (might be due to invalid IL or missing references)
			//IL_006f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0075: Expected O, but got Unknown
			logger = ((BaseUnityPlugin)this).Logger;
			object obj = <>c.<>9__1_0;
			if (obj == null)
			{
				hook_CheckForTeamSizeIssues val = (orig_CheckForTeamSizeIssues orig, LobbyManager self) => false;
				<>c.<>9__1_0 = val;
				obj = (object)val;
			}
			LobbyManager.CheckForTeamSizeIssues += (hook_CheckForTeamSizeIssues)obj;
			object obj2 = <>c.<>9__1_1;
			if (obj2 == null)
			{
				hook_PickRandomWormsFromOptedInPlayersIfNeeded val2 = delegate
				{
				};
				<>c.<>9__1_1 = val2;
				obj2 = (object)val2;
			}
			LobbyManager.PickRandomWormsFromOptedInPlayersIfNeeded += (hook_PickRandomWormsFromOptedInPlayersIfNeeded)obj2;
			object obj3 = <>c.<>9__1_2;
			if (obj3 == null)
			{
				Manipulator val3 = delegate(ILContext il)
				{
					//IL_0002: Unknown result type (might be due to invalid IL or missing references)
					//IL_0008: Expected O, but got Unknown
					ILCursor val4 = new ILCursor(il);
					val4.GotoNext((MoveType)0, new Func<Instruction, bool>[1]
					{
						(Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, 8)
					});
					val4.Next.Operand = 32;
				};
				<>c.<>9__1_2 = val3;
				obj3 = (object)val3;
			}
			RelayManager.ApprovalCallback += (Manipulator)obj3;
		}
	}
	public static class PluginInfo
	{
		public const string PLUGIN_GUID = "WormUtils";

		public const string PLUGIN_NAME = "WormUtils";

		public const string PLUGIN_VERSION = "1.0.0";
	}
}