Decompiled source of JoinSpectators v1.0.1

plugins/JoinSpectators.dll

Decompiled 2 years ago
using System;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using UnityEngine;

[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.0", FrameworkDisplayName = ".NET Standard 2.0")]
[assembly: AssemblyCompany("JoinSpectators")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("JoinSpectators")]
[assembly: AssemblyTitle("JoinSpectators")]
[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 JoinSpectators
{
	[BepInPlugin("GeeEm.WrestlingEmpire.JoinSpectators", "JoinSpectators", "1.0.1")]
	[HarmonyPatch]
	public class Plugin : BaseUnityPlugin
	{
		public const string PluginGuid = "GeeEm.WrestlingEmpire.JoinSpectators";

		public const string PluginName = "JoinSpectators";

		public const string PluginVer = "1.0.1";

		internal static ManualLogSource Log;

		internal static readonly Harmony Harmony = new Harmony("GeeEm.WrestlingEmpire.JoinSpectators");

		public static ConfigEntry<KeyCode> CPUButton;

		internal static string PluginPath;

		private void Awake()
		{
			Log = ((BaseUnityPlugin)this).Logger;
			PluginPath = Path.GetDirectoryName(((BaseUnityPlugin)this).Info.Location);
			CPUButton = ((BaseUnityPlugin)this).Config.Bind<KeyCode>("Controls", "CPU Button", (KeyCode)301, "Press this button to let CPU take control of your character.");
		}

		private void OnEnable()
		{
			Harmony.PatchAll();
			((BaseUnityPlugin)this).Logger.LogInfo((object)"Loaded JoinSpectators!");
		}

		private void OnDisable()
		{
			Harmony.UnpatchSelf();
			((BaseUnityPlugin)this).Logger.LogInfo((object)"Unloaded JoinSpectators!");
		}

		private void Update()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			if (!Input.GetKeyDown(CPUButton.Value))
			{
				return;
			}
			for (int num = HKJOAJOKOIJ.NGCNKGDDKGF; num >= 0; num--)
			{
				if (HKJOAJOKOIJ.NAADDLFFIHG[num].AHBNKMMMGFI > 0 && HKJOAJOKOIJ.NAADDLFFIHG[num].BPJFLJPKKJK >= 0 && HKJOAJOKOIJ.NAADDLFFIHG[num].FOAPDJMIFGP > 0 && HKJOAJOKOIJ.NAADDLFFIHG[num].FOAPDJMIFGP <= NJBJIIIACEP.NBBBLJDBLNM)
				{
					int fOAPDJMIFGP = HKJOAJOKOIJ.NAADDLFFIHG[num].FOAPDJMIFGP;
					NJBJIIIACEP.OAAMGFLINOB[fOAPDJMIFGP].NLOOBNDGIKO.FOAPDJMIFGP = 0;
					NJBJIIIACEP.OAAMGFLINOB[fOAPDJMIFGP].NLOOBNDGIKO.AGEGHJOCFHG.SetActive(false);
					NJBJIIIACEP.OAAMGFLINOB[fOAPDJMIFGP].OJAJENJLBMF = -1;
					NJBJIIIACEP.OAAMGFLINOB[fOAPDJMIFGP].NLOOBNDGIKO = HKJOAJOKOIJ.IPDFOJEMPMM;
					break;
				}
			}
		}
	}
}