Decompiled source of MultiplayerModTesting v1.0.0

MultiplayerModTesting.dll

Decompiled 6 months 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.Configuration;
using Microsoft.CodeAnalysis;
using On.RoR2.Networking;
using RiskOfOptions;
using RiskOfOptions.Options;
using RoR2.Networking;
using UnityEngine.Networking;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETStandard,Version=v2.0", FrameworkDisplayName = ".NET Standard 2.0")]
[assembly: AssemblyCompany("MultiplayerModTesting")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("MultiplayerModTesting")]
[assembly: AssemblyTitle("MultiplayerModTesting")]
[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 MultiplayerModTesting
{
	[BepInPlugin("com.Nuxlar.MultiplayerModTesting", "MultiplayerModTesting", "1.0.0")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	public class MultiplayerModTesting : BaseUnityPlugin
	{
		[Serializable]
		[CompilerGenerated]
		private sealed class <>c
		{
			public static readonly <>c <>9 = new <>c();

			public static hook_OnClientConnect <>9__5_2;

			public static hook_OnClientConnect <>9__5_3;

			public static EventHandler <>9__5_0;

			public static hook_OnClientConnect <>9__5_1;

			internal void <Awake>b__5_0(object rooObject, EventArgs args)
			{
				//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_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
				if (enableTesting.Value)
				{
					object obj = <>9__5_2;
					if (obj == null)
					{
						hook_OnClientConnect val = delegate
						{
						};
						<>9__5_2 = val;
						obj = (object)val;
					}
					NetworkManagerSystemSteam.OnClientConnect += (hook_OnClientConnect)obj;
				}
				else
				{
					object obj2 = <>9__5_3;
					if (obj2 == null)
					{
						hook_OnClientConnect val2 = delegate
						{
						};
						<>9__5_3 = val2;
						obj2 = (object)val2;
					}
					NetworkManagerSystemSteam.OnClientConnect -= (hook_OnClientConnect)obj2;
				}
			}

			internal void <Awake>b__5_2(orig_OnClientConnect s, NetworkManagerSystemSteam u, NetworkConnection t)
			{
			}

			internal void <Awake>b__5_3(orig_OnClientConnect s, NetworkManagerSystemSteam u, NetworkConnection t)
			{
			}

			internal void <Awake>b__5_1(orig_OnClientConnect s, NetworkManagerSystemSteam u, NetworkConnection t)
			{
			}
		}

		public static ConfigEntry<bool> enableTesting;

		private static ConfigFile MMTConfig { get; set; }

		public void Awake()
		{
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Expected O, but got Unknown
			//IL_0067: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: Expected O, but got Unknown
			//IL_009b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a6: Expected O, but got Unknown
			MMTConfig = new ConfigFile(Paths.ConfigPath + "\\com.Nuxlar.MultiplayerModTesting.cfg", true);
			enableTesting = MMTConfig.Bind<bool>("General", "Enable Testing", false, "Enable when testing multiplayer");
			enableTesting.SettingChanged += delegate
			{
				//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_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
				if (enableTesting.Value)
				{
					object obj2 = <>c.<>9__5_2;
					if (obj2 == null)
					{
						hook_OnClientConnect val2 = delegate
						{
						};
						<>c.<>9__5_2 = val2;
						obj2 = (object)val2;
					}
					NetworkManagerSystemSteam.OnClientConnect += (hook_OnClientConnect)obj2;
				}
				else
				{
					object obj3 = <>c.<>9__5_3;
					if (obj3 == null)
					{
						hook_OnClientConnect val3 = delegate
						{
						};
						<>c.<>9__5_3 = val3;
						obj3 = (object)val3;
					}
					NetworkManagerSystemSteam.OnClientConnect -= (hook_OnClientConnect)obj3;
				}
			};
			ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(enableTesting));
			ModSettingsManager.SetModDescription("Mod for testing mods in multiplayer locally.");
			if (enableTesting.Value)
			{
				object obj = <>c.<>9__5_1;
				if (obj == null)
				{
					hook_OnClientConnect val = delegate
					{
					};
					<>c.<>9__5_1 = val;
					obj = (object)val;
				}
				NetworkManagerSystemSteam.OnClientConnect += (hook_OnClientConnect)obj;
			}
		}
	}
}