Decompiled source of Dedicated Serverinator v1.1.6

BepInEx/plugins/dedicatedserverinator.dll

Decompiled 2 days ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
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 Photon.Pun;
using UnityEngine;
using Zorro.Core;
using pworld.Scripts.Extensions;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: IgnoresAccessChecksTo("Assembly-CSharp")]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("dedicatedserverinator")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.1.0")]
[assembly: AssemblyInformationalVersion("1.0.1")]
[assembly: AssemblyProduct("dedicatedserverinator")]
[assembly: AssemblyTitle("dedicatedserverinator")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.1.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.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableAttribute : Attribute
	{
		public readonly byte[] NullableFlags;

		public NullableAttribute(byte P_0)
		{
			NullableFlags = new byte[1] { P_0 };
		}

		public NullableAttribute(byte[] P_0)
		{
			NullableFlags = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableContextAttribute : Attribute
	{
		public readonly byte Flag;

		public NullableContextAttribute(byte P_0)
		{
			Flag = P_0;
		}
	}
	[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 dsi
{
	[HarmonyPatch(typeof(EndScreen), "EndSequenceRoutine")]
	internal static class DoTheStuff
	{
		public static float deathWait;

		private static void Prefix(EndScreen __instance)
		{
			if (PhotonNetwork.IsMasterClient)
			{
				ExtGameObject.GetOrAddComponent<DeathHandler>(((Component)Character.localCharacter).gameObject).fella = Character.localCharacter;
			}
		}
	}
	[HarmonyPatch(typeof(CharacterAfflictions), "Update")]
	internal static class DoTheStuffAtTheAirport
	{
		public static IntermissionHandler intHandler;

		private static void Postfix(CharacterAfflictions __instance)
		{
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_0131: Unknown result type (might be due to invalid IL or missing references)
			//IL_020b: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_018c: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bb: 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_011c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0122: Unknown result type (might be due to invalid IL or missing references)
			//IL_0093: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_02cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0266: Unknown result type (might be due to invalid IL or missing references)
			//IL_028f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0295: Unknown result type (might be due to invalid IL or missing references)
			//IL_0380: Unknown result type (might be due to invalid IL or missing references)
			//IL_03a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_03af: Unknown result type (might be due to invalid IL or missing references)
			//IL_0340: Unknown result type (might be due to invalid IL or missing references)
			//IL_0369: Unknown result type (might be due to invalid IL or missing references)
			//IL_036f: Unknown result type (might be due to invalid IL or missing references)
			if (!__instance.character.IsLocal || !PhotonNetwork.IsMasterClient)
			{
				return;
			}
			if (Input.GetKeyDown(Plugin.enableAllKeybind.Value))
			{
				PlayerConnectionLog val = Object.FindAnyObjectByType<PlayerConnectionLog>();
				if (Plugin.enabled.Value && Plugin.KYSEnabled.Value && Plugin.LPMEnabled.Value)
				{
					Plugin.enabled.Value = false;
					Plugin.KYSEnabled.Value = false;
					Plugin.LPMEnabled.Value = false;
					string text = "<color=#" + ColorUtility.ToHtmlStringRGB(Color.red) + ">Everything is disabled.";
					val.AddMessage(text);
					val.sfxLeave.Play(default(Vector3));
				}
				else
				{
					Plugin.enabled.Value = true;
					Plugin.KYSEnabled.Value = true;
					Plugin.LPMEnabled.Value = true;
					string text2 = "<color=#" + ColorUtility.ToHtmlStringRGB(Color.green) + ">Everything is enabled.";
					val.AddMessage(text2);
					val.sfxJoin.Play(default(Vector3));
				}
			}
			if (Input.GetKeyDown(Plugin.enableKYSKeybind.Value))
			{
				Plugin.KYSEnabled.Value = !Plugin.KYSEnabled.Value;
				PlayerConnectionLog val2 = Object.FindAnyObjectByType<PlayerConnectionLog>();
				if ((Object)(object)val2 != (Object)null)
				{
					if (Plugin.KYSEnabled.Value)
					{
						string text3 = "<color=#" + ColorUtility.ToHtmlStringRGB(Color.green) + ">Auto kill is enabled";
						val2.AddMessage(text3);
						val2.sfxJoin.Play(default(Vector3));
					}
					else
					{
						string text4 = "<color=#" + ColorUtility.ToHtmlStringRGB(Color.red) + ">Auto kill is disabled";
						val2.AddMessage(text4);
						val2.sfxLeave.Play(default(Vector3));
					}
				}
			}
			if (Input.GetKeyDown(Plugin.enableLPMKeybind.Value))
			{
				Plugin.LPMEnabled.Value = !Plugin.LPMEnabled.Value;
				PlayerConnectionLog val3 = Object.FindAnyObjectByType<PlayerConnectionLog>();
				if ((Object)(object)val3 != (Object)null)
				{
					if (Plugin.LPMEnabled.Value)
					{
						string text5 = "<color=#" + ColorUtility.ToHtmlStringRGB(Color.green) + ">Low power mode is enabled";
						val3.AddMessage(text5);
						val3.sfxJoin.Play(default(Vector3));
					}
					else
					{
						string text6 = "<color=#" + ColorUtility.ToHtmlStringRGB(Color.red) + ">Low power mode is disabled";
						val3.AddMessage(text6);
						val3.sfxLeave.Play(default(Vector3));
					}
				}
			}
			if (Input.GetKeyDown(Plugin.enableKeybind.Value))
			{
				Plugin.enabled.Value = !Plugin.enabled.Value;
				PlayerConnectionLog val4 = Object.FindAnyObjectByType<PlayerConnectionLog>();
				if ((Object)(object)val4 != (Object)null)
				{
					if (Plugin.enabled.Value)
					{
						string text7 = "<color=#" + ColorUtility.ToHtmlStringRGB(Color.green) + ">Dedicated serverinator is enabled";
						val4.AddMessage(text7);
						val4.sfxJoin.Play(default(Vector3));
					}
					else
					{
						string text8 = "<color=#" + ColorUtility.ToHtmlStringRGB(Color.red) + ">Dedicated serverinator is disabled";
						val4.AddMessage(text8);
						val4.sfxLeave.Play(default(Vector3));
					}
				}
			}
			if (!__instance.character.IsLocal || !PhotonNetwork.IsMasterClient || !__instance.character.inAirport || !Plugin.enabled.Value || !((Object)(object)intHandler == (Object)null))
			{
				return;
			}
			intHandler = ExtGameObject.GetOrAddComponent<IntermissionHandler>(((Component)__instance.character).gameObject);
			if (Plugin.LPMEnabled.Value)
			{
				if (Plugin.LPMDisableParticles.Value)
				{
					ParticleSystem[] array = Object.FindObjectsOfType<ParticleSystem>();
					foreach (ParticleSystem val5 in array)
					{
						val5.Stop(true, (ParticleSystemStopBehavior)0);
					}
				}
				if (Plugin.LPMDisableRendering.Value)
				{
					Renderer[] array2 = Object.FindObjectsOfType<Renderer>();
					foreach (Renderer val6 in array2)
					{
						val6.enabled = false;
					}
				}
			}
			intHandler.fella = __instance.character;
		}
	}
	internal class TheHeartAttackIsComing : MonoBehaviour
	{
		public float timer = -30f;

		public Character character;

		private PlayerConnectionLog pLog;

		public bool warned = false;

		internal void Start()
		{
			pLog = Object.FindAnyObjectByType<PlayerConnectionLog>();
		}

		internal void Update()
		{
			//IL_0053: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0072: Unknown result type (might be due to invalid IL or missing references)
			if (Plugin.KYSEnabled.Value)
			{
				timer += Time.deltaTime;
				if (timer > -15f && !warned)
				{
					string[] obj = new string[5]
					{
						"<color=#",
						ColorUtility.ToHtmlStringRGB(Color.red),
						">YOU'RE GONNNA DIEEEEEE you have auto kill on so press ",
						null,
						null
					};
					KeyCode value = Plugin.enableKYSKeybind.Value;
					obj[3] = ((object)(KeyCode)(ref value)).ToString();
					obj[4] = " if you dont want that to happen";
					string text = string.Concat(obj);
					pLog.AddMessage(text);
					warned = true;
				}
				if (timer > 3f && !character.inAirport && !character.data.dead && Plugin.KYSEnabled.Value)
				{
					character.DieInstantly();
					timer = 0f;
				}
			}
			else
			{
				warned = false;
				timer = -30f;
			}
		}
	}
	internal class IntermissionHandler : MonoBehaviour
	{
		public float intermission = 0f;

		public Character fella;

		internal void Update()
		{
			if (!fella.inAirport || !fella.IsLocal || !Plugin.enabled.Value)
			{
				return;
			}
			intermission += Time.deltaTime;
			if (intermission > Plugin.intermission.Value)
			{
				AirportCheckInKiosk component = GameObject.Find("AirportGateKiosk").GetComponent<AirportCheckInKiosk>();
				int num = Plugin.maxAscent.Value;
				if (Plugin.randomizeAscent.Value && Plugin.maxAscent.Value > Plugin.minAscent.Value)
				{
					num = Random.Range(Plugin.minAscent.Value, Plugin.maxAscent.Value + 1);
				}
				intermission = 0f;
				((MonoBehaviourPun)component).photonView.RPC("LoadIslandMaster", (RpcTarget)2, new object[1] { num });
			}
		}
	}
	internal class DeathHandler : MonoBehaviour
	{
		public float intermission;

		public Character fella;

		internal void Update()
		{
			if (!fella.IsLocal)
			{
				return;
			}
			intermission += Time.deltaTime;
			if (intermission > Plugin.deathScreenDelay.Value)
			{
				Item[] array = Object.FindObjectsByType<Item>((FindObjectsSortMode)0);
				foreach (Item val in array)
				{
					PhotonNetwork.Destroy(((MonoBehaviourPun)val).photonView);
				}
				TumbleWeed[] array2 = Object.FindObjectsByType<TumbleWeed>((FindObjectsSortMode)0);
				foreach (TumbleWeed val2 in array2)
				{
					PhotonNetwork.Destroy(val2.photonView);
				}
				Singleton<PeakHandler>.Instance.EndScreenComplete();
				intermission = 0f;
			}
		}
	}
	[HarmonyPatch(typeof(Campfire), "Awake")]
	internal static class AddCampfireHandler
	{
		internal static void Prefix(Campfire __instance)
		{
			if (!PhotonNetwork.IsMasterClient || !Plugin.autoCampfire.Value || !(__instance.nameOverride != "NAME_PORTABLE STOVE"))
			{
				return;
			}
			CampfireHandler campfireHandler = ((Component)__instance).gameObject.AddComponent<CampfireHandler>();
			campfireHandler.campfire = __instance;
			if (!Plugin.LPMEnabled.Value)
			{
				return;
			}
			if (Plugin.LPMDisableParticles.Value)
			{
				ParticleSystem[] array = Object.FindObjectsOfType<ParticleSystem>();
				foreach (ParticleSystem val in array)
				{
					val.Stop(true, (ParticleSystemStopBehavior)0);
				}
			}
			if (Plugin.LPMDisableRendering.Value)
			{
				Renderer[] array2 = Object.FindObjectsOfType<Renderer>();
				foreach (Renderer val2 in array2)
				{
					val2.enabled = false;
				}
			}
		}
	}
	internal class StatueHandler : MonoBehaviour
	{
		internal CampfireHandler pairedHandler;

		internal RespawnChest statue;

		public bool popped = false;

		public List<string> HazardNames = new List<string>();

		public void OnEnable()
		{
			((MonoBehaviour)this).StartCoroutine((IEnumerator)CheckForUseRoutine());
		}

		public IEnumerator<WaitForSeconds> CheckForUseRoutine()
		{
			while ((Object)(object)pairedHandler == (Object)null)
			{
				Debug.Log((object)"Attempting to pair...");
				List<CampfireHandler> campHandlers = Object.FindObjectsByType<CampfireHandler>((FindObjectsInactive)1, (FindObjectsSortMode)1).ToList();
				foreach (CampfireHandler c in campHandlers)
				{
					float distance = Vector3.Distance(((Component)c).transform.position, ((Component)this).transform.position);
					if (Singleton<MapHandler>.Instance.currentSegment == 3)
					{
						distance -= 300f;
					}
					if (distance < 100f)
					{
						pairedHandler = c;
						c.pairedStatueHandler = this;
					}
				}
				yield return new WaitForSeconds(1f);
			}
			Debug.Log((object)"Paired!");
			while (true)
			{
				if ((Object)(object)pairedHandler != (Object)null)
				{
					popped = (int)((Luggage)statue).state == 1;
					if (popped)
					{
						Debug.Log((object)"Popped!");
						break;
					}
					if (Plugin.behaviourChosen.Value == Plugin.RespawnStatueBehaviour.AutoTrigger)
					{
						((Luggage)statue).Interact_CastFinished(Character.localCharacter);
						Debug.Log((object)"Popped!");
						break;
					}
					yield return new WaitForSeconds(1f);
				}
				else
				{
					yield return new WaitForSeconds(1f);
				}
			}
			if (!Plugin.clearHazardsAroundStatue.Value)
			{
				yield break;
			}
			for (int i = 0; i < 999; i++)
			{
				RemoveAfterSeconds[] _iHateThisShit = Object.FindObjectsByType<RemoveAfterSeconds>((FindObjectsInactive)0, (FindObjectsSortMode)0);
				RemoveAfterSeconds[] array = _iHateThisShit;
				foreach (RemoveAfterSeconds _i in array)
				{
					if (Vector3.Distance(((Component)this).transform.position, ((Component)_i).transform.position) < Plugin.clearHazardDistance.Value)
					{
						_i.seconds = -1f;
					}
				}
				yield return new WaitForSeconds(1f);
			}
		}
	}
	internal class CampfireHandler : MonoBehaviour
	{
		public float counter;

		public Campfire campfire;

		public bool charsArePresent = false;

		public bool going;

		public StatueHandler pairedStatueHandler = new StatueHandler();

		public void OnEnable()
		{
			addStatueHandlers();
			((MonoBehaviour)this).StartCoroutine((IEnumerator)AutoCampfireCoroutine());
		}

		public IEnumerator<WaitForSeconds> AutoCampfireCoroutine()
		{
			while (true)
			{
				if (PhotonNetwork.IsMasterClient && Plugin.autoCampfire.Value)
				{
					charsArePresent = true;
					if (Plugin.behaviourChosen.Value == Plugin.RespawnStatueBehaviour.WaitForPlayerUse && !pairedStatueHandler.popped)
					{
						charsArePresent = false;
					}
					CheckForPlayers();
					if (Character.AllCharacters.Count < 1)
					{
						charsArePresent = false;
					}
					if (charsArePresent)
					{
						going = true;
					}
					else if (Plugin.autoCampfireTimerReset.Value || Singleton<MapHandler>.Instance.currentSegment == 3)
					{
						counter = 0f;
						going = false;
					}
					if (going)
					{
						counter += 1f;
						int _additionalWaitTime = 0;
						if ((int)Singleton<MapHandler>.Instance.GetCurrentSegment() == 3)
						{
							_additionalWaitTime = 10;
						}
						if (counter > Plugin.autoCampfireDelay.Value + (float)_additionalWaitTime)
						{
							break;
						}
					}
				}
				yield return new WaitForSeconds(1f);
			}
			campfire.view.RPC("Light_Rpc", (RpcTarget)0, Array.Empty<object>());
		}

		public void addStatueHandlers()
		{
			RespawnChest[] array = Object.FindObjectsByType<RespawnChest>((FindObjectsInactive)1, (FindObjectsSortMode)1);
			RespawnChest[] array2 = array;
			foreach (RespawnChest val in array2)
			{
				ExtGameObject.GetOrAddComponent<StatueHandler>(((Component)val).gameObject).statue = val;
			}
		}

		public void CheckForPlayers()
		{
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			foreach (Character allCharacter in Character.AllCharacters)
			{
				if (Vector3.Distance(allCharacter.Center, ((Component)this).transform.position) > Plugin.autoCampfireMinimumDistance.Value && !allCharacter.data.dead)
				{
					charsArePresent = false;
				}
			}
		}
	}
	[HarmonyPatch(typeof(Item), "Awake")]
	internal static class DoNotLoadItems
	{
		internal static void Prefix(Item __instance)
		{
			if (Plugin.LPMEnabled.Value && Plugin.LPMDisableRendering.Value)
			{
				Renderer[] componentsInChildren = ((Component)__instance).GetComponentsInChildren<Renderer>();
				Renderer[] array = componentsInChildren;
				foreach (Renderer val in array)
				{
					val.enabled = false;
				}
			}
		}
	}
	[HarmonyPatch(typeof(Character), "Awake")]
	internal static class DoNotRenderPlayers
	{
		private static void Postfix(Character __instance)
		{
			if (PhotonNetwork.IsMasterClient && __instance.IsLocal)
			{
				((Component)__instance).gameObject.AddComponent<TheHeartAttackIsComing>().character = __instance;
			}
			if (Plugin.LPMEnabled.Value && Plugin.LPMDisableRendering.Value)
			{
				Renderer[] componentsInChildren = ((Component)__instance).GetComponentsInChildren<Renderer>();
				Renderer[] array = componentsInChildren;
				foreach (Renderer val in array)
				{
					val.enabled = false;
				}
			}
		}
	}
	[HarmonyPatch(typeof(AOE), "Start")]
	internal static class DoNotRenderAoeShit
	{
		private static void Postfix(AOE __instance)
		{
			if (!Plugin.LPMEnabled.Value)
			{
				return;
			}
			if (Plugin.LPMDisableRendering.Value)
			{
				Renderer[] componentsInChildren = ((Component)__instance).GetComponentsInChildren<Renderer>();
				Renderer[] array = componentsInChildren;
				foreach (Renderer val in array)
				{
					val.enabled = false;
				}
			}
			if (Plugin.LPMDisableParticles.Value)
			{
				ParticleSystem[] componentsInChildren2 = ((Component)__instance).GetComponentsInChildren<ParticleSystem>();
				ParticleSystem[] array2 = componentsInChildren2;
				foreach (ParticleSystem val2 in array2)
				{
					val2.Stop(true, (ParticleSystemStopBehavior)0);
				}
			}
		}
	}
	[HarmonyPatch(typeof(Tornado), "Start")]
	internal static class DoNotRenderNados
	{
		private static void Postfix(Tornado __instance)
		{
			if (!Plugin.LPMEnabled.Value)
			{
				return;
			}
			if (Plugin.LPMDisableRendering.Value)
			{
				Renderer[] componentsInChildren = ((Component)__instance).GetComponentsInChildren<Renderer>();
				Renderer[] array = componentsInChildren;
				foreach (Renderer val in array)
				{
					val.enabled = false;
				}
			}
			if (Plugin.LPMDisableParticles.Value)
			{
				ParticleSystem[] componentsInChildren2 = ((Component)__instance).GetComponentsInChildren<ParticleSystem>();
				ParticleSystem[] array2 = componentsInChildren2;
				foreach (ParticleSystem val2 in array2)
				{
					val2.Stop(true, (ParticleSystemStopBehavior)0);
				}
			}
		}
	}
	[HarmonyPatch(typeof(MobItem), "Awake")]
	internal static class DoNotRenderBots
	{
		private static void Postfix(MobItem __instance)
		{
			if (!Plugin.LPMEnabled.Value)
			{
				return;
			}
			if (Plugin.LPMDisableRendering.Value)
			{
				Renderer[] componentsInChildren = ((Component)__instance).GetComponentsInChildren<Renderer>();
				Renderer[] array = componentsInChildren;
				foreach (Renderer val in array)
				{
					val.enabled = false;
				}
			}
			if (Plugin.LPMDisableParticles.Value)
			{
				ParticleSystem[] componentsInChildren2 = ((Component)__instance).GetComponentsInChildren<ParticleSystem>();
				ParticleSystem[] array2 = componentsInChildren2;
				foreach (ParticleSystem val2 in array2)
				{
					val2.Stop(true, (ParticleSystemStopBehavior)0);
				}
			}
		}
	}
	[HarmonyPatch(typeof(TumbleWeed), "Start")]
	internal static class DoNotRenderTumbles
	{
		private static void Postfix(TumbleWeed __instance)
		{
			if (Plugin.LPMEnabled.Value)
			{
				Renderer[] componentsInChildren = ((Component)__instance).GetComponentsInChildren<Renderer>();
				Renderer[] array = componentsInChildren;
				foreach (Renderer val in array)
				{
					val.enabled = false;
				}
			}
		}
	}
	[HarmonyPatch(typeof(RemoveAfterSeconds), "Start")]
	internal static class DoNotRenderEruptions
	{
		private static void Postfix(RemoveAfterSeconds __instance)
		{
			if (!Plugin.LPMEnabled.Value)
			{
				return;
			}
			if (Plugin.LPMDisableRendering.Value)
			{
				Renderer[] componentsInChildren = ((Component)__instance).GetComponentsInChildren<Renderer>();
				Renderer[] array = componentsInChildren;
				foreach (Renderer val in array)
				{
					val.enabled = false;
				}
			}
			if (Plugin.LPMDisableParticles.Value)
			{
				ParticleSystem[] componentsInChildren2 = ((Component)__instance).GetComponentsInChildren<ParticleSystem>();
				ParticleSystem[] array2 = componentsInChildren2;
				foreach (ParticleSystem val2 in array2)
				{
					val2.Stop(true, (ParticleSystemStopBehavior)0);
				}
			}
		}
	}
	[BepInPlugin("dedicatedserverinator", "dedicated serverinator", "1.0.0")]
	public class Plugin : BaseUnityPlugin
	{
		internal enum RespawnStatueBehaviour
		{
			None = 1,
			WaitForPlayerUse,
			AutoTrigger
		}

		internal static ConfigEntry<bool> randomizeAscent;

		internal static ConfigEntry<int> maxAscent;

		internal static ConfigEntry<int> minAscent;

		internal static ConfigEntry<float> intermission;

		internal static ConfigEntry<float> autoCampfireDelay;

		internal static ConfigEntry<float> autoCampfireMinimumDistance;

		internal static ConfigEntry<float> maxPlayerMagnitude;

		internal static ConfigEntry<bool> autoCampfire;

		internal static ConfigEntry<bool> autoCampfireAdditionalRevive;

		internal static ConfigEntry<bool> alwaysChoosePreviousCampfire;

		internal static ConfigEntry<bool> autoCampfireTimerReset;

		internal static ConfigEntry<float> deathScreenDelay;

		internal static ConfigEntry<bool> instaRestart;

		internal static ConfigEntry<bool> enabled;

		internal static ConfigEntry<KeyCode> enableKeybind;

		internal static ConfigEntry<KeyCode> enableLPMKeybind;

		internal static ConfigEntry<bool> LPMEnabled;

		internal static ConfigEntry<bool> LPMDisableRendering;

		internal static ConfigEntry<bool> LPMDisableParticles;

		internal static ConfigEntry<KeyCode> enableKYSKeybind;

		internal static ConfigEntry<KeyCode> enableAllKeybind;

		internal static ConfigEntry<bool> KYSEnabled;

		internal static ConfigEntry<RespawnStatueBehaviour> behaviourChosen;

		internal static ConfigEntry<bool> clearHazardsAroundStatue;

		internal static ConfigEntry<float> clearHazardDistance;

		internal static ManualLogSource Log { get; private set; }

		private void Awake()
		{
			//IL_02f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f8: Expected O, but got Unknown
			randomizeAscent = ((BaseUnityPlugin)this).Config.Bind<bool>("Ascent", "Randomize Ascent", true, "If set to true the ascent will be randomized based on the minimun and maximum set, if false it will automatically choose the max chosen");
			maxAscent = ((BaseUnityPlugin)this).Config.Bind<int>("Ascent", "Max Ascent", 7, "The max ascent that can be chosen (Both min and max are inclusive)");
			minAscent = ((BaseUnityPlugin)this).Config.Bind<int>("Ascent", "Min Ascent", 0, "The minimum ascent that can be chosen (set to -1 for tenderfoot)");
			intermission = ((BaseUnityPlugin)this).Config.Bind<float>("Intermission", "Intermission", 30f, "How many seconds the game waits until starting another game");
			instaRestart = ((BaseUnityPlugin)this).Config.Bind<bool>("Intermission", "Instant restart", false, "(Currently not functional) If this is set to true a game will instantly be started when all players are dead or have beaten the game without returning to the airport first");
			enabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Enable", "Enabled", true, "If set to false nothing in the mod will run");
			enableAllKeybind = ((BaseUnityPlugin)this).Config.Bind<KeyCode>("Enable", "Enable/Disable All Bind", (KeyCode)93, (ConfigDescription)null);
			deathScreenDelay = ((BaseUnityPlugin)this).Config.Bind<float>("Intermission", "Death Screen Delay", 20f, "How many seconds the game waits until it sends you back to the airport after winning or losing");
			enableKeybind = ((BaseUnityPlugin)this).Config.Bind<KeyCode>("Enable", "Enable Keybind", (KeyCode)112, "Keybind to enable and disable");
			autoCampfire = ((BaseUnityPlugin)this).Config.Bind<bool>("Auto Campfire", "Enable", false, "If set to true the campfire will auto start after the set delay when all players are within the minimum distance");
			autoCampfireDelay = ((BaseUnityPlugin)this).Config.Bind<float>("Auto Campfire", "Auto Campfire Delay", 45f, "How long the campfire waits to auto light after all players are in within distance");
			autoCampfireMinimumDistance = ((BaseUnityPlugin)this).Config.Bind<float>("Auto Campfire", "Auto Campfire Distance", 35f, "How many meters within the campfires radius players have to be in");
			autoCampfireTimerReset = ((BaseUnityPlugin)this).Config.Bind<bool>("Auto Campfire", "Auto Campfire Timer Reset", false, "If set to true the auto campfire timer will stop and reset once a player leaves the radius, good for a large radius");
			enableLPMKeybind = ((BaseUnityPlugin)this).Config.Bind<KeyCode>("Low Power Mode", "Enable Keybind", (KeyCode)108, "Keybind to enable and disable low power mode");
			LPMEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Low Power Mode", "Enabled", false, "if false low power mode will not be active");
			LPMDisableParticles = ((BaseUnityPlugin)this).Config.Bind<bool>("Low Power Mode", "Disable Particles", true, "If set to true low power mode will disable most particles");
			LPMDisableRendering = ((BaseUnityPlugin)this).Config.Bind<bool>("Low Power Mode", "Disable Rendering", false, "If set to true low power mode will disable game object rendering");
			enableKYSKeybind = ((BaseUnityPlugin)this).Config.Bind<KeyCode>("Auto Self Kill", "Enable Keybind", (KeyCode)107, "Keybind for enabling autokill");
			KYSEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Auto Self Kill", "Enabled", false, "If enabled you will automatically die");
			behaviourChosen = ((BaseUnityPlugin)this).Config.Bind<RespawnStatueBehaviour>("Auto Campfire", "Respawn Statue Behaviour", RespawnStatueBehaviour.None, "Options: None, WaitForPlayerUse, and AutoTrigger");
			clearHazardsAroundStatue = ((BaseUnityPlugin)this).Config.Bind<bool>("Auto Campfire", "Clear Hazards Around Statue When Popped", false, "Clears all hazards around the statue when its popped, this is mainly useful if you have a chaos mod and want players to have a better chance at escaping the statue.");
			clearHazardDistance = ((BaseUnityPlugin)this).Config.Bind<float>("Auto Campfire", "Hazard Clear Distance", 25f, (ConfigDescription)null);
			Log = ((BaseUnityPlugin)this).Logger;
			Log.LogInfo((object)"Plugin dedicated serverinator is loaded!");
			Harmony val = new Harmony("dsi");
			val.PatchAll();
		}
	}
}
namespace System.Runtime.CompilerServices
{
	[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
	internal sealed class IgnoresAccessChecksToAttribute : Attribute
	{
		public IgnoresAccessChecksToAttribute(string assemblyName)
		{
		}
	}
}