Decompiled source of SantonianNetmap v1.0.1

SantonianNetmap.dll

Decompiled a month ago
using System;
using System.CodeDom.Compiler;
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 AK;
using BepInEx;
using BepInEx.Core.Logging.Interpolation;
using BepInEx.Logging;
using BepInEx.Unity.IL2CPP;
using HarmonyLib;
using Il2CppInterop.Runtime.InteropTypes.Arrays;
using Il2CppSystem;
using LevelGeneration;
using Localization;
using Microsoft.CodeAnalysis;
using Player;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = "")]
[assembly: AssemblyCompany("SantonianNetmap")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+git882d91d-dirty-main")]
[assembly: AssemblyProduct("SantonianNetmap")]
[assembly: AssemblyTitle("SantonianNetmap")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
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;
		}
	}
}
namespace Santonian
{
	internal static class Logger
	{
		private static readonly ManualLogSource _Logger;

		static Logger()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_0010: Expected O, but got Unknown
			_Logger = new ManualLogSource("Netmap");
			Logger.Sources.Add((ILogSource)(object)_Logger);
		}

		private static string Format(object msg)
		{
			if (msg == null)
			{
				return "";
			}
			return msg.ToString() ?? "";
		}

		public static void Fatal(BepInExFatalLogInterpolatedStringHandler handler)
		{
			_Logger.LogFatal(handler);
		}

		public static void Fatal(string str)
		{
			_Logger.LogFatal((object)str);
		}

		public static void Fatal(object data)
		{
			_Logger.LogFatal((object)Format(data));
		}

		public static void Error(BepInExErrorLogInterpolatedStringHandler handler)
		{
			_Logger.LogError(handler);
		}

		public static void Error(string str)
		{
			_Logger.LogError((object)str);
		}

		public static void Error(object data)
		{
			_Logger.LogError((object)Format(data));
		}

		public static void Warn(BepInExWarningLogInterpolatedStringHandler handler)
		{
			_Logger.LogWarning(handler);
		}

		public static void Warn(string str)
		{
			_Logger.LogWarning((object)str);
		}

		public static void Warn(object data)
		{
			_Logger.LogWarning((object)Format(data));
		}

		public static void Info(BepInExInfoLogInterpolatedStringHandler handler)
		{
			_Logger.LogInfo(handler);
		}

		public static void Info(string str)
		{
			_Logger.LogMessage((object)str);
		}

		public static void Info(object data)
		{
			_Logger.LogMessage((object)Format(data));
		}

		public static void Debug(BepInExDebugLogInterpolatedStringHandler handler)
		{
			_Logger.LogDebug(handler);
		}

		public static void Debug(string str)
		{
			_Logger.LogDebug((object)str);
		}

		public static void Debug(object data)
		{
			_Logger.LogDebug((object)Format(data));
		}

