Decompiled source of MoonExteriorOverhauls v0.1.0

OutsideStructures.dll

Decompiled a day ago
using System;
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 BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using GameNetcodeStuff;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using OutsideStructures.Modules;
using OutsideStructures.NetcodePatcher;
using TMPro;
using Unity.Netcode;
using UnityEngine;
using UnityEngine.SceneManagement;
using UnityEngine.Video;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyCompany("UnloadedHangar")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyDescription("Adds billboards to several moons")]
[assembly: AssemblyFileVersion("1.3.6.0")]
[assembly: AssemblyInformationalVersion("1.0.7+75e95b7d38c16d78266d6b3452ddfb59cc4fbbc1")]
[assembly: AssemblyProduct("OutsideStructures")]
[assembly: AssemblyTitle("OutsideStructures")]
[assembly: AssemblyCopyright("Copyright ©  2024")]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.3.6.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
[module: NetcodePatchedAssembly]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[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 OutsideStructures
{
	internal class AutoAssignToMoonScene : NetworkBehaviour
	{
		private List<GameObject> rootObjects = new List<GameObject>();

		[SerializeField]
		private string sceneName;

		private bool forceDisable = true;

		private void Start()
		{
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			if (forceDisable)
			{
				Scene sceneByName = SceneManager.GetSceneByName(sceneName);
				((Scene)(ref sceneByName)).GetRootGameObjects(rootObjects);
				((Component)this).gameObject.transform.SetParent(rootObjects.Find((GameObject x) => ((Object)x).name == "Environment").transform);
			}
		}

		public override void OnNetworkSpawn()
		{
			((NetworkBehaviour)this).OnNetworkSpawn();
			((Component)this).gameObject.GetComponent<NetworkObject>().Spawn(false);
		}

		protected override void __initializeVariables()
		{
			((NetworkBehaviour)this).__initializeVariables();
		}

		protected override void __initializeRpcs()
		{
			((NetworkBehaviour)this).__initializeRpcs();
		}

		protected internal override string __getTypeName()
		{
			return "AutoAssignToMoonScene";
		}
	}
	internal class AutoSpawn : MonoBehaviour
	{
		[SerializeField]
		private GameObject objectToSpawn;

		private void Start()
		{
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			if (NetworkManager.Singleton.IsServer)
			{
				GameObject val = Object.Instantiate<GameObject>(objectToSpawn, ((Component)this).gameObject.transform.position, objectToSpawn.transform.rotation, (Transform)null);
				val.GetComponent<NetworkObject>().Spawn(true);
			}
		}
	}
	public class BrokenShipLights : NetworkBehaviour
	{
		public Animator lightsAnimator;

		public bool hasAnimated = false;

		public void AnimateLights()
		{
			if (!hasAnimated)
			{
				lightsAnimator.SetBool("hasInteracted", true);
			}
		}

		protected override void __initializeVariables()
		{
			((NetworkBehaviour)this).__initializeVariables();
		}

		protected override void __initializeRpcs()
		{
			((NetworkBehaviour)this).__initializeRpcs();
		}

		protected internal override string __getTypeName()
		{
			return "BrokenShipLights";
		}
	}
	[HarmonyPatch]
	internal class DebugShipSpawn
	{
		[HarmonyPostfix]
		[HarmonyPatch(typeof(RoundManager), "SpawnScrapInLevel")]
		private static void DebugSpawn()
		{
			Object.Instantiate<GameObject>(Content.AssetsList[1]);
		}

		private static void AssignTransform(Transform transformToAssign, Transform targetLocation)
		{
			transformToAssign.parent = targetLocation;
		}
	}
	public class CameraMonitor : NetworkBehaviour
	{
		public MeshRenderer mesh;

		public Material offScreenMat;

		public Material onScreenMat;

		public Animator mapCameraAnimator;

		public Light screenLight;

		public InteractTrigger button;

		public static bool isOn;

		private Material[] sharedMaterials;

		public VideoPlayer player;

		private void Start()
		{
			sharedMaterials = ((Renderer)mesh).sharedMaterials;
			sharedMaterials[1] = offScreenMat;
			sharedMaterials[2] = offScreenMat;
			((Renderer)mesh).sharedMaterials = sharedMaterials;
			((Behaviour)screenLight).enabled = false;
		}

		public void SwitchScreenOn()
		{
			if (!isOn)
			{
				sharedMaterials[1] = onScreenMat;
				((Behaviour)screenLight).enabled = true;
				button.interactable = false;
				isOn = true;
				player.Play();
			}
			((Renderer)mesh).sharedMaterials = sharedMaterials;
		}

		protected override void __initializeVariables()
		{
			((NetworkBehaviour)this).__initializeVariables();
		}

		protected override void __initializeRpcs()
		{
			((NetworkBehaviour)this).__initializeRpcs();
		}

		protected internal override string __getTypeName()
		{
			return "CameraMonitor";
		}
	}
	internal class ConfigManager
	{
		public ExtendedConfigEntry<bool> EnableConfiguration;

		public ExtendedConfigEntry<bool> DebugLogging;

		public ExtendedConfigEntry<bool> OffenseOverhaulEnabled;

		public ConfigManager()
		{
			BindConfigs();
			ClearUnusedEntries();
		}

		private void BindConfigs()
		{
			EnableConfiguration = new ExtendedConfigEntry<bool>("General Settings", "EnableConfiguration", defaultValue: false, "Enable if you want to use custom set config setting values. If disabled, the default config setting values will be used.");
			DebugLogging = new ExtendedConfigEntry<bool>("General Settings", "DebugLogging", defaultValue: false, "Enable if you want Debug logging to function.", useEnableConfiguration: true);
			OffenseOverhaulEnabled = new ExtendedConfigEntry<bool>("General Settings", "OffenseOverhaulEnabled", defaultValue: true, "Enable Offense overhaul.(Config entry currently NOT bound!)", useEnableConfiguration: true);
		}

		private void ClearUnusedEntries()
		{
			ConfigFile config = ((BaseUnityPlugin)Plugin.Instance).Config;
			PropertyInfo property = ((object)config).GetType().GetProperty("OrphanedEntries", BindingFlags.Instance | BindingFlags.NonPublic);
			Dictionary<ConfigDefinition, string> dictionary = (Dictionary<ConfigDefinition, string>)property.GetValue(config, null);
			dictionary.Clear();
			config.Save();
		}
	}
	internal class Content
	{
		public enum ContentObject
		{
			AssObject,
			OffObject
		}

		public static List<GameObject> AssetsList = new List<GameObject>();

		public static List<GameObject> OtherAssetsList = new List<GameObject>();

		public static void Load()
		{
			LoadAssetsFromAssetBundle();
		}

		private static void LoadAssetsFromAssetBundle()
		{
			try
			{
				string directoryName = Path.GetDirectoryName(((BaseUnityPlugin)Plugin.Instance).Info.Location);
				string text = Path.Combine(directoryName, "ousidestructures");
				AssetBundle val = AssetBundle.LoadFromFile(text);
				AssetsList.Add(val.LoadAsset<GameObject>("AssOutsideObjects"));
				AssetsList.Add(val.LoadAsset<GameObject>("OffOutsideObjects"));
				AssetsList.Add(val.LoadAsset<GameObject>("PowerCellItem"));
				AssetsList.Add(val.LoadAsset<GameObject>("MasterNet"));
				OtherAssetsList = val.LoadAllAssets<GameObject>().ToList();
				Plugin.logger.LogInfo((object)"Successfully loaded assets from AssetBundle!");
				Patches.AddPrefabToInject(AssetsList[1]);
				Patches.AddPrefabToInject(AssetsList[2]);
				Patches.AddPrefabToInject(AssetsList[3]);
			}
			catch (Exception arg)
			{
				Plugin.logger.LogError((object)$"Error: failed to load assets from AssetBundle.\n\n{arg}");
			}
		}
	}
	public class DoorPanelHitDetector : MonoBehaviour, IShockableWithGun, IHittable
	{
		private bool wasExecuted = false;

		[SerializeField]
		private NetworkObject shockNetObject;

		public bool CanBeShocked()
		{
			if (ShipDoor.instance.hasFailed)
			{
				return true;
			}
			return false;
		}

		public float GetDifficultyMultiplier()
		{
			return 1f;
		}

		public NetworkObject GetNetworkObject()
		{
			return shockNetObject;
		}

		public Vector3 GetShockablePosition()
		{
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			return ((Component)this).gameObject.transform.position;
		}

		public Transform GetShockableTransform()
		{
			return ((Component)this).gameObject.transform;
		}

		public void ShockWithGun(PlayerControllerB shockedByPlayer)
		{
			if (!wasExecuted)
			{
				ShipDoor.instance.ForcePlayDoorAnimationOpen();
				wasExecuted = true;
			}
		}

		public void StopShockingWithGun()
		{
			if (Plugin.ConfigManager.DebugLogging.Value)
			{
				Debug.LogWarning((object)"DoorShocking stopped...");
			}
		}

		public bool Hit(int force, Vector3 hitDirection, PlayerControllerB playerWhoHit = null, bool playHitSFX = false, int hitID = -1)
		{
			if (hitID == 5)
			{
				if (Plugin.ConfigManager.DebugLogging.Value)
				{
					Plugin.logger.LogWarning((object)"Hit action has id value 5, this is not allowed... Ignoring performed hit action!");
				}
				return false;
			}
			ShipDoor.isFailure = true;
			ShipDoor.instance.hasFailed = true;
			Debug.LogWarning((object)hitID);
			return true;
		}
	}
	public class ExtendedConfigEntry<T>
	{
		public ConfigEntry<T> ConfigEntry;

		public Func<T> GetValue;

		public Action<T> SetValue;

		public bool UseEnableConfiguration = false;

		public T DefaultValue => (T)((ConfigEntryBase)ConfigEntry).DefaultValue;

		public T Value
		{
			get
			{
				return GetValue();
			}
			set
			{
				SetValue(value);
			}
		}

		public ExtendedConfigEntry(string section, string key, T defaultValue, string description, bool useEnableConfiguration = false)
		{
			ConfigEntry = ((BaseUnityPlugin)Plugin.Instance).Config.Bind<T>(section, key, defaultValue, description);
			UseEnableConfiguration = useEnableConfiguration;
			Initialize();
		}

		public ExtendedConfigEntry(string section, string key, T defaultValue, ConfigDescription configDescription = null, bool useEnableConfiguration = false)
		{
			ConfigEntry = ((BaseUnityPlugin)Plugin.Instance).Config.Bind<T>(section, key, defaultValue, configDescription);
			UseEnableConfiguration = useEnableConfiguration;
			Initialize();
		}

		private void Initialize()
		{
			if (GetValue == null)
			{
				GetValue = () => (UseEnableConfiguration && !Plugin.ConfigManager.EnableConfiguration.Value) ? DefaultValue : ConfigEntry.Value;
			}
			if (SetValue == null)
			{
				SetValue = delegate(T value)
				{
					ConfigEntry.Value = value;
				};
			}
		}

		public void ResetToDefault()
		{
			ConfigEntry.Value = (T)((ConfigEntryBase)ConfigEntry).DefaultValue;
		}
	}
	[BepInPlugin("OutsideStructures-UnloadedHangar", "OutsideStructures", "0.2.1")]
	public class Plugin : BaseUnityPlugin
	{
		public static class PluginInfo
		{
			public const string Guid = "OutsideStructures-UnloadedHangar";

			public const string Name = "OutsideStructures";

			public const string Ver = "0.2.1";
		}

		internal static Plugin Instance;

		internal static ManualLogSource logger;

		internal static ConfigManager ConfigManager;

		internal Harmony _harmony;

		private void Awake()
		{
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Expected O, but got Unknown
			if ((Object)(object)Instance == (Object)null)
			{
				Instance = this;
			}
			logger = Logger.CreateLogSource("OutsideStructures");
			logger.LogInfo((object)"OutsideStructures has awoken!");
			ConfigManager = new ConfigManager();
			Content.Load();
			NetcodePatcherAwake();
			_harmony = new Harmony("OutsideStructures-UnloadedHangar");
			_harmony.PatchAll(typeof(Patches));
		}

		private void NetcodePatcherAwake()
		{
			Type[] types = Assembly.GetExecutingAssembly().GetTypes();
			Type[] array = types;
			Type[] array2 = array;
			foreach (Type type in array2)
			{
				MethodInfo[] methods = type.GetMethods(BindingFlags.Instance | BindingFlags.Static | BindingFlags.NonPublic);
				MethodInfo[] array3 = methods;
				MethodInfo[] array4 = array3;
				foreach (MethodInfo methodInfo in array4)
				{
					object[] customAttributes = methodInfo.GetCustomAttributes(typeof(RuntimeInitializeOnLoadMethodAttribute), inherit: false);
					if (customAttributes.Length != 0)
					{
						methodInfo.Invoke(null, null);
					}
				}
			}
		}
	}
	public class ShipDoor : NetworkBehaviour
	{
		public GameObject hydraulicsDisplay;

		public Animator shipDoorsAnimator;

		public bool buttonsEnabled = true;

		public InteractTrigger triggerScript;

		public TextMeshProUGUI doorPowerDisplay;

		private bool hydraulicsScreenDisplayed = true;

		internal static bool isFailure;

		internal bool hasFailed = false;

		private static float time;

		private protected bool wasExecuted = false;

		internal static ShipDoor instance { get; private set; }

		private void Awake()
		{
			if ((Object)(object)instance == (Object)null)
			{
				instance = this;
			}
		}

		private void SetScreenDisplay()
		{
			bool flag = true;
			if (hydraulicsScreenDisplayed != flag)
			{
				hydraulicsScreenDisplayed = flag;
				hydraulicsDisplay.SetActive(flag);
			}
		}

		public void PlayDoorAnimationClose()
		{
			if (buttonsEnabled)
			{
				shipDoorsAnimator.SetBool("Closed", true);
				if (isFailure)
				{
					buttonsEnabled = false;
				}
			}
		}

		private void Start()
		{
			hydraulicsScreenDisplayed = false;
			SetScreenDisplay();
			PlayDoorAnimationOpen();
		}

		private void Update()
		{
			if (hasFailed)
			{
				UpdateScreen();
			}
		}

		private void UpdateScreen()
		{
			time = (time + Time.deltaTime) % 2f;
			((TMP_Text)doorPowerDisplay).text = ((time > 1f) ? "ERROR" : "") ?? "";
		}

		public void PlayDoorAnimationOpen()
		{
			if (buttonsEnabled)
			{
				shipDoorsAnimator.SetBool("Closed", false);
			}
		}

		internal void ForcePlayDoorAnimationOpen()
		{
			if (!wasExecuted)
			{
				shipDoorsAnimator.SetBool("Closed", false);
				wasExecuted = true;
			}
		}

		private void Reset()
		{
			buttonsEnabled = true;
			hydraulicsScreenDisplayed = true;
			isFailure = false;
			hasFailed = false;
			wasExecuted = false;
		}

		public override void OnNetworkSpawn()
		{
			Debug.LogWarning((object)"NetworkSpawn");
		}

		protected override void __initializeVariables()
		{
			((NetworkBehaviour)this).__initializeVariables();
		}

		protected override void __initializeRpcs()
		{
			((NetworkBehaviour)this).__initializeRpcs();
		}

		protected internal override string __getTypeName()
		{
			return "ShipDoor";
		}
	}
	public class ShipLever : NetworkBehaviour
	{
		public InteractTrigger triggerScript;

		public Animator leverAnimatorObject;

		public GameObject thrusterBackLeft;

		public GameObject thrusterBackRight;

		public GameObject thrusterFrontLeft;

		public GameObject thrusterFrontRight;

		public AudioClip shipLeave;

		public AudioSource shipLeaveAudioSource;

		private void Start()
		{
			leverAnimatorObject.SetBool("pullLever", true);
		}

		public void PullLever()
		{
			((MonoBehaviour)this).Invoke("PlaySound", 0.2f);
			((MonoBehaviour)this).Invoke("Explode", 3f);
			ServerRpc();
		}

		public void PullLeverAnim()
		{
			leverAnimatorObject.SetBool("pullLever", false);
			triggerScript.interactable = false;
		}

		private void PlaySound()
		{
			shipLeaveAudioSource.PlayOneShot(shipLeave);
		}

		private void Explode()
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			Landmine.SpawnExplosion(((Component)this).transform.position + Vector3.up, true, 5.7f, 6f, 50, 0f, (GameObject)null, false);
			shipLeaveAudioSource.Stop();
		}

		[ServerRpc(RequireOwnership = false)]
		private void ServerRpc()
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: 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_007c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
				{
					ServerRpcParams val2 = default(ServerRpcParams);
					FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(3504851772u, val2, (RpcDelivery)0);
					((NetworkBehaviour)this).__endSendServerRpc(ref val, 3504851772u, val2, (RpcDelivery)0);
				}
				if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
				{
					base.__rpc_exec_stage = (__RpcExecStage)0;
					ClientRpc();
				}
			}
		}

		[ClientRpc]
		private void ClientRpc()
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: 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_007c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost))
				{
					ClientRpcParams val2 = default(ClientRpcParams);
					FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(3532718815u, val2, (RpcDelivery)0);
					((NetworkBehaviour)this).__endSendClientRpc(ref val, 3532718815u, val2, (RpcDelivery)0);
				}
				if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost))
				{
					base.__rpc_exec_stage = (__RpcExecStage)0;
					Plugin.logger.LogError((object)"RPC!");
				}
			}
		}

		protected override void __initializeVariables()
		{
			((NetworkBehaviour)this).__initializeVariables();
		}

		protected override void __initializeRpcs()
		{
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Expected O, but got Unknown
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Expected O, but got Unknown
			((NetworkBehaviour)this).__registerRpc(3504851772u, new RpcReceiveHandler(__rpc_handler_3504851772), "ServerRpc");
			((NetworkBehaviour)this).__registerRpc(3532718815u, new RpcReceiveHandler(__rpc_handler_3532718815), "ClientRpc");
			((NetworkBehaviour)this).__initializeRpcs();
		}

		private static void __rpc_handler_3504851772(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((ShipLever)(object)target).ServerRpc();
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_3532718815(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((ShipLever)(object)target).ClientRpc();
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		protected internal override string __getTypeName()
		{
			return "ShipLever";
		}
	}
	public class Net : NetworkBehaviour
	{
		[SerializeField]
		internal NetworkObject MasterNetworkObject;

		[SerializeField]
		private NetworkObject[] ChildNetworkObjects;

		private static GameObject thisObject;

		internal NetworkVariable<bool> powerCellPresent = new NetworkVariable<bool>(false, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0);

		internal static Net Instance { get; private set; }

		internal static void Init()
		{
			if ((Object)(object)thisObject == (Object)null && (Object)(object)Instance == (Object)null)
			{
				thisObject = Object.Instantiate<GameObject>(Content.AssetsList[3]);
			}
		}

		private void Awake()
		{
			if ((Object)(object)Instance == (Object)null)
			{
				Instance = this;
			}
		}

		private void Start()
		{
			if ((Object)(object)MasterNetworkObject == (Object)null)
			{
				MasterNetworkObject = ((Component)this).gameObject.GetComponent<NetworkObject>();
			}
			if (!MasterNetworkObject.IsSpawned)
			{
				MasterNetworkObject.Spawn(true);
			}
		}

		[ServerRpc]
		public void SpawnNetServerRpc()
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dc: Invalid comparison between Unknown and I4
			//IL_0107: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0084: Invalid comparison between Unknown and I4
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
			{
				if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId)
				{
					if ((int)networkManager.LogLevel <= 1)
					{
						Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!");
					}
					return;
				}
				ServerRpcParams val2 = default(ServerRpcParams);
				FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(2550295227u, val2, (RpcDelivery)0);
				((NetworkBehaviour)this).__endSendServerRpc(ref val, 2550295227u, val2, (RpcDelivery)0);
			}
			if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
			{
				base.__rpc_exec_stage = (__RpcExecStage)0;
				SpawnNetClientRpc();
			}
		}

		[ClientRpc]
		public void SpawnNetClientRpc()
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: 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_007c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost))
			{
				ClientRpcParams val2 = default(ClientRpcParams);
				FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(4266929466u, val2, (RpcDelivery)0);
				((NetworkBehaviour)this).__endSendClientRpc(ref val, 4266929466u, val2, (RpcDelivery)0);
			}
			if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost))
			{
				base.__rpc_exec_stage = (__RpcExecStage)0;
				if (!((Component)((Component)OutsideHydraulicDoor.Instance).gameObject.transform.root).gameObject.GetComponent<NetworkObject>().IsSpawned)
				{
					((Component)((Component)OutsideHydraulicDoor.Instance).gameObject.transform.root).gameObject.GetComponent<NetworkObject>().Spawn(false);
				}
			}
		}

		public void CallRpc()
		{
			Instance.PullFaultyLeverServerRpc();
		}

		[ServerRpc(RequireOwnership = false)]
		public void PullFaultyLeverServerRpc()
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: 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_007c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
				{
					ServerRpcParams val2 = default(ServerRpcParams);
					FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(3444239795u, val2, (RpcDelivery)0);
					((NetworkBehaviour)this).__endSendServerRpc(ref val, 3444239795u, val2, (RpcDelivery)0);
				}
				if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
				{
					base.__rpc_exec_stage = (__RpcExecStage)0;
					PullFaultyLeverClientRpc();
				}
			}
		}

		[ClientRpc]
		public void PullFaultyLeverClientRpc()
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: 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_007c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost))
				{
					ClientRpcParams val2 = default(ClientRpcParams);
					FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(1751046363u, val2, (RpcDelivery)0);
					((NetworkBehaviour)this).__endSendClientRpc(ref val, 1751046363u, val2, (RpcDelivery)0);
				}
				if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost))
				{
					base.__rpc_exec_stage = (__RpcExecStage)0;
					RpcEnd();
				}
			}
		}

		public void RpcEnd()
		{
			Plugin.logger.LogWarning((object)"RPC called");
		}

		[ServerRpc(RequireOwnership = false)]
		public void ToggleOutsideDoorServerRpc(bool value)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: 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_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_0097: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dc: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
				{
					ServerRpcParams val2 = default(ServerRpcParams);
					FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(1616977787u, val2, (RpcDelivery)0);
					((FastBufferWriter)(ref val)).WriteValueSafe<bool>(ref value, default(ForPrimitives));
					((NetworkBehaviour)this).__endSendServerRpc(ref val, 1616977787u, val2, (RpcDelivery)0);
				}
				if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
				{
					base.__rpc_exec_stage = (__RpcExecStage)0;
					ToggleOutsideDoorClientRpc(value);
				}
			}
		}

		[ClientRpc]
		public void ToggleOutsideDoorClientRpc(bool value)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: 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_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_0097: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dc: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost))
				{
					ClientRpcParams val2 = default(ClientRpcParams);
					FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(295008571u, val2, (RpcDelivery)0);
					((FastBufferWriter)(ref val)).WriteValueSafe<bool>(ref value, default(ForPrimitives));
					((NetworkBehaviour)this).__endSendClientRpc(ref val, 295008571u, val2, (RpcDelivery)0);
				}
				if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost))
				{
					base.__rpc_exec_stage = (__RpcExecStage)0;
					OutsideHydraulicDoor.Instance.ToggleDoor(value);
				}
			}
		}

		[ServerRpc]
		public void SpawnObjectServerRpc(int value)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00df: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e9: Invalid comparison between Unknown and I4
			//IL_0114: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0084: Invalid comparison between Unknown and I4
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
			{
				if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId)
				{
					if ((int)networkManager.LogLevel <= 1)
					{
						Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!");
					}
					return;
				}
				ServerRpcParams val2 = default(ServerRpcParams);
				FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(730224723u, val2, (RpcDelivery)0);
				BytePacker.WriteValueBitPacked(val, value);
				((NetworkBehaviour)this).__endSendServerRpc(ref val, 730224723u, val2, (RpcDelivery)0);
			}
			if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
			{
				base.__rpc_exec_stage = (__RpcExecStage)0;
				SpawnObjectClientRpc(value);
			}
		}

		[ClientRpc]
		public void SpawnObjectClientRpc(int value)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_0099: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a3: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: 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_0071: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost))
				{
					ClientRpcParams val2 = default(ClientRpcParams);
					FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(2649449261u, val2, (RpcDelivery)0);
					BytePacker.WriteValueBitPacked(val, value);
					((NetworkBehaviour)this).__endSendClientRpc(ref val, 2649449261u, val2, (RpcDelivery)0);
				}
				if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost))
				{
					base.__rpc_exec_stage = (__RpcExecStage)0;
					Object.Instantiate<GameObject>(Content.AssetsList[value]);
				}
			}
		}

		[ServerRpc]
		public void SpawnOffenseObjectServerRpc(int value)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00df: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e9: Invalid comparison between Unknown and I4
			//IL_0114: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0084: Invalid comparison between Unknown and I4
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
			{
				if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId)
				{
					if ((int)networkManager.LogLevel <= 1)
					{
						Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!");
					}
					return;
				}
				ServerRpcParams val2 = default(ServerRpcParams);
				FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(793144460u, val2, (RpcDelivery)0);
				BytePacker.WriteValueBitPacked(val, value);
				((NetworkBehaviour)this).__endSendServerRpc(ref val, 793144460u, val2, (RpcDelivery)0);
			}
			if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
			{
				base.__rpc_exec_stage = (__RpcExecStage)0;
				SpawnOffenseObjectClientRpc(value);
			}
		}

		[ClientRpc]
		public void SpawnOffenseObjectClientRpc(int value)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_0099: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a3: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: 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_0071: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost))
			{
				ClientRpcParams val2 = default(ClientRpcParams);
				FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(2632541950u, val2, (RpcDelivery)0);
				BytePacker.WriteValueBitPacked(val, value);
				((NetworkBehaviour)this).__endSendClientRpc(ref val, 2632541950u, val2, (RpcDelivery)0);
			}
			if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost))
			{
				base.__rpc_exec_stage = (__RpcExecStage)0;
				if (Object.FindObjectsOfType(typeof(PowerCellBox)).Length < 1)
				{
					Object.Instantiate<GameObject>(Content.AssetsList[value]);
				}
				else if (Object.FindObjectsOfType(typeof(PowerCellBox)).Length >= 1)
				{
					Plugin.logger.LogError((object)"SpawnDenied!");
				}
			}
		}

		[ServerRpc(RequireOwnership = false)]
		public void PowerCellUpdateServerRpc(bool value)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: 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_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_0097: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dc: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
			{
				ServerRpcParams val2 = default(ServerRpcParams);
				FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(3486039154u, val2, (RpcDelivery)0);
				((FastBufferWriter)(ref val)).WriteValueSafe<bool>(ref value, default(ForPrimitives));
				((NetworkBehaviour)this).__endSendServerRpc(ref val, 3486039154u, val2, (RpcDelivery)0);
			}
			if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
			{
				base.__rpc_exec_stage = (__RpcExecStage)0;
				if (NetworkManager.Singleton.IsServer)
				{
					powerCellPresent.Value = value;
				}
			}
		}

		[ServerRpc(RequireOwnership = false)]
		public void OnInteractRelayServerRpc()
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: 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_007c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
			{
				ServerRpcParams val2 = default(ServerRpcParams);
				FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(2290570923u, val2, (RpcDelivery)0);
				((NetworkBehaviour)this).__endSendServerRpc(ref val, 2290570923u, val2, (RpcDelivery)0);
			}
			if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
			{
				base.__rpc_exec_stage = (__RpcExecStage)0;
				if (NetworkManager.Singleton.IsServer)
				{
					PowerCellBox.Instance.Relay();
				}
				OnInteractRelayClientRpc();
			}
		}

		[ClientRpc]
		public void OnInteractRelayClientRpc()
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: 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_007c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost))
				{
					ClientRpcParams val2 = default(ClientRpcParams);
					FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(908049351u, val2, (RpcDelivery)0);
					((NetworkBehaviour)this).__endSendClientRpc(ref val, 908049351u, val2, (RpcDelivery)0);
				}
				if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost))
				{
					base.__rpc_exec_stage = (__RpcExecStage)0;
					PowerCellBox.Instance.Relay();
				}
			}
		}

		protected override void __initializeVariables()
		{
			if (powerCellPresent == null)
			{
				throw new Exception("Net.powerCellPresent cannot be null. All NetworkVariableBase instances must be initialized.");
			}
			((NetworkVariableBase)powerCellPresent).Initialize((NetworkBehaviour)(object)this);
			((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)powerCellPresent, "powerCellPresent");
			base.NetworkVariableFields.Add((NetworkVariableBase)(object)powerCellPresent);
			((NetworkBehaviour)this).__initializeVariables();
		}

		protected override void __initializeRpcs()
		{
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Expected O, but got Unknown
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Expected O, but got Unknown
			//IL_0045: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: Expected O, but got Unknown
			//IL_0061: 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_008c: Expected O, but got Unknown
			//IL_0099: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a8: Expected O, but got Unknown
			//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c4: Expected O, but got Unknown
			//IL_00d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e0: Expected O, but got Unknown
			//IL_00ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fc: Expected O, but got Unknown
			//IL_0109: Unknown result type (might be due to invalid IL or missing references)
			//IL_0118: Expected O, but got Unknown
			//IL_0125: Unknown result type (might be due to invalid IL or missing references)
			//IL_0134: Expected O, but got Unknown
			//IL_0141: Unknown result type (might be due to invalid IL or missing references)
			//IL_0150: Expected O, but got Unknown
			//IL_015d: Unknown result type (might be due to invalid IL or missing references)
			//IL_016c: Expected O, but got Unknown
			((NetworkBehaviour)this).__registerRpc(2550295227u, new RpcReceiveHandler(__rpc_handler_2550295227), "SpawnNetServerRpc");
			((NetworkBehaviour)this).__registerRpc(4266929466u, new RpcReceiveHandler(__rpc_handler_4266929466), "SpawnNetClientRpc");
			((NetworkBehaviour)this).__registerRpc(3444239795u, new RpcReceiveHandler(__rpc_handler_3444239795), "PullFaultyLeverServerRpc");
			((NetworkBehaviour)this).__registerRpc(1751046363u, new RpcReceiveHandler(__rpc_handler_1751046363), "PullFaultyLeverClientRpc");
			((NetworkBehaviour)this).__registerRpc(1616977787u, new RpcReceiveHandler(__rpc_handler_1616977787), "ToggleOutsideDoorServerRpc");
			((NetworkBehaviour)this).__registerRpc(295008571u, new RpcReceiveHandler(__rpc_handler_295008571), "ToggleOutsideDoorClientRpc");
			((NetworkBehaviour)this).__registerRpc(730224723u, new RpcReceiveHandler(__rpc_handler_730224723), "SpawnObjectServerRpc");
			((NetworkBehaviour)this).__registerRpc(2649449261u, new RpcReceiveHandler(__rpc_handler_2649449261), "SpawnObjectClientRpc");
			((NetworkBehaviour)this).__registerRpc(793144460u, new RpcReceiveHandler(__rpc_handler_793144460), "SpawnOffenseObjectServerRpc");
			((NetworkBehaviour)this).__registerRpc(2632541950u, new RpcReceiveHandler(__rpc_handler_2632541950), "SpawnOffenseObjectClientRpc");
			((NetworkBehaviour)this).__registerRpc(3486039154u, new RpcReceiveHandler(__rpc_handler_3486039154), "PowerCellUpdateServerRpc");
			((NetworkBehaviour)this).__registerRpc(2290570923u, new RpcReceiveHandler(__rpc_handler_2290570923), "OnInteractRelayServerRpc");
			((NetworkBehaviour)this).__registerRpc(908049351u, new RpcReceiveHandler(__rpc_handler_908049351), "OnInteractRelayClientRpc");
			((NetworkBehaviour)this).__initializeRpcs();
		}

		private static void __rpc_handler_2550295227(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_0023: 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)
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_0076: Unknown result type (might be due to invalid IL or missing references)
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: Invalid comparison between Unknown and I4
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId)
			{
				if ((int)networkManager.LogLevel <= 1)
				{
					Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!");
				}
			}
			else
			{
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((Net)(object)target).SpawnNetServerRpc();
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_4266929466(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((Net)(object)target).SpawnNetClientRpc();
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_3444239795(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((Net)(object)target).PullFaultyLeverServerRpc();
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_1751046363(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((Net)(object)target).PullFaultyLeverClientRpc();
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_1616977787(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_002f: 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_0044: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				bool value = default(bool);
				((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref value, default(ForPrimitives));
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((Net)(object)target).ToggleOutsideDoorServerRpc(value);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_295008571(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_002f: 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_0044: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				bool value = default(bool);
				((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref value, default(ForPrimitives));
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((Net)(object)target).ToggleOutsideDoorClientRpc(value);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_730224723(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_0023: 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)
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_0070: Unknown result type (might be due to invalid IL or missing references)
			//IL_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_009d: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: Invalid comparison between Unknown and I4
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId)
			{
				if ((int)networkManager.LogLevel <= 1)
				{
					Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!");
				}
			}
			else
			{
				int value = default(int);
				ByteUnpacker.ReadValueBitPacked(reader, ref value);
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((Net)(object)target).SpawnObjectServerRpc(value);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_2649449261(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_0023: 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_0050: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				int value = default(int);
				ByteUnpacker.ReadValueBitPacked(reader, ref value);
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((Net)(object)target).SpawnObjectClientRpc(value);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_793144460(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_0023: 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)
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_0070: Unknown result type (might be due to invalid IL or missing references)
			//IL_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_009d: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: Invalid comparison between Unknown and I4
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId)
			{
				if ((int)networkManager.LogLevel <= 1)
				{
					Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!");
				}
			}
			else
			{
				int value = default(int);
				ByteUnpacker.ReadValueBitPacked(reader, ref value);
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((Net)(object)target).SpawnOffenseObjectServerRpc(value);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_2632541950(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_0023: 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_0050: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				int value = default(int);
				ByteUnpacker.ReadValueBitPacked(reader, ref value);
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((Net)(object)target).SpawnOffenseObjectClientRpc(value);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_3486039154(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_002f: 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_0044: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				bool value = default(bool);
				((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref value, default(ForPrimitives));
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((Net)(object)target).PowerCellUpdateServerRpc(value);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_2290570923(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((Net)(object)target).OnInteractRelayServerRpc();
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_908049351(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((Net)(object)target).OnInteractRelayClientRpc();
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		protected internal override string __getTypeName()
		{
			return "Net";
		}
	}
	public class OutsideHydraulicDoor : MonoBehaviour
	{
		[SerializeReference]
		internal Material LightOnMaterial;

		[SerializeReference]
		internal Material LightOffMaterial;

		[SerializeReference]
		internal AnimatedObjectTrigger objectTrigger;

		[SerializeReference]
		internal Light light1;

		[SerializeReference]
		internal Light light2;

		[SerializeReference]
		internal GameObject lightObject1;

		[SerializeReference]
		internal GameObject lightObject2;

		internal bool init = false;

		private bool isLightOn = false;

		private bool isDoorOpen = false;

		internal bool isPowercellPresent => Net.Instance.powerCellPresent.Value;

		internal static OutsideHydraulicDoor Instance { get; private set; }

		private void Awake()
		{
			if ((Object)(object)Instance == (Object)null)
			{
				Instance = this;
				init = true;
			}
			if ((Object)(object)objectTrigger == (Object)null)
			{
				objectTrigger = ((Component)this).gameObject.GetComponent<AnimatedObjectTrigger>();
			}
		}

		public void OnInteract(bool value)
		{
			Net.Instance.ToggleOutsideDoorServerRpc(value);
		}

		internal void ToggleDoor(bool value)
		{
			if (isPowercellPresent)
			{
				((Behaviour)light1).enabled = value;
				((Behaviour)light2).enabled = value;
				SetLightMaterial(value);
				objectTrigger.SetBoolOnClientOnly(value);
				isDoorOpen = value;
			}
		}

		internal void ShutDoorOnPowerLoss()
		{
			((Behaviour)light1).enabled = false;
			((Behaviour)light2).enabled = false;
			SetLightMaterial(value: false);
			objectTrigger.SetBoolOnClientOnly(false);
		}

		internal void OpenDoorOnPowerRestored()
		{
			if (isPowercellPresent && !objectTrigger.boolValue && isDoorOpen)
			{
				((Behaviour)light1).enabled = true;
				((Behaviour)light2).enabled = true;
				SetLightMaterial(value: true);
				objectTrigger.SetBoolOnClientOnly(true);
			}
		}

		private void SetLightMaterial(bool value)
		{
			if (value)
			{
				((Renderer)lightObject1.GetComponent<MeshRenderer>()).material = LightOnMaterial;
				((Renderer)lightObject2.GetComponent<MeshRenderer>()).material = LightOnMaterial;
				isLightOn = true;
			}
			else if (!value)
			{
				((Renderer)lightObject1.GetComponent<MeshRenderer>()).material = LightOffMaterial;
				((Renderer)lightObject2.GetComponent<MeshRenderer>()).material = LightOffMaterial;
				isLightOn = false;
			}
		}
	}
	public class PowerCellBox : MonoBehaviour
	{
		public OutsideHydraulicDoor controler;

		public PlaceableObjectsSurface objectsSurface;

		public Light breakerBoxLight;

		public MeshRenderer breakerBoxLightRenderer;

		public Material lightOnMaterial;

		public Material lightOffMaterial;

		public InteractTrigger doorLeverTrigger;

		internal static PowerCellBox Instance { get; private set; }

		private void Awake()
		{
			if ((Object)(object)Instance == (Object)null)
			{
				Instance = this;
			}
		}

		private void Start()
		{
		}

		public void OnInteract(PlayerControllerB playerController)
		{
			if (playerController.currentlyHeldObjectServer.itemProperties.itemName == "Power Cell" && !Net.Instance.powerCellPresent.Value)
			{
				objectsSurface.PlaceObject(playerController);
				Net.Instance.OnInteractRelayServerRpc();
			}
			else if (playerController.currentlyHeldObjectServer.itemProperties.itemName != "Power Cell")
			{
				((TMP_Text)HUDManager.Instance.globalNotificationText).text = "Incompatible object!";
				HUDManager.Instance.globalNotificationAnimator.SetTrigger("TriggerNotif");
				HUDManager.Instance.UIAudio.PlayOneShot(HUDManager.Instance.warningSFX[0], 1f);
			}
		}

		internal void Relay()
		{
			PowerOn();
			Net.Instance.PowerCellUpdateServerRpc(value: true);
			controler.OpenDoorOnPowerRestored();
		}

		private bool CheckIfPowerCellExists(bool booleanOverride = false)
		{
			if (booleanOverride)
			{
				return true;
			}
			try
			{
				OutsideHydraulicDoor outsideHydraulicDoor = controler;
				Transform val = ((outsideHydraulicDoor != null) ? ((Component)((Component)outsideHydraulicDoor).gameObject.transform.parent).gameObject.transform.Find("PowerCellItem(Clone)") : null);
				return Object.op_Implicit((Object)(object)((val != null) ? ((Component)val).gameObject : null));
			}
			catch (Exception ex)
			{
				Plugin.logger.LogError((object)ex);
			}
			return false;
		}

		private void Update()
		{
			if (!CheckIfPowerCellExists() && Net.Instance.powerCellPresent.Value)
			{
				PowerOff();
				Net.Instance.PowerCellUpdateServerRpc(value: false);
			}
			if (CheckIfPowerCellExists() && Net.Instance.powerCellPresent.Value && !doorLeverTrigger.interactable)
			{
				PowerOn();
			}
		}

		private void PowerOff()
		{
			Material[] materials = ((Renderer)breakerBoxLightRenderer).materials;
			materials[1] = lightOffMaterial;
			((Renderer)breakerBoxLightRenderer).SetMaterials(materials.ToList());
			((Behaviour)breakerBoxLight).enabled = false;
			doorLeverTrigger.interactable = false;
		}

		private void PowerOn()
		{
			Material[] materials = ((Renderer)breakerBoxLightRenderer).materials;
			materials[1] = lightOnMaterial;
			((Renderer)breakerBoxLightRenderer).SetMaterials(materials.ToList());
			((Behaviour)breakerBoxLight).enabled = true;
			doorLeverTrigger.interactable = true;
		}
	}
	public enum SpawnPlanet
	{
		Artifice,
		Assurance,
		CompanyBuilding,
		Experimentation,
		Offense,
		Titan,
		Vow,
		March,
		Adamance,
		Rend,
		Dine,
		Embrion
	}
	internal static class Utils
	{
		public static Dictionary<SpawnPlanet, string> PlanetDictionary = new Dictionary<SpawnPlanet, string>
		{
			{
				SpawnPlanet.Artifice,
				"ArtificeLevel (SelectableLevel)"
			},
			{
				SpawnPlanet.Assurance,
				"AssuranceLevel (SelectableLevel)"
			},
			{
				SpawnPlanet.CompanyBuilding,
				"CompanyBuildingLevel (SelectableLevel)"
			},
			{
				SpawnPlanet.Experimentation,
				"ExperimentationLevel (SelectableLevel)"
			},
			{
				SpawnPlanet.Offense,
				"OffenseLevel (SelectableLevel)"
			},
			{
				SpawnPlanet.Titan,
				"TitanLevel (SelectableLevel)"
			},
			{
				SpawnPlanet.Vow,
				"VowLevel (SelectableLevel)"
			},
			{
				SpawnPlanet.March,
				"MarchLevel (SelectableLevel)"
			},
			{
				SpawnPlanet.Adamance,
				"AdamanceLevel (SelectableLevel)"
			},
			{
				SpawnPlanet.Rend,
				"RendLevel (SelectableLevel)"
			},
			{
				SpawnPlanet.Dine,
				"DineLevel (SelectableLevel)"
			},
			{
				SpawnPlanet.Embrion,
				"EmbrionLevel (SelectableLevel)"
			}
		};

		internal static string GetCurrentLevel()
		{
			return ((object)RoundManager.Instance.currentLevel).ToString();
		}
	}
}
namespace OutsideStructures.Modules
{
	[HarmonyPatch]
	internal class Patches
	{
		internal static List<GameObject> Prefabs = new List<GameObject>();

		[HarmonyPostfix]
		[HarmonyPatch(typeof(TimeOfDay), "Start")]
		private static void SpawnNet()
		{
			Net.Init();
		}

		[HarmonyPostfix]
		[HarmonyPatch(typeof(Terminal), "Start")]
		private static void SpawnContainer()
		{
			PlanetInfoContainer.Init();
		}

		[HarmonyPostfix]
		[HarmonyPatch(typeof(RoundManager), "GeneratedFloorPostProcessing")]
		private static void OnGameStart()
		{
			if (NetworkManager.Singleton.IsServer && Utils.GetCurrentLevel() == Utils.PlanetDictionary[SpawnPlanet.Offense] && Plugin.ConfigManager.OffenseOverhaulEnabled.Value && (Object)(object)OutsideHydraulicDoor.Instance == (Object)null)
			{
				GameObject val = Object.Instantiate<GameObject>(Content.AssetsList[1]);
				val.GetComponent<NetworkObject>().Spawn(true);
			}
			if (!Net.Instance.MasterNetworkObject.IsSpawned && NetworkManager.Singleton.IsServer)
			{
				Net.Instance.SpawnNetServerRpc();
			}
		}

		[HarmonyPriority(800)]
		[HarmonyPostfix]
		[HarmonyPatch(typeof(GameNetworkManager), "Start")]
		private static void InjectPrefabs()
		{
			foreach (GameObject prefab in Prefabs)
			{
				if (!NetworkManager.Singleton.NetworkConfig.Prefabs.Contains(prefab))
				{
					NetworkManager.Singleton.AddNetworkPrefab(prefab);
				}
			}
		}

		internal static void AddPrefabToInject(GameObject prefab)
		{
			if (!Prefabs.Contains(prefab))
			{
				Prefabs.Add(prefab);
			}
		}
	}
	internal class PlanetInfoContainer : MonoBehaviour
	{
		private static SelectableLevel[] PlanetDataArray;

		internal static Dictionary<string, SelectableLevel> PlanetDataDictionary = new Dictionary<string, SelectableLevel>();

		private static bool hasGatheredAndParsedData = false;

		private static bool init = false;

		internal static PlanetInfoContainer Instance { get; private set; }

		internal static void Init()
		{
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_0026: Expected O, but got Unknown
			if (!init && (Object)(object)Instance == (Object)null)
			{
				GameObject val = new GameObject("PlanetContainerData");
				val.AddComponent<PlanetInfoContainer>();
				init = true;
			}
		}

		private void Awake()
		{
			if ((Object)(object)Instance == (Object)null)
			{
				Instance = this;
			}
		}

		private void Start()
		{
			FindAndParsePlanetData();
			Instance.SetCustomPlanetData(PlanetDataDictionary["Level7Offense"], "POPULATION: Dead\r\nCONDITIONS: Jagged and weathered terrain with machinery debris scattered across the desolate mining facility.");
		}

		private void FindAndParsePlanetData()
		{
			if (!hasGatheredAndParsedData)
			{
				PlanetDataArray = Object.FindObjectOfType<Terminal>().moonsCatalogueList;
				ParsePlanetData();
			}
		}

		private void ParsePlanetData()
		{
			if (!hasGatheredAndParsedData)
			{
				Array.ForEach(PlanetDataArray, delegate(SelectableLevel planetData)
				{
					PlanetDataDictionary.Add(planetData.sceneName, planetData);
				});
				hasGatheredAndParsedData = true;
			}
		}

		internal void SetCustomPlanetData(SelectableLevel level, string planetName, string planetInfo)
		{
			level.PlanetName = planetName;
			level.LevelDescription = planetInfo;
		}

		internal void SetCustomPlanetData(SelectableLevel level, string planetInfo)
		{
			level.LevelDescription = planetInfo;
		}
	}
}
namespace __GEN
{
	internal class NetworkVariableSerializationHelper
	{
		[RuntimeInitializeOnLoadMethod]
		internal static void InitializeSerialization()
		{
			NetworkVariableSerializationTypes.InitializeSerializer_UnmanagedByMemcpy<bool>();
			NetworkVariableSerializationTypes.InitializeEqualityChecker_UnmanagedIEquatable<bool>();
		}
	}
}
namespace OutsideStructures.NetcodePatcher
{
	[AttributeUsage(AttributeTargets.Module)]
	internal class NetcodePatchedAssemblyAttribute : Attribute
	{
	}
}