		[Conditional("DEBUG")]
		public static void DebugOnly(object data)
		{
			_Logger.LogDebug((object)Format(data));
		}
	}
	public static class Config
	{
		public const string command = "NMAP";

		public const string commandDescription = "Map resources in the current zone";

		public const float markerIconScale = 0.6f;

		public const float consumableIconScale = 0.4f;

		public const float markerAlpha = 0.4f;

		public const float baseScanTime = 2f;

		public const float itemScanTime = 0.5f;

		public const float resetTime = 2f;

		public const int markerFadeOutDelay = 10;

		public const int defaultTimeout = 60;

		public const int minTimeout = 30;

		public const int maxTimeout = 600;

		public const string outputFormat = "{0,-34} {1,-34} {2,-24}";

		public const string exOutputFormat = "{0,-34} {1,-34} {2,-24} {3, -34}";

		public const bool externalScan = false;
	}
	[BepInPlugin("com.aetheria.santonian.netmap", "Netmap", "1.0.1")]
	public class Netmap : BasePlugin
	{
		public static readonly List<ItemInLevel> __resourceItemsInLevelList = new List<ItemInLevel>();

		public static readonly List<ItemInLevel> __keyItemsInLevelList = new List<ItemInLevel>();

		public static readonly List<ConsumablePickup_Core> __consumableItemsInLevelList = new List<ConsumablePickup_Core>();

		public static readonly List<LG_ComputerTerminal> __terminalsInLevelList = new List<LG_ComputerTerminal>();

		public static readonly List<LG_HSU> __hsuInLevelList = new List<LG_HSU>();

		public static readonly List<LG_BulkheadDoorController_Core> __bulkheadsInLevelList = new List<LG_BulkheadDoorController_Core>();

		public static readonly List<LG_PowerGenerator_Core> __generatorsInLevelList = new List<LG_PowerGenerator_Core>();

		public static readonly List<LG_ResourceContainer_Storage> __containersInLevelList = new List<LG_ResourceContainer_Storage>();

		public static readonly List<LG_WeakDoor> __doorsInLevelList = new List<LG_WeakDoor>();

		public static readonly List<LG_SecurityDoor> __securityDoorsInLevelList = new List<LG_SecurityDoor>();

		public static readonly List<MarkerContext<ItemInLevel>> resourceMarkersList = new List<MarkerContext<ItemInLevel>>();

		public static readonly List<MarkerContext<ItemInLevel>> keyItemMarkersList = new List<MarkerContext<ItemInLevel>>();

		public static readonly List<MarkerContext<ItemInLevel>> consumableMarkersList = new List<MarkerContext<ItemInLevel>>();

		public static readonly List<MarkerContext<LG_ComputerTerminal>> terminalMarkersList = new List<MarkerContext<LG_ComputerTerminal>>();

		public static readonly List<MarkerContext<LG_HSU>> hsuMarkersList = new List<MarkerContext<LG_HSU>>();

		public static readonly List<MarkerContext<LG_BulkheadDoorController_Core>> bulkheadMarkersList = new List<MarkerContext<LG_BulkheadDoorController_Core>>();

		public static readonly List<MarkerContext<LG_PowerGenerator_Core>> generatorMarkersList = new List<MarkerContext<LG_PowerGenerator_Core>>();

		public static readonly List<MarkerContext<LG_ResourceContainer_Storage>> containerMarkersList = new List<MarkerContext<LG_ResourceContainer_Storage>>();

		public static readonly List<MarkerContext<LG_WeakDoor>> doorMarkersList = new List<MarkerContext<LG_WeakDoor>>();

		public static readonly List<MarkerContext<LG_SecurityDoor>> securityDoorMarkersList = new List<MarkerContext<LG_SecurityDoor>>();

		public static readonly List<MarkerContext<LG_ComputerTerminal>> permTerminalMarkersList = new List<MarkerContext<LG_ComputerTerminal>>();

		public static readonly List<MarkerContext<LG_HSU>> permHsuMarkersList = new List<MarkerContext<LG_HSU>>();

		public static readonly List<MarkerContext<LG_BulkheadDoorController_Core>> permBulkheadMarkersList = new List<MarkerContext<LG_BulkheadDoorController_Core>>();

		public static readonly List<MarkerContext<LG_PowerGenerator_Core>> permGeneratorMarkersList = new List<MarkerContext<LG_PowerGenerator_Core>>();

		public static readonly List<MarkerContext<LG_ResourceContainer_Storage>> permContainerMarkersList = new List<MarkerContext<LG_ResourceContainer_Storage>>();

		public static readonly List<MarkerContext<LG_WeakDoor>> permDoorMarkersList = new List<MarkerContext<LG_WeakDoor>>();

		public static readonly List<MarkerContext<LG_SecurityDoor>> permSecurityDoorMarkersList = new List<MarkerContext<LG_SecurityDoor>>();

		public static readonly object __itemInLevelMarkersLock = new object();

		public static readonly object __objectsInLevelMarkersLock = new object();

		public Harmony? HarmonyInstance { get; private set; }

		public static void Initialize()
		{
			Logger.Info("Santonian Holographic Netmap initialization");
			__resourceItemsInLevelList.Clear();
			resourceMarkersList.Clear();
			__keyItemsInLevelList.Clear();
			keyItemMarkersList.Clear();
			__consumableItemsInLevelList.Clear();
			consumableMarkersList.Clear();
			__terminalsInLevelList.Clear();
			terminalMarkersList.Clear();
			permTerminalMarkersList.Clear();
			__hsuInLevelList.Clear();
			hsuMarkersList.Clear();
			permHsuMarkersList.Clear();
			__bulkheadsInLevelList.Clear();
			bulkheadMarkersList.Clear();
			permBulkheadMarkersList.Clear();
			__generatorsInLevelList.Clear();
			generatorMarkersList.Clear();
			permGeneratorMarkersList.Clear();
			__containersInLevelList.Clear();
			containerMarkersList.Clear();
			permContainerMarkersList.Clear();
			__doorsInLevelList.Clear();
			doorMarkersList.Clear();
			permDoorMarkersList.Clear();
			__securityDoorsInLevelList.Clear();
			securityDoorMarkersList.Clear();
			permSecurityDoorMarkersList.Clear();
			foreach (ItemInLevel item in Object.FindObjectsOfType<ItemInLevel>())
			{
				if ((Object)(object)item == (Object)null)
				{
					continue;
				}
				LG_GenericTerminalItem componentInChildren = ((Component)item).GetComponentInChildren<LG_GenericTerminalItem>();
				if ((Object)(object)componentInChildren == (Object)null)
				{
					continue;
				}
				string terminalItemKey = componentInChildren.TerminalItemKey;
				if (terminalItemKey != null)
				{
					if (terminalItemKey.StartsWith("KEY_") || terminalItemKey.StartsWith("ID_") || terminalItemKey.StartsWith("BULKHEAD_KEY_") || terminalItemKey.StartsWith("CELL_") || terminalItemKey.StartsWith("OSIP_") || terminalItemKey.StartsWith("FOG_TURBINE") || terminalItemKey.StartsWith("GLP-2_") || terminalItemKey.StartsWith("PD_") || terminalItemKey.StartsWith("DATA_CUBE_") || terminalItemKey.StartsWith("HDD_") || terminalItemKey.StartsWith("PLANT_"))
					{
						__keyItemsInLevelList.Add(item);
					}
					else if (terminalItemKey.Contains("PACK") || terminalItemKey.StartsWith("TOOL_REFILL"))
					{
						__resourceItemsInLevelList.Add(item);
					}
				}
			}
			foreach (ConsumablePickup_Core item2 in Object.FindObjectsOfType<ConsumablePickup_Core>())
			{
				if ((Object)(object)item2 != (Object)null)
				{
					__consumableItemsInLevelList.Add(item2);
				}
			}
			foreach (LG_ComputerTerminal item3 in Object.FindObjectsOfType<LG_ComputerTerminal>())
			{
				if ((Object)(object)item3 != (Object)null)
				{
					__terminalsInLevelList.Add(item3);
				}
			}
			foreach (LG_HSU item4 in Object.FindObjectsOfType<LG_HSU>())
			{
				if ((Object)(object)item4 != (Object)null)
				{
					__hsuInLevelList.Add(item4);
				}
			}
			foreach (LG_BulkheadDoorController_Core item5 in Object.FindObjectsOfType<LG_BulkheadDoorController_Core>())
			{
				if ((Object)(object)item5 != (Object)null)
				{
					__bulkheadsInLevelList.Add(item5);
				}
			}
			foreach (LG_PowerGenerator_Core item6 in Object.FindObjectsOfType<LG_PowerGenerator_Core>())
			{
				if ((Object)(object)item6 != (Object)null)
				{
					__generatorsInLevelList.Add(item6);
				}
			}
			foreach (LG_ResourceContainer_Storage item7 in Object.FindObjectsOfType<LG_ResourceContainer_Storage>())
			{
				if ((Object)(object)item7 != (Object)null)
				{
					LG_GenericTerminalItem componentInChildren2 = ((Component)item7).GetComponentInChildren<LG_GenericTerminalItem>();
					if ((Object)(object)componentInChildren2 != (Object)null && componentInChildren2.TerminalItemKey != null)
					{
						__containersInLevelList.Add(item7);
					}
				}
			}
			foreach (LG_WeakDoor item8 in Object.FindObjectsOfType<LG_WeakDoor>())
			{
				if ((Object)(object)item8 != (Object)null)
				{
					__doorsInLevelList.Add(item8);
				}
			}
			foreach (LG_SecurityDoor item9 in Object.FindObjectsOfType<LG_SecurityDoor>())
			{
				if ((Object)(object)item9 != (Object)null)
				{
					__securityDoorsInLevelList.Add(item9);
				}
			}
		}

		public override void Load()
		{
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Expected O, but got Unknown
			Logger.Info("Santonian netmap enabled!");
			HarmonyInstance = new Harmony("com.aetheria.santonian.netmap");
			HarmonyInstance.PatchAll();
			LG_Factory.OnFactoryBuildDone += Action.op_Implicit((Action)Initialize);
		}
	}
	public class MarkerContext<T> : IComparable<MarkerContext<T>> where T : Component
	{
		private NavMarker? marker = null;

		public T item { get; }

		public string name { get; }

		public string title { get; }

		public eNavMarkerStyle style { get; }

		public int timeout { get; }

		public float iconScale { get; }

		public Color color { get; }

		public bool permanent { get; }

		public MarkerContext(T _item, string _name, string _title, eNavMarkerStyle _style, int _timeout, float _iconScale, Color _color, bool _permanent = false)
		{
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			//IL_004a: Unknown result type (might be due to invalid IL or missing references)
			item = _item;
			title = _title;
			name = _name;
			style = _style;
			timeout = (_permanent ? int.MaxValue : _timeout);
			iconScale = _iconScale;
			color = _color;
			permanent = _permanent;
		}

		public bool IsActive()
		{
			return (Object)(object)marker != (Object)null;
		}

		public int CompareTo(MarkerContext<T>? lhs)
		{
			if (lhs == null)
			{
				return 1;
			}
			return string.Compare(name, lhs.name, StringComparison.Ordinal);
		}

		public void Enable()
		{
			//IL_006b: 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)
			if (!((Object)(object)marker != (Object)null))
			{
				Logger.Debug(" ** enabling " + name + " navigation marker");
				marker = GuiManager.NavMarkerLayer.PrepareGenericMarker(((Component)item).gameObject);
				marker.SetTitle(title);
				marker.SetStyle(style);
				marker.SetColor(color);
				marker.SetIconScale(iconScale);
				marker.SetAlpha(0.4f);
				marker.SetVisible(true);
				marker.FadeOutOverTime((float)(timeout - 10), 10f);
				marker.PersistentBetweenRestarts = permanent;
				marker.m_fadeRoutine = CoroutineManager.StartCoroutine(GuiManager.NavMarkerLayer.FadeMarkerOverTime(marker, ((Object)marker).name, Random.Range(0.1f, 0.5f), (float)timeout, false), (Action)null);
			}
		}

		public void Disable()
		{
			if (!((Object)(object)marker == (Object)null))
			{
				Logger.Debug(" ** disabling " + name + " navigation marker");
				marker.SetVisible(false);
				marker.SetState((NavMarkerState)0);
				CoroutineManager.StopCoroutine(marker.m_fadeRoutine);
			}
		}

		public void Remove()
		{
			if (!((Object)(object)marker == (Object)null))
			{
				Disable();
				GuiManager.NavMarkerLayer.RemoveMarker(marker);
				marker = null;
			}
		}
	}
	public class NavigationMarkerPatch
	{
		private static void RemoveMarkerFromList(ItemInLevel __instance, List<MarkerContext<ItemInLevel>> __list)
		{
			foreach (MarkerContext<ItemInLevel> item in __list)
			{
				if ((Object)(object)__instance == (Object)(object)item.item)
				{
					item.Remove();
					Netmap.resourceMarkersList.Remove(item);
					break;
				}
			}
		}

		public static void RemoveNavigationMarker(ItemInLevel __instance)
		{
			Logger.Debug(" ** removing navigation marker for " + ((Item)__instance).PublicName);
			lock (Netmap.__itemInLevelMarkersLock)
			{
				RemoveMarkerFromList(__instance, Netmap.resourceMarkersList);
				RemoveMarkerFromList(__instance, Netmap.keyItemMarkersList);
				RemoveMarkerFromList(__instance, Netmap.consumableMarkersList);
			}
		}
	}
	[HarmonyPatch(typeof(ItemInLevel), "OnPickedUp")]
	public class ItemInLevel_OnPickUp : NavigationMarkerPatch
	{
		private static void Postfix(ItemInLevel __instance, PlayerAgent player, InventorySlot slot, AmmoType ammoType)
		{
			Logger.Debug(" ## ItemInLevel.OnPickedUp");
			NavigationMarkerPatch.RemoveNavigationMarker(__instance);
		}
	}
	[HarmonyPatch(typeof(KeyItemPickup_Core), "OnInteractionPickUp")]
	public class KeyItem_OnPickUp : NavigationMarkerPatch
	{
		private static void Postfix(ItemInLevel __instance, PlayerAgent player)
		{
			Logger.Debug(" ## KeyItemPickup_Core.OnInteractionPickUp");
			NavigationMarkerPatch.RemoveNavigationMarker(__instance);
		}
	}
	[HarmonyPatch(typeof(LG_ComputerTerminalCommandInterpreter), "SetupCommands")]
	public class NetmapPatch
	{
		private static void Postfix(LG_ComputerTerminalCommandInterpreter __instance)
		{
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: Expected O, but got Unknown
			__instance.AddCommand((TERM_Command)10, "NMAP", new LocalizedText
			{
				UntranslatedText = "Map resources in the current zone",
				Id = 0u
			}, (TERM_CommandRule)0);
		}
	}
	[HarmonyPatch(typeof(LG_ComputerTerminalCommandInterpreter), "ReceiveCommand")]
	public class NetmapOverridePatch
	{
		private static void Usage(LG_ComputerTerminalCommandInterpreter __instance, int currentZone, string errorMessage = "")
		{
			__instance.AddOutput(errorMessage, true);
			__instance.AddOutput("WARNING: Running NMAP with no filter is not recommended. Use -A to override", true);
			__instance.AddOutput("Usage: NMAP [-A] [-P|-T sec] [-R] [FILTERS] ZONE", true);
			__instance.AddOutput("Attributes:", false);
			__instance.AddOutput("[-P]           Optional attribute. Assigns permanent navigation marker to the stationary object", false);
			__instance.AddOutput("[-T sec]       Optional attribute. Sets expiration time for navigation marker in range [30..600] seconds", true);
			__instance.AddOutput("[-A]           Optional attribute. Maps all identifiable objects in the current zone (NOT RECOMMENDED)", true);
			__instance.AddOutput("[-R]           Optional attribute. Removes all permanent navigation markers", true);
			__instance.AddOutput("[FILTERS]      One or more regular items, groups of items or stationary objects to map", false);
			__instance.AddOutput("ZONE           Security zone to limit mapping operation to", true);
			__instance.AddOutput("Examples:", false);
			__instance.AddOutput("  NMAP -T 120 RES CON ZONE_123    Map resource packs and consumables in the current zone for 2 minutes", false);
			__instance.AddOutput("  NMAP -T 30 FOAM ZONE_123        Map C-FOAM grenades and mines in the current zone for 30 seconds", true);
			__instance.AddOutput("  NMAP -T 600 CELL_756 ZONE_123   Assign navigation marker to CELL_756 for 10 minutes in the current zone", true);
			__instance.AddOutput("  NMAP -P TERMINAL_356 E_606      Assign permanent navigation marker to TERMINAL_356 in ZONE_606", true);
			__instance.AddOutput("This terminal can locate and map large stationary objects, security doors, hydrostasis units, generators, bulkhead door controllers and other terminals outside of the current security zone", true);
			__instance.AddOutput("Note that this terminal ONLY can map resource packs, tools and consumables in the current zone: <b>ZONE_" + currentZone + "</b>", true);
		}

		private static bool ParseCommandLine(LG_ComputerTerminalCommandInterpreter __instance, string inputLine, out int timeout, out bool verboseScan, out bool permanentMarker, out bool resetMarkers, out List<string> argsList, out int scanZone, out string scanZoneName)
		{
			int number = __instance.m_terminal.SpawnNode.m_zone.NavInfo.Number;
			string[] array = inputLine.Split(' ', StringSplitOptions.RemoveEmptyEntries);
			timeout = 60;
			argsList = new List<string>();
			verboseScan = false;
			permanentMarker = false;
			resetMarkers = false;
			scanZone = number;
			scanZoneName = "ZONE_" + number;
			if (array.Length < 2)
			{
				Usage(__instance, number);
				return false;
			}
			for (int i = 1; i < array.Length; i++)
			{
				if (array[i].ToUpper() == "-T")
				{
					if (i + 1 >= array.Length)
					{
						Usage(__instance, number, " ## invalid command line. Argument is missing parameter [-T num_of_seconds]");
						return false;
					}
					if (!int.TryParse(array[i + 1], out var result) || result < 30 || result > 600)
					{
						Usage(__instance, number, " ## invalid command line. [-T num_of_seconds] must be time-to-live in range [30..600] seconds");
						return false;
					}
					timeout = result;
					i++;
				}
				else if (array[i].ToUpper() == "-A")
				{
					verboseScan = true;
				}
				else if (array[i].ToUpper() == "-P")
				{
					permanentMarker = true;
				}
				else if (array[i].ToUpper() == "-R")
				{
					resetMarkers = true;
				}
				else if (i < array.Length - 1)
				{
					argsList.Add(array[i]);
				}
			}
			if (resetMarkers)
			{
				Logger.Debug(" - reset markers: [enabled]");
				return true;
			}
			if (!array[^1].Contains("E_"))
			{
				Usage(__instance, number, " ## invalid command line. Last argument shall contain ZONE_##");
				return false;
			}
			string text = array[^1];
			int num = ExtractZoneNumber(text);
			if (Utility.IsNullOrWhiteSpace(text) || num <= 0)
			{
				Usage(__instance, number, " ## invalid command line. Invalid ZONE_## provided");
				return false;
			}
			scanZone = num;
			scanZoneName = "ZONE_" + scanZone;
			if (permanentMarker)
			{
				verboseScan = false;
			}
			return true;
		}

		private static int ExtractZoneNumber(string zoneName)
		{
			int num = zoneName.IndexOf('_');
			if (num != -1 && num < zoneName.Length - 1)
			{
				string s = zoneName.Substring(num + 1);
				if (int.TryParse(s, out var result))
				{
					return result;
				}
			}
			return 0;
		}

		private static bool PartialMatchOnList(string name, List<string> filterList)
		{
			foreach (string filter in filterList)
			{
				if (name.Contains(filter))
				{
					return true;
				}
			}
			return false;
		}

		private static bool FullMatchOnList(string name, List<string> filterList)
		{
			foreach (string filter in filterList)
			{
				if (name == filter)
				{
					return true;
				}
			}
			return false;
		}

		private static bool Prefix(LG_ComputerTerminalCommandInterpreter __instance, TERM_Command cmd, string inputLine, string param1, string param2)
		{
			//IL_0309: Unknown result type (might be due to invalid IL or missing references)
			//IL_030e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0314: Invalid comparison between Unknown and I4
			//IL_04e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_04e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_04ef: Invalid comparison between Unknown and I4
			//IL_0627: Unknown result type (might be due to invalid IL or missing references)
			//IL_062c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0632: Invalid comparison between Unknown and I4
			//IL_0640: Unknown result type (might be due to invalid IL or missing references)
			//IL_0645: Unknown result type (might be due to invalid IL or missing references)
			//IL_0835: Unknown result type (might be due to invalid IL or missing references)
			//IL_083a: Unknown result type (might be due to invalid IL or missing references)
			//IL_09b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_09b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b2f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c95: Unknown result type (might be due to invalid IL or missing references)
			//IL_0dfa: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f7c: Unknown result type (might be due to invalid IL or missing references)
			//IL_10e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_10e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_10ed: Invalid comparison between Unknown and I4
			//IL_035a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0531: Unknown result type (might be due to invalid IL or missing references)
			//IL_0853: Unknown result type (might be due to invalid IL or missing references)
			//IL_084a: Unknown result type (might be due to invalid IL or missing references)
			//IL_084f: Unknown result type (might be due to invalid IL or missing references)
			//IL_09cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_09c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_09cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e14: Unknown result type (might be due to invalid IL or missing references)
			//IL_10ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_1105: Invalid comparison between Unknown and I4
			//IL_10f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0370: Unknown result type (might be due to invalid IL or missing references)
			//IL_054c: Unknown result type (might be due to invalid IL or missing references)
			//IL_1110: Unknown result type (might be due to invalid IL or missing references)
			//IL_0389: Unknown result type (might be due to invalid IL or missing references)
			//IL_03c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0695: Unknown result type (might be due to invalid IL or missing references)
			//IL_03a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_03e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_06ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b68: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b70: Unknown result type (might be due to invalid IL or missing references)
			//IL_0cce: Unknown result type (might be due to invalid IL or missing references)
			//IL_0cd6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0fb5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0fbd: Unknown result type (might be due to invalid IL or missing references)
			//IL_03bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_06c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_06ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_06cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_088c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0894: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a08: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a10: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e4e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e56: Unknown result type (might be due to invalid IL or missing references)
			//IL_0589: Unknown result type (might be due to invalid IL or missing references)
			//IL_0591: Unknown result type (might be due to invalid IL or missing references)
			//IL_06e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_114a: Unknown result type (might be due to invalid IL or missing references)
			//IL_1152: Unknown result type (might be due to invalid IL or missing references)
			//IL_0703: Unknown result type (might be due to invalid IL or missing references)
			//IL_0bcf: Unknown result type (might be due to invalid IL or missing references)
			//IL_0bd7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d35: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d3d: Unknown result type (might be due to invalid IL or missing references)
			//IL_1019: Unknown result type (might be due to invalid IL or missing references)
			//IL_1021: Unknown result type (might be due to invalid IL or missing references)
			//IL_0446: Unknown result type (might be due to invalid IL or missing references)
			//IL_044e: Unknown result type (might be due to invalid IL or missing references)
			//IL_071d: Unknown result type (might be due to invalid IL or missing references)
			//IL_08f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_08f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a6c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a74: Unknown result type (might be due to invalid IL or missing references)
			//IL_0eb2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0eba: Unknown result type (might be due to invalid IL or missing references)
			//IL_0737: Unknown result type (might be due to invalid IL or missing references)
			//IL_0774: Unknown result type (might be due to invalid IL or missing references)
			//IL_077c: Unknown result type (might be due to invalid IL or missing references)
			//IL_11b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_11b9: Unknown result type (might be due to invalid IL or missing references)
			LG_ComputerTerminalCommandInterpreter __instance2 = __instance;
			if (!inputLine.StartsWith("NMAP"))
			{
				return true;
			}
			int number = __instance2.m_terminal.SpawnNode.m_zone.NavInfo.Number;
			string text = "ZONE_" + number;
			__instance2.m_terminal.IsWaitingForAnyKeyInLinePause = false;
			__instance2.m_linesSinceCommand = 0;
			__instance2.AddOutput("\\\\Root\\" + inputLine, false);
			if (!ParseCommandLine(__instance2, inputLine, out int timeout, out bool verboseScan, out bool permanentMarker, out bool resetMarkers, out List<string> argsList, out int scanZone, out string scanZoneName))
			{
				return false;
			}
			RemoveActiveMarkers();
			if (resetMarkers)
			{
				__instance2.AddOutput((TerminalLineType)4, "Erasing navigation markers cache", 2f, (TerminalSoundType)0, (TerminalSoundType)0);
				RemovePermanentMarkers();
				return false;
			}
			List<string> list = new List<string>();
			bool flag = false;
			bool flag2 = false;
			bool flag3 = false;
			foreach (string item in argsList)
			{
				if (item.Length >= 3)
				{
					if ("RESOURCES".StartsWith(item))
					{
						flag2 = true;
					}
					else if ("CONSUMABLES".StartsWith(item))
					{
						flag3 = true;
					}
					else
					{
						list.Add(item);
					}
				}
			}
			if (list.Count() == 0 && !flag2 && !flag3)
			{
				flag = true;
				flag2 = true;
				flag3 = true;
			}
			bool flag4 = number == scanZone;
			Logger.Debug(" - timeout: " + timeout + " sec");
			Logger.Debug(" - zone: " + scanZone);
			Logger.Debug(" - verbose scan: " + (verboseScan ? "[enabled]" : "[disabled]"));
			Logger.Debug(" - permanent marker: " + (permanentMarker ? "[enabled]" : "[disabled]"));
			Logger.Debug(" - key items scan: " + (flag ? "[enabled]" : "[disabled]"));
			Logger.Debug(" - resources scan: " + (flag2 ? "[enabled]" : "[disabled]"));
			Logger.Debug(" - consumables scan: " + (flag3 ? "[enabled]" : "[disabled]"));
			Logger.Debug(" - items list: ");
			foreach (string item2 in list)
			{
				Logger.Debug("     - " + item2);
			}
			if (flag4)
			{
				foreach (ItemInLevel _resourceItemsInLevel in Netmap.__resourceItemsInLevelList)
				{
					try
					{
						if ((int)_resourceItemsInLevel.internalSync.GetCurrentState().status == 1)
						{
							continue;
						}
						LG_GenericTerminalItem componentInChildren = ((Component)_resourceItemsInLevel).GetComponentInChildren<LG_GenericTerminalItem>();
						if (!componentInChildren.FloorItemLocation.Contains(scanZoneName))
						{
							continue;
						}
						string terminalItemKey = componentInChildren.TerminalItemKey;
						string text2 = terminalItemKey;
						eNavMarkerStyle style = (eNavMarkerStyle)5;
						if (terminalItemKey.StartsWith("MEDIPACK"))
						{
							style = (eNavMarkerStyle)4;
						}
						else if (terminalItemKey.StartsWith("AMMOPACK"))
						{
							style = (eNavMarkerStyle)3;
						}
						else if (terminalItemKey.StartsWith("TOOL_REFILL"))
						{
							style = (eNavMarkerStyle)21;
						}
						else if (terminalItemKey.StartsWith("DISINFECT_PACK"))
						{
							style = (eNavMarkerStyle)17;
						}
						if (((Item)_resourceItemsInLevel).GetCustomData().ammo >= 20f)
						{
							text2 = text2 + "\n(" + ((Item)_resourceItemsInLevel).GetCustomData().ammo / 20f + " Uses)";
						}
						if (verboseScan || flag2 || PartialMatchOnList(terminalItemKey, list))
						{
							lock (Netmap.__itemInLevelMarkersLock)
							{
								Netmap.resourceMarkersList.Add(new MarkerContext<ItemInLevel>(_resourceItemsInLevel, terminalItemKey, text2, style, timeout, 0.6f, Color.white));
							}
						}
					}
					catch (Exception ex)
					{
						Logger.Error(" ## " + ex);
					}
				}
			}
			if (flag4)
			{
				foreach (ItemInLevel _keyItemsInLevel in Netmap.__keyItemsInLevelList)
				{
					try
					{
						if ((int)_keyItemsInLevel.internalSync.GetCurrentState().status == 1)
						{
							continue;
						}
						LG_GenericTerminalItem componentInChildren2 = ((Component)_keyItemsInLevel).GetComponentInChildren<LG_GenericTerminalItem>();
						string terminalItemKey2 = componentInChildren2.TerminalItemKey;
						if (!componentInChildren2.FloorItemLocation.Contains(scanZoneName))
						{
							continue;
						}
						eNavMarkerStyle style2 = (eNavMarkerStyle)5;
						string title = terminalItemKey2;
						if (terminalItemKey2.StartsWith("KEY_"))
						{
							style2 = (eNavMarkerStyle)20;
						}
						if (verboseScan || flag || PartialMatchOnList(terminalItemKey2, list))
						{
							lock (Netmap.__itemInLevelMarkersLock)
							{
								Netmap.keyItemMarkersList.Add(new MarkerContext<ItemInLevel>(_keyItemsInLevel, terminalItemKey2, title, style2, timeout, 0.6f, Color.white));
							}
						}
					}
					catch (Exception ex2)
					{
						Logger.Error(" ## " + ex2);
					}
				}
			}
			if (flag4)
			{
				foreach (ConsumablePickup_Core _consumableItemsInLevel in Netmap.__consumableItemsInLevelList)
				{
					try
					{
						if ((int)((ItemInLevel)_consumableItemsInLevel).internalSync.GetCurrentState().status == 1)
						{
							continue;
						}
						Color color = Color.white;
						LG_Area val = FindParentArea((ItemInLevel)(object)_consumableItemsInLevel);
						if ((Object)(object)val == (Object)null || val.m_zone.NavInfo.Number != scanZone)
						{
							continue;
						}
						string text3 = ((Item)_consumableItemsInLevel).PublicName.ToUpper();
						string title2 = text3;
						eNavMarkerStyle style3 = (eNavMarkerStyle)18;
						switch (text3)
						{
						case "LONG RANGE FLASHLIGHT":
							style3 = (eNavMarkerStyle)1;
							break;
						case "GLOW STICK":
							style3 = (eNavMarkerStyle)19;
							color = Color.grey;
							break;
						case "C-FOAM GRENADE":
							style3 = (eNavMarkerStyle)18;
							break;
						case "EXPLOSIVE TRIP MINE":
							style3 = (eNavMarkerStyle)18;
							break;
						case "LOCK MELTER":
							style3 = (eNavMarkerStyle)18;
							break;
						case "FOG REPELLER":
							style3 = (eNavMarkerStyle)19;
							break;
						}
						if (verboseScan || flag3 || PartialMatchOnList(text3, list))
						{
							lock (Netmap.__itemInLevelMarkersLock)
							{
								Netmap.consumableMarkersList.Add(new MarkerContext<ItemInLevel>((ItemInLevel)(object)_consumableItemsInLevel, text3, title2, style3, timeout, 0.6f, color));
							}
						}
					}
					catch (Exception ex3)
					{
						Logger.Error(" ## " + ex3);
					}
				}
			}
			foreach (LG_ComputerTerminal _terminalsInLevel in Netmap.__terminalsInLevelList)
			{
				try
				{
					if (!_terminalsInLevel.m_terminalItem.FloorItemLocation.Contains(scanZoneName))
					{
						continue;
					}
					string text4 = _terminalsInLevel.PublicName.ToUpper();
					string title3 = text4;
					Color color2 = Color.green;
					if (_terminalsInLevel.m_isWardenObjective)
					{
						color2 = Color.magenta;
					}
					eNavMarkerStyle style4 = (eNavMarkerStyle)6;
					if (permanentMarker && FullMatchOnList(text4, list))
					{
						lock (Netmap.__objectsInLevelMarkersLock)
						{
							Netmap.permTerminalMarkersList.Add(new MarkerContext<LG_ComputerTerminal>(_terminalsInLevel, text4, title3, style4, timeout, 0.6f, color2, permanentMarker));
						}
					}
					else if (verboseScan || flag || PartialMatchOnList(text4, list))
					{
						lock (Netmap.__objectsInLevelMarkersLock)
						{
							Netmap.terminalMarkersList.Add(new MarkerContext<LG_ComputerTerminal>(_terminalsInLevel, text4, title3, style4, timeout, 0.6f, color2));
						}
					}
				}
				catch (Exception ex4)
				{
					Logger.Error(" ## " + ex4);
				}
			}
			foreach (LG_HSU _hsuInLevel in Netmap.__hsuInLevelList)
			{
				try
				{
					if (!_hsuInLevel.m_terminalItem.FloorItemLocation.Contains(scanZoneName))
					{
						continue;
					}
					string text5 = _hsuInLevel.PublicName.ToUpper();
					string title4 = text5;
					Color color3 = Color.grey;
					if (_hsuInLevel.m_isWardenObjective)
					{
						color3 = Color.magenta;
					}
					eNavMarkerStyle style5 = (eNavMarkerStyle)8;
					if (permanentMarker && FullMatchOnList(text5, list))
					{
						lock (Netmap.__objectsInLevelMarkersLock)
						{
							Netmap.permHsuMarkersList.Add(new MarkerContext<LG_HSU>(_hsuInLevel, text5, title4, style5, timeout, 0.6f, color3, permanentMarker));
						}
					}
					else if (verboseScan || flag || PartialMatchOnList(text5, list))
					{
						lock (Netmap.__objectsInLevelMarkersLock)
						{
							Netmap.hsuMarkersList.Add(new MarkerContext<LG_HSU>(_hsuInLevel, text5, title4, style5, timeout, 0.6f, color3));
						}
					}
				}
				catch (Exception ex5)
				{
					Logger.Error(" ## " + ex5);
				}
			}
			foreach (LG_BulkheadDoorController_Core _bulkheadsInLevel in Netmap.__bulkheadsInLevelList)
			{
				try
				{
					if (!_bulkheadsInLevel.m_terminalItem.FloorItemLocation.Contains(scanZoneName))
					{
						continue;
					}
					string text6 = _bulkheadsInLevel.PublicName.ToUpper();
					string title5 = text6;
					eNavMarkerStyle style6 = (eNavMarkerStyle)30;
					if (permanentMarker && FullMatchOnList(text6, list))
					{
						lock (Netmap.__objectsInLevelMarkersLock)
						{
							Netmap.permBulkheadMarkersList.Add(new MarkerContext<LG_BulkheadDoorController_Core>(_bulkheadsInLevel, text6, title5, style6, timeout, 0.6f, Color.green, permanentMarker));
						}
					}
					else if (verboseScan || flag || PartialMatchOnList(text6, list))
					{
						lock (Netmap.__objectsInLevelMarkersLock)
						{
							Netmap.bulkheadMarkersList.Add(new MarkerContext<LG_BulkheadDoorController_Core>(_bulkheadsInLevel, text6, title5, style6, timeout, 0.6f, Color.green));
						}
					}
				}
				catch (Exception ex6)
				{
					Logger.Error(" ## " + ex6);
				}
			}
			foreach (LG_PowerGenerator_Core _generatorsInLevel in Netmap.__generatorsInLevelList)
			{
				try
				{
					if (!_generatorsInLevel.m_terminalItem.FloorItemLocation.Contains(scanZoneName))
					{
						continue;
					}
					string text7 = _generatorsInLevel.PublicName.ToUpper();
					string title6 = text7;
					eNavMarkerStyle style7 = (eNavMarkerStyle)16;
					if (permanentMarker && FullMatchOnList(text7, list))
					{
						lock (Netmap.__objectsInLevelMarkersLock)
						{
							Netmap.permGeneratorMarkersList.Add(new MarkerContext<LG_PowerGenerator_Core>(_generatorsInLevel, text7, title6, style7, timeout, 0.6f, Color.yellow, permanentMarker));
						}
					}
					else if (verboseScan || flag || PartialMatchOnList(text7, list))
					{
						lock (Netmap.__objectsInLevelMarkersLock)
						{
							Netmap.generatorMarkersList.Add(new MarkerContext<LG_PowerGenerator_Core>(_generatorsInLevel, text7, title6, style7, timeout, 0.6f, Color.yellow));
						}
					}
				}
				catch (Exception ex7)
				{
					Logger.Error(" ## " + ex7);
				}
			}
			foreach (LG_ResourceContainer_Storage _containersInLevel in Netmap.__containersInLevelList)
			{
				try
				{
					LG_GenericTerminalItem componentInChildren3 = ((Component)_containersInLevel).GetComponentInChildren<LG_GenericTerminalItem>();
					if (!componentInChildren3.FloorItemLocation.Contains(scanZoneName))
					{
						continue;
					}
					string terminalItemKey3 = componentInChildren3.TerminalItemKey;
					string title7 = terminalItemKey3;
					eNavMarkerStyle style8 = (eNavMarkerStyle)10;
					if (((Il2CppArrayBase<StorageSlot>)(object)_containersInLevel.m_storageSlots).Length < 4)
					{
						style8 = (eNavMarkerStyle)11;
					}
					if (permanentMarker && FullMatchOnList(terminalItemKey3, list))
					{
						lock (Netmap.__objectsInLevelMarkersLock)
						{
							Netmap.permContainerMarkersList.Add(new MarkerContext<LG_ResourceContainer_Storage>(_containersInLevel, terminalItemKey3, title7, style8, timeout, 0.6f, Color.grey, permanentMarker));
						}
					}
					else if (verboseScan || PartialMatchOnList(terminalItemKey3, list))
					{
						lock (Netmap.__objectsInLevelMarkersLock)
						{
							Netmap.containerMarkersList.Add(new MarkerContext<LG_ResourceContainer_Storage>(_containersInLevel, terminalItemKey3, title7, style8, timeout, 0.6f, Color.grey));
						}
					}
				}
				catch (Exception ex8)
				{
					Logger.Error(" ## " + ex8);
				}
			}
			foreach (LG_WeakDoor _doorsInLevel in Netmap.__doorsInLevelList)
			{
				try
				{
					LG_GenericTerminalItem componentInChildren4 = ((Component)_doorsInLevel).GetComponentInChildren<LG_GenericTerminalItem>();
					if (!_doorsInLevel.m_terminalItem.FloorItemLocation.Contains(scanZoneName))
					{
						continue;
					}
					string terminalItemKey4 = componentInChildren4.TerminalItemKey;
					string title8 = terminalItemKey4;
					eNavMarkerStyle style9 = (eNavMarkerStyle)9;
					if (permanentMarker && FullMatchOnList(terminalItemKey4, list))
					{
						lock (Netmap.__objectsInLevelMarkersLock)
						{
							Netmap.permDoorMarkersList.Add(new MarkerContext<LG_WeakDoor>(_doorsInLevel, terminalItemKey4, title8, style9, timeout, 0.6f, Color.grey, permanentMarker));
						}
					}
					else if (verboseScan || PartialMatchOnList(terminalItemKey4, list))
					{
						lock (Netmap.__objectsInLevelMarkersLock)
						{
							Netmap.doorMarkersList.Add(new MarkerContext<LG_WeakDoor>(_doorsInLevel, terminalItemKey4, title8, style9, timeout, 0.6f, Color.grey));
						}
					}
				}
				catch (Exception ex9)
				{
					Logger.Error(" ## " + ex9);
				}
			}
			foreach (LG_SecurityDoor _securityDoorsInLevel in Netmap.__securityDoorsInLevelList)
			{
				try
				{
					LG_GenericTerminalItem componentInChildren5 = ((Component)_securityDoorsInLevel).GetComponentInChildren<LG_GenericTerminalItem>();
					if (!_securityDoorsInLevel.m_terminalItem.FloorItemLocation.Contains(scanZoneName))
					{
						continue;
					}
					string terminalItemKey5 = componentInChildren5.TerminalItemKey;
					string title9 = terminalItemKey5;
					eNavMarkerStyle style10 = (eNavMarkerStyle)22;
					if ((int)_securityDoorsInLevel.m_securityDoorType == 1)
					{
						style10 = (eNavMarkerStyle)24;
					}
					else if ((int)_securityDoorsInLevel.m_securityDoorType == 2)
					{
						style10 = (eNavMarkerStyle)23;
					}
					if (permanentMarker && FullMatchOnList(terminalItemKey5, list))
					{
						lock (Netmap.__objectsInLevelMarkersLock)
						{
							Netmap.permSecurityDoorMarkersList.Add(new MarkerContext<LG_SecurityDoor>(_securityDoorsInLevel, terminalItemKey5, title9, style10, timeout, 0.6f, Color.white, permanentMarker));
						}
					}
					else if (verboseScan || flag || PartialMatchOnList(terminalItemKey5, list))
					{
						lock (Netmap.__objectsInLevelMarkersLock)
						{
							Netmap.securityDoorMarkersList.Add(new MarkerContext<LG_SecurityDoor>(_securityDoorsInLevel, terminalItemKey5, title9, style10, timeout, 0.6f, Color.white));
						}
					}
				}
				catch (Exception ex10)
				{
					Logger.Error(" ## " + ex10);
				}
			}
			int scannedItemsCount = TotalScannedItemsCount();
			float num = 2f + (float)scannedItemsCount * 0.5f;
			__instance2.AddOutput((TerminalLineType)4, "Initalizing Santonian Holographic Netmap", num, (TerminalSoundType)0, (TerminalSoundType)0);
			__instance2.OnEndOfQueue = Action.op_Implicit((Action)delegate
			{
				//IL_0097: Unknown result type (might be due to invalid IL or missing references)
				//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
				//IL_01a4: Unknown result type (might be due to invalid IL or missing references)
				//IL_01b0: Unknown result type (might be due to invalid IL or missing references)
				//IL_0256: Unknown result type (might be due to invalid IL or missing references)
				//IL_0262: Unknown result type (might be due to invalid IL or missing references)
				//IL_0308: Unknown result type (might be due to invalid IL or missing references)
				//IL_0314: Unknown result type (might be due to invalid IL or missing references)
				//IL_043a: Unknown result type (might be due to invalid IL or missing references)
				//IL_0449: Unknown result type (might be due to invalid IL or missing references)
				//IL_0536: Unknown result type (might be due to invalid IL or missing references)
				//IL_053b: Unknown result type (might be due to invalid IL or missing references)
				//IL_05b2: Unknown result type (might be due to invalid IL or missing references)
				//IL_066f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0674: Unknown result type (might be due to invalid IL or missing references)
				//IL_068e: Unknown result type (might be due to invalid IL or missing references)
				//IL_06f8: Unknown result type (might be due to invalid IL or missing references)
				//IL_0707: Unknown result type (might be due to invalid IL or missing references)
				//IL_06a8: Unknown result type (might be due to invalid IL or missing references)
				//IL_085c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0868: Unknown result type (might be due to invalid IL or missing references)
				//IL_0910: Unknown result type (might be due to invalid IL or missing references)
				//IL_091c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0989: Unknown result type (might be due to invalid IL or missing references)
				__instance2.AddOutput(string.Format("{0,-34} {1,-34} {2,-24} {3, -34}", "ID", "ITEM TYPE", "STATUS", "SPECIAL NOTES"), true);
				bool newline = false;
				lock (Netmap.__itemInLevelMarkersLock)
				{
					Netmap.keyItemMarkersList.Sort();
					foreach (MarkerContext<ItemInLevel> keyItemMarkers in Netmap.keyItemMarkersList)
					{
						LG_GenericTerminalItem componentInChildren6 = ((Component)keyItemMarkers.item).GetComponentInChildren<LG_GenericTerminalItem>();
						__instance2.AddOutput($"{keyItemMarkers.name,-34} {componentInChildren6.FloorItemType,-34} {componentInChildren6.FloorItemStatus,-24}", false);
						newline = true;
						keyItemMarkers.Enable();
					}
					TerminalNewline(__instance2, ref newline);
				}
				lock (Netmap.__objectsInLevelMarkersLock)
				{
					Netmap.bulkheadMarkersList.Sort();
					Netmap.generatorMarkersList.Sort();
					Netmap.terminalMarkersList.Sort();
					Netmap.hsuMarkersList.Sort();
					Netmap.securityDoorMarkersList.Sort();
					foreach (MarkerContext<LG_BulkheadDoorController_Core> item3 in Netmap.bulkheadMarkersList.Concat<MarkerContext<LG_BulkheadDoorController_Core>>(Netmap.permBulkheadMarkersList))
					{
						iTerminalItem terminalItem = item3.item.m_terminalItem;
						if (terminalItem.FloorItemLocation.Contains(scanZoneName))
						{
							__instance2.AddOutput($"{item3.name,-34} {terminalItem.FloorItemType,-34} {terminalItem.FloorItemStatus,-24}", false);
							newline = true;
						}
						item3.Enable();
					}
					TerminalNewline(__instance2, ref newline);
					foreach (MarkerContext<LG_PowerGenerator_Core> item4 in Netmap.generatorMarkersList.Concat<MarkerContext<LG_PowerGenerator_Core>>(Netmap.permGeneratorMarkersList))
					{
						iTerminalItem terminalItem2 = item4.item.m_terminalItem;
						if (terminalItem2.FloorItemLocation.Contains(scanZoneName))
						{
							__instance2.AddOutput($"{item4.name,-34} {terminalItem2.FloorItemType,-34} {terminalItem2.FloorItemStatus,-24}", false);
							newline = true;
						}
						item4.Enable();
					}
					TerminalNewline(__instance2, ref newline);
					foreach (MarkerContext<LG_ComputerTerminal> item5 in Netmap.terminalMarkersList.Concat<MarkerContext<LG_ComputerTerminal>>(Netmap.permTerminalMarkersList))
					{
						iTerminalItem terminalItem3 = item5.item.m_terminalItem;
						if (terminalItem3.FloorItemLocation.Contains(scanZoneName))
						{
							__instance2.AddOutput($"{item5.name,-34} {terminalItem3.FloorItemType,-34} {terminalItem3.FloorItemStatus,-24}", false);
							newline = true;
						}
						item5.Enable();
					}
					TerminalNewline(__instance2, ref newline);
					foreach (MarkerContext<LG_HSU> item6 in Netmap.hsuMarkersList.Concat<MarkerContext<LG_HSU>>(Netmap.permHsuMarkersList))
					{
						iTerminalItem terminalItem4 = item6.item.m_terminalItem;
						if (terminalItem4.FloorItemLocation.Contains(scanZoneName))
						{
							string text8 = item6.item.m_subjectFirstName + " " + item6.item.m_subjectLastname;
							text8 = text8 + ", " + (item6.item.m_subjectIsFemale ? "Female" : "Male");
							text8 = text8 + ", " + item6.item.m_age;
							__instance2.AddOutput($"{item6.name,-34} {terminalItem4.FloorItemType,-34} {terminalItem4.FloorItemStatus,-24} {text8,-34}", false);
							newline = true;
						}
						item6.Enable();
					}
					TerminalNewline(__instance2, ref newline);
					foreach (MarkerContext<LG_SecurityDoor> item7 in Netmap.securityDoorMarkersList.Concat<MarkerContext<LG_SecurityDoor>>(Netmap.permSecurityDoorMarkersList))
					{
						iTerminalItem terminalItem5 = item7.item.m_terminalItem;
						if (terminalItem5.FloorItemLocation.Contains(scanZoneName))
						{
							string text9 = "";
							GateKeyItem keyItem = item7.item.m_keyItem;
							if (keyItem != null)
							{
								text9 = "Restricted zone: " + keyItem.m_keyName + "_" + keyItem.m_keyNum;
							}
							eFloorInventoryObjectType floorItemType = terminalItem5.FloorItemType;
							string text10 = ((object)(eFloorInventoryObjectType)(ref floorItemType)).ToString();
							if (item7.item.LinkedToZoneData.Alias != 0)
							{
								text10 = "Passage to ZONE_" + item7.item.LinkedToZoneData.Alias;
							}
							__instance2.AddOutput($"{item7.name,-34} {text10,-34} {terminalItem5.FloorItemStatus,-24} {text9,-34}", false);
							newline = true;
						}
						item7.Enable();
					}
					TerminalNewline(__instance2, ref newline);
				}
				lock (Netmap.__itemInLevelMarkersLock)
				{
					Netmap.resourceMarkersList.Sort();
					Netmap.consumableMarkersList.Sort();
					foreach (MarkerContext<ItemInLevel> resourceMarkers in Netmap.resourceMarkersList)
					{
						LG_GenericTerminalItem componentInChildren7 = ((Component)resourceMarkers.item).GetComponentInChildren<LG_GenericTerminalItem>();
						pItemData_Custom customData = ((Item)resourceMarkers.item).GetCustomData();
						string text11 = customData.ammo + "% [";
						if (customData.ammo >= 20f)
						{
							text11 = text11 + customData.ammo / 20f + " uses";
						}
						text11 += "]";
						__instance2.AddOutput($"{resourceMarkers.name,-34} {componentInChildren7.FloorItemType,-34} {componentInChildren7.FloorItemStatus,-24} {text11,-34}", false);
						newline = true;
						resourceMarkers.Enable();
					}
					TerminalNewline(__instance2, ref newline);
					foreach (MarkerContext<ItemInLevel> consumableMarkers in Netmap.consumableMarkersList)
					{
						__instance2.AddOutput(string.Format("{0,-34} {1,-34} {2,-24}", consumableMarkers.name, "Consumables", "Normal"), false);
						newline = true;
						consumableMarkers.Enable();
					}
					TerminalNewline(__instance2, ref newline);
				}
				lock (Netmap.__objectsInLevelMarkersLock)
				{
					Netmap.containerMarkersList.Sort();
					Netmap.doorMarkersList.Sort();
					foreach (MarkerContext<LG_ResourceContainer_Storage> containerMarkers in Netmap.containerMarkersList)
					{
						LG_GenericTerminalItem componentInChildren8 = ((Component)containerMarkers.item).GetComponentInChildren<LG_GenericTerminalItem>();
						if (componentInChildren8.FloorItemLocation.Contains(scanZoneName))
						{
							__instance2.AddOutput($"{containerMarkers.name,-34} {componentInChildren8.FloorItemType,-34} {componentInChildren8.FloorItemStatus,-24}", false);
							newline = true;
						}
						containerMarkers.Enable();
					}
					TerminalNewline(__instance2, ref newline);
					foreach (MarkerContext<LG_WeakDoor> item8 in Netmap.doorMarkersList.Concat<MarkerContext<LG_WeakDoor>>(Netmap.permDoorMarkersList))
					{
						iTerminalItem terminalItem6 = item8.item.m_terminalItem;
						if (terminalItem6.FloorItemLocation.Contains(scanZoneName))
						{
							__instance2.AddOutput($"{item8.name,-34} {terminalItem6.FloorItemType,-34} {terminalItem6.FloorItemStatus,-24}", false);
							newline = true;
						}
						item8.Enable();
					}
					TerminalNewline(__instance2, ref newline);
				}
				CellSound.Post(EVENTS.TERMINAL_PING_MARKER_SFX, ((Component)__instance2.m_terminal).transform.position);
				__instance2.AddOutput("Scan has finished, " + scannedItemsCount + " items discovered", false);
			});
			return false;
		}

		private static void TerminalNewline(LG_ComputerTerminalCommandInterpreter __instance, ref bool newline)
		{
			if (newline)
			{
				__instance.AddOutput(" ", false);
				newline = false;
			}
		}

		private static int TotalScannedItemsCount()
		{
			int num = 0;
			lock (Netmap.__itemInLevelMarkersLock)
			{
				num += Netmap.keyItemMarkersList.Count();
				num += Netmap.resourceMarkersList.Count();
				num += Netmap.consumableMarkersList.Count();
			}
			lock (Netmap.__objectsInLevelMarkersLock)
			{
				num += Netmap.bulkheadMarkersList.Count() + Netmap.permBulkheadMarkersList.Count();
				num += Netmap.generatorMarkersList.Count() + Netmap.permGeneratorMarkersList.Count();
				num += Netmap.terminalMarkersList.Count() + Netmap.permTerminalMarkersList.Count();
				num += Netmap.hsuMarkersList.Count() + Netmap.permHsuMarkersList.Count();
				num += Netmap.securityDoorMarkersList.Count() + Netmap.permSecurityDoorMarkersList.Count();
				num += Netmap.containerMarkersList.Count() + Netmap.permContainerMarkersList.Count();
				num += Netmap.doorMarkersList.Count() + Netmap.permDoorMarkersList.Count();
			}
			return num;
		}

		private static LG_Area FindParentArea(ItemInLevel item)
		{
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			Transform val = ((Component)item).gameObject.transform;
			while ((Object)(object)val != (Object)null)
			{
				LG_Area component = ((Component)val).GetComponent<LG_Area>();
				if ((Object)(object)component != (Object)null)
				{
					return component;
				}
				val = val.parent;
			}
			throw new MemberNotFoundException("No LG_Area parent class found for ItemInLevel provided");
		}

		private static void RemoveActiveMarkers()
		{
			Logger.Info(" ** removing all active navigation markers");
			lock (Netmap.__itemInLevelMarkersLock)
			{
				foreach (MarkerContext<ItemInLevel> resourceMarkers in Netmap.resourceMarkersList)
				{
					resourceMarkers.Remove();
				}
				foreach (MarkerContext<ItemInLevel> keyItemMarkers in Netmap.keyItemMarkersList)
				{
					keyItemMarkers.Remove();
				}
				foreach (MarkerContext<ItemInLevel> consumableMarkers in Netmap.consumableMarkersList)
				{
					consumableMarkers.Remove();
				}
				Netmap.resourceMarkersList.Clear();
				Netmap.keyItemMarkersList.Clear();
				Netmap.consumableMarkersList.Clear();
			}
			lock (Netmap.__objectsInLevelMarkersLock)
			{
				foreach (MarkerContext<LG_ComputerTerminal> terminalMarkers in Netmap.terminalMarkersList)
				{
					terminalMarkers.Remove();
				}
				foreach (MarkerContext<LG_HSU> hsuMarkers in Netmap.hsuMarkersList)
				{
					hsuMarkers.Remove();
				}
				foreach (MarkerContext<LG_BulkheadDoorController_Core> bulkheadMarkers in Netmap.bulkheadMarkersList)
				{
					bulkheadMarkers.Remove();
				}
				foreach (MarkerContext<LG_PowerGenerator_Core> generatorMarkers in Netmap.generatorMarkersList)
				{
					generatorMarkers.Remove();
				}
				foreach (MarkerContext<LG_ResourceContainer_Storage> containerMarkers in Netmap.containerMarkersList)
				{
					containerMarkers.Remove();
				}
				foreach (MarkerContext<LG_WeakDoor> doorMarkers in Netmap.doorMarkersList)
				{
					doorMarkers.Remove();
				}
				foreach (MarkerContext<LG_SecurityDoor> securityDoorMarkers in Netmap.securityDoorMarkersList)
				{
					securityDoorMarkers.Remove();
				}
				Netmap.terminalMarkersList.Clear();
				Netmap.hsuMarkersList.Clear();
				Netmap.bulkheadMarkersList.Clear();
				Netmap.generatorMarkersList.Clear();
				Netmap.containerMarkersList.Clear();
				Netmap.doorMarkersList.Clear();
				Netmap.securityDoorMarkersList.Clear();
			}
		}

		private static void RemovePermanentMarkers()
		{
			Logger.Info(" ** removing all permanent navigation markers");
			lock (Netmap.__objectsInLevelMarkersLock)
			{
				foreach (MarkerContext<LG_ComputerTerminal> permTerminalMarkers in Netmap.permTerminalMarkersList)
				{
					permTerminalMarkers.Remove();
				}
				foreach (MarkerContext<LG_HSU> permHsuMarkers in Netmap.permHsuMarkersList)
				{
					permHsuMarkers.Remove();
				}
				foreach (MarkerContext<LG_BulkheadDoorController_Core> permBulkheadMarkers in Netmap.permBulkheadMarkersList)
				{
					permBulkheadMarkers.Remove();
				}
				foreach (MarkerContext<LG_PowerGenerator_Core> permGeneratorMarkers in Netmap.permGeneratorMarkersList)
				{
					permGeneratorMarkers.Remove();
				}
				foreach (MarkerContext<LG_ResourceContainer_Storage> permContainerMarkers in Netmap.permContainerMarkersList)
				{
					permContainerMarkers.Remove();
				}
				foreach (MarkerContext<LG_WeakDoor> permDoorMarkers in Netmap.permDoorMarkersList)
				{
					permDoorMarkers.Remove();
				}
				foreach (MarkerContext<LG_SecurityDoor> permSecurityDoorMarkers in Netmap.permSecurityDoorMarkersList)
				{
					permSecurityDoorMarkers.Remove();
				}
				Netmap.permTerminalMarkersList.Clear();
				Netmap.permHsuMarkersList.Clear();
				Netmap.permBulkheadMarkersList.Clear();
				Netmap.permGeneratorMarkersList.Clear();
				Netmap.permDoorMarkersList.Clear();
				Netmap.permSecurityDoorMarkersList.Clear();
			}
		}
	}
	[GeneratedCode("VersionInfoGenerator", "2.0.0+git50a4b1a-master")]
	[CompilerGenerated]
	internal static class VersionInfo
	{
		public const string RootNamespace = "Santonian";

		public const string Version = "1.0.0";

		public const string VersionPrerelease = null;

		public const string VersionMetadata = "git882d91d-dirty-main";

		public const string SemVer = "1.0.0+git882d91d-dirty-main";

		public const string GitRevShort = "882d91d-dirty";

		public const string GitRevLong = "882d91d1e58629b1d0015e139ba5fa0158572d8a-dirty";

		public const string GitBranch = "main";

		public const string GitTag = null;

		public const bool GitIsDirty = true;
	}
}