Decompiled source of ServersideQoL AutoMapTables v2.4.1

ServersideQoL.AutoMapTables.dll

Decompiled 3 days ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Linq.Expressions;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using System.Text;
using BepInEx;
using BepInEx.Configuration;
using Microsoft.CodeAnalysis;
using ServersideQoL.Processors;
using ServersideQoL.Utilities;
using SoftReferenceableAssets;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("ArgusMagnus")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyCopyright("ArgusMagnus")]
[assembly: AssemblyDescription("Automatically update map tables with icons for portals, ships, ore deposits and more.")]
[assembly: AssemblyFileVersion("2.4.1.0")]
[assembly: AssemblyInformationalVersion("2.4.1+0f7454f795c3611da8d9e968e0cf3e4b7b95900e")]
[assembly: AssemblyProduct("ServersideQoL.AutoMapTables")]
[assembly: AssemblyTitle("ServersideQoL.AutoMapTables")]
[assembly: AssemblyMetadata("RepositoryUrl", "https://github.com/ArgusMagnus/ValheimServersideQoL")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("2.4.1.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
[CompilerGenerated]
internal sealed class <>z__ReadOnlyArray<T> : IEnumerable, ICollection, IList, IEnumerable<T>, IReadOnlyCollection<T>, IReadOnlyList<T>, ICollection<T>, IList<T>
{
	int ICollection.Count => _items.Length;

	bool ICollection.IsSynchronized => false;

	object ICollection.SyncRoot => this;

	object IList.this[int index]
	{
		get
		{
			return _items[index];
		}
		set
		{
			throw new NotSupportedException();
		}
	}

	bool IList.IsFixedSize => true;

	bool IList.IsReadOnly => true;

	int IReadOnlyCollection<T>.Count => _items.Length;

	T IReadOnlyList<T>.this[int index] => _items[index];

	int ICollection<T>.Count => _items.Length;

	bool ICollection<T>.IsReadOnly => true;

	T IList<T>.this[int index]
	{
		get
		{
			return _items[index];
		}
		set
		{
			throw new NotSupportedException();
		}
	}

	public <>z__ReadOnlyArray(T[] items)
	{
		_items = items;
	}

	IEnumerator IEnumerable.GetEnumerator()
	{
		return ((IEnumerable)_items).GetEnumerator();
	}

	void ICollection.CopyTo(Array array, int index)
	{
		((ICollection)_items).CopyTo(array, index);
	}

	int IList.Add(object value)
	{
		throw new NotSupportedException();
	}

	void IList.Clear()
	{
		throw new NotSupportedException();
	}

	bool IList.Contains(object value)
	{
		return ((IList)_items).Contains(value);
	}

	int IList.IndexOf(object value)
	{
		return ((IList)_items).IndexOf(value);
	}

	void IList.Insert(int index, object value)
	{
		throw new NotSupportedException();
	}

	void IList.Remove(object value)
	{
		throw new NotSupportedException();
	}

	void IList.RemoveAt(int index)
	{
		throw new NotSupportedException();
	}

	IEnumerator<T> IEnumerable<T>.GetEnumerator()
	{
		return ((IEnumerable<T>)_items).GetEnumerator();
	}

	void ICollection<T>.Add(T item)
	{
		throw new NotSupportedException();
	}

	void ICollection<T>.Clear()
	{
		throw new NotSupportedException();
	}

	bool ICollection<T>.Contains(T item)
	{
		return ((ICollection<T>)_items).Contains(item);
	}

	void ICollection<T>.CopyTo(T[] array, int arrayIndex)
	{
		((ICollection<T>)_items).CopyTo(array, arrayIndex);
	}

	bool ICollection<T>.Remove(T item)
	{
		throw new NotSupportedException();
	}

	int IList<T>.IndexOf(T item)
	{
		return ((IList<T>)_items).IndexOf(item);
	}

	void IList<T>.Insert(int index, T item)
	{
		throw new NotSupportedException();
	}

	void IList<T>.RemoveAt(int index)
	{
		throw new NotSupportedException();
	}
}
[CompilerGenerated]
internal sealed class <>z__ReadOnlySingleElementList<T> : IEnumerable, ICollection, IList, IEnumerable<T>, IReadOnlyCollection<T>, IReadOnlyList<T>, ICollection<T>, IList<T>
{
	private sealed class Enumerator : IDisposable, IEnumerator, IEnumerator<T>
	{
		object IEnumerator.Current => _item;

		T IEnumerator<T>.Current => _item;

		public Enumerator(T item)
		{
			_item = item;
		}

		bool IEnumerator.MoveNext()
		{
			if (!_moveNextCalled)
			{
				return _moveNextCalled = true;
			}
			return false;
		}

		void IEnumerator.Reset()
		{
			_moveNextCalled = false;
		}

		void IDisposable.Dispose()
		{
		}
	}

	int ICollection.Count => 1;

	bool ICollection.IsSynchronized => false;

	object ICollection.SyncRoot => this;

	object IList.this[int index]
	{
		get
		{
			if (index != 0)
			{
				throw new IndexOutOfRangeException();
			}
			return _item;
		}
		set
		{
			throw new NotSupportedException();
		}
	}

	bool IList.IsFixedSize => true;

	bool IList.IsReadOnly => true;

	int IReadOnlyCollection<T>.Count => 1;

	T IReadOnlyList<T>.this[int index]
	{
		get
		{
			if (index != 0)
			{
				throw new IndexOutOfRangeException();
			}
			return _item;
		}
	}

	int ICollection<T>.Count => 1;

	bool ICollection<T>.IsReadOnly => true;

	T IList<T>.this[int index]
	{
		get
		{
			if (index != 0)
			{
				throw new IndexOutOfRangeException();
			}
			return _item;
		}
		set
		{
			throw new NotSupportedException();
		}
	}

	public <>z__ReadOnlySingleElementList(T item)
	{
		_item = item;
	}

	IEnumerator IEnumerable.GetEnumerator()
	{
		return new Enumerator(_item);
	}

	void ICollection.CopyTo(Array array, int index)
	{
		array.SetValue(_item, index);
	}

	int IList.Add(object value)
	{
		throw new NotSupportedException();
	}

	void IList.Clear()
	{
		throw new NotSupportedException();
	}

	bool IList.Contains(object value)
	{
		return EqualityComparer<T>.Default.Equals(_item, (T)value);
	}

	int IList.IndexOf(object value)
	{
		if (!EqualityComparer<T>.Default.Equals(_item, (T)value))
		{
			return -1;
		}
		return 0;
	}

	void IList.Insert(int index, object value)
	{
		throw new NotSupportedException();
	}

	void IList.Remove(object value)
	{
		throw new NotSupportedException();
	}

	void IList.RemoveAt(int index)
	{
		throw new NotSupportedException();
	}

	IEnumerator<T> IEnumerable<T>.GetEnumerator()
	{
		return new Enumerator(_item);
	}

	void ICollection<T>.Add(T item)
	{
		throw new NotSupportedException();
	}

	void ICollection<T>.Clear()
	{
		throw new NotSupportedException();
	}

	bool ICollection<T>.Contains(T item)
	{
		return EqualityComparer<T>.Default.Equals(_item, item);
	}

	void ICollection<T>.CopyTo(T[] array, int arrayIndex)
	{
		array[arrayIndex] = _item;
	}

	bool ICollection<T>.Remove(T item)
	{
		throw new NotSupportedException();
	}

	int IList<T>.IndexOf(T item)
	{
		if (!EqualityComparer<T>.Default.Equals(_item, item))
		{
			return -1;
		}
		return 0;
	}

	void IList<T>.Insert(int index, T item)
	{
		throw new NotSupportedException();
	}

	void IList<T>.RemoveAt(int index)
	{
		throw new NotSupportedException();
	}
}
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[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]
	[Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableContextAttribute : Attribute
	{
		public readonly byte Flag;

		public NullableContextAttribute(byte P_0)
		{
			Flag = P_0;
		}
	}
	[CompilerGenerated]
	[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 ServersideQoL.AutoMapTables
{
	[BepInPlugin("ArgusMagnus.ServersideQoL.AutoMapTables", "ServersideQoL.AutoMapTables", "2.4.1")]
	public sealed class AutoMapTablesPlugin : ServersideQoLPluginBase<AutoMapTablesPlugin, Config>
	{
		public static readonly int PluginGuidHash = StringExtensionMethods.GetStableHashCode("ArgusMagnus.ServersideQoL.AutoMapTables");

		public const string Author = "ArgusMagnus";

		public const string PluginName = "ServersideQoL.AutoMapTables";

		public const string PluginGuid = "ArgusMagnus.ServersideQoL.AutoMapTables";

		public const string PluginVersion = "2.4.1";

		public const string PluginInformationalVersion = "2.4.1";

		private DateTimeOffset BuildTimestamp { get; } = new DateTimeOffset(639282659532006538L, default(TimeSpan));

		protected override Config CreateConfigSingleton(ConfigFile configFile, Logger logger)
		{
			return new Config(configFile, logger);
		}

		protected override void RegisterProcessors(IProcessorCollection processors)
		{
			processors.Add<AutoMapTablesProcessor>();
		}

		private void Awake()
		{
		}
	}
	[Processor("05450dd6-13bd-42cc-9bd3-b1eed5e501af")]
	[DependsOn<PlayerRegistryProcessor>]
	public sealed class AutoMapTablesProcessor : Processor<AutoMapTablesProcessor.PrefabInfo>
	{
		public sealed record PrefabInfo(MapTable? MapTable, PrivateArea? PrivateArea, TeleportWorld? TeleportWorld, Ship? Ship, MineRock5? MineRock5, LocationProxy? LocationProxy) : ProcessorPrefabInfo()
		{
			public Config.OreDepositConfig? MineRockPinConfig
			{
				get
				{
					Config.OreDepositConfig value;
					return <MineRockPinConfig>k__BackingField ?? (<MineRockPinConfig>k__BackingField = ((MineRock5 != null && ConfigBase<Config>.Instance.AutoUpdateOreDeposits.TryGetValue(((ProcessorPrefabInfo)this).PrefabInfo.PrefabHash, out value)) ? value : null));
				}
			}

			public Piece? Piece => <Piece>k__BackingField ?? (<Piece>k__BackingField = ((ProcessorPrefabInfo)this).PrefabInfo.GetComponent<Piece>());

			public override bool IsValid
			{
				get
				{
					if ((object)this != null)
					{
						PrivateArea privateArea = PrivateArea;
						if (privateArea == null)
						{
							TeleportWorld teleportWorld = TeleportWorld;
							if (teleportWorld == null)
							{
								Ship ship = Ship;
								if (ship == null)
								{
									MineRock5 mineRock = MineRock5;
									if (mineRock != null)
									{
										return (object)MineRockPinConfig != null;
									}
									goto IL_005b;
								}
							}
						}
						return Piece != null && ((ProcessorPrefabInfo)this).PrefabInfo.HasComponent<PieceTable>();
					}
					goto IL_005b;
					IL_005b:
					return true;
				}
			}

			[CompilerGenerated]
			private Config.OreDepositConfig? <MineRockPinConfig>k__BackingField;

			[CompilerGenerated]
			private Piece? <Piece>k__BackingField;

			[CompilerGenerated]
			public override string ToString()
			{
				StringBuilder stringBuilder = new StringBuilder();
				stringBuilder.Append("PrefabInfo");
				stringBuilder.Append(" { ");
				if (((ProcessorPrefabInfo)this).PrintMembers(stringBuilder))
				{
					stringBuilder.Append(' ');
				}
				stringBuilder.Append('}');
				return stringBuilder.ToString();
			}

			[CompilerGenerated]
			protected override bool PrintMembers(StringBuilder builder)
			{
				if (((ProcessorPrefabInfo)this).PrintMembers(builder))
				{
					builder.Append(", ");
				}
				builder.Append("MapTable = ");
				builder.Append(MapTable);
				builder.Append(", PrivateArea = ");
				builder.Append(PrivateArea);
				builder.Append(", TeleportWorld = ");
				builder.Append(TeleportWorld);
				builder.Append(", Ship = ");
				builder.Append(Ship);
				builder.Append(", MineRock5 = ");
				builder.Append(MineRock5);
				builder.Append(", LocationProxy = ");
				builder.Append(LocationProxy);
				builder.Append(", MineRockPinConfig = ");
				builder.Append(MineRockPinConfig);
				builder.Append(", Piece = ");
				builder.Append(Piece);
				return true;
			}

			[CompilerGenerated]
			public override int GetHashCode()
			{
				return (((((((((ProcessorPrefabInfo)this).GetHashCode() * -1521134295 + EqualityComparer<MapTable>.Default.GetHashCode(MapTable)) * -1521134295 + EqualityComparer<PrivateArea>.Default.GetHashCode(PrivateArea)) * -1521134295 + EqualityComparer<TeleportWorld>.Default.GetHashCode(TeleportWorld)) * -1521134295 + EqualityComparer<Ship>.Default.GetHashCode(Ship)) * -1521134295 + EqualityComparer<MineRock5>.Default.GetHashCode(MineRock5)) * -1521134295 + EqualityComparer<LocationProxy>.Default.GetHashCode(LocationProxy)) * -1521134295 + EqualityComparer<Config.OreDepositConfig>.Default.GetHashCode(<MineRockPinConfig>k__BackingField)) * -1521134295 + EqualityComparer<Piece>.Default.GetHashCode(<Piece>k__BackingField);
			}

			[CompilerGenerated]
			public sealed override bool Equals(ProcessorPrefabInfo? other)
			{
				return ((object)this).Equals((object?)other);
			}

			[CompilerGenerated]
			public bool Equals(PrefabInfo? other)
			{
				if ((object)this != other)
				{
					if (((ProcessorPrefabInfo)this).Equals((ProcessorPrefabInfo)(object)other) && EqualityComparer<MapTable>.Default.Equals(MapTable, other.MapTable) && EqualityComparer<PrivateArea>.Default.Equals(PrivateArea, other.PrivateArea) && EqualityComparer<TeleportWorld>.Default.Equals(TeleportWorld, other.TeleportWorld) && EqualityComparer<Ship>.Default.Equals(Ship, other.Ship) && EqualityComparer<MineRock5>.Default.Equals(MineRock5, other.MineRock5) && EqualityComparer<LocationProxy>.Default.Equals(LocationProxy, other.LocationProxy) && EqualityComparer<Config.OreDepositConfig>.Default.Equals(<MineRockPinConfig>k__BackingField, other.<MineRockPinConfig>k__BackingField))
					{
						return EqualityComparer<Piece>.Default.Equals(<Piece>k__BackingField, other.<Piece>k__BackingField);
					}
					return false;
				}
				return true;
			}

			[CompilerGenerated]
			private PrefabInfo(PrefabInfo original)
				: base((ProcessorPrefabInfo)(object)original)
			{
				MapTable = original.MapTable;
				PrivateArea = original.PrivateArea;
				TeleportWorld = original.TeleportWorld;
				Ship = original.Ship;
				MineRock5 = original.MineRock5;
				LocationProxy = original.LocationProxy;
				<MineRockPinConfig>k__BackingField = original.<MineRockPinConfig>k__BackingField;
				<Piece>k__BackingField = original.<Piece>k__BackingField;
			}
		}

		private readonly record struct Pin(PlayerID OwnerId, string Tag, Vector3 Pos, PinType Type, bool IsChecked, string Author)
		{
			[CompilerGenerated]
			public void Deconstruct(out PlayerID OwnerId, out string Tag, out Vector3 Pos, out PinType Type, out bool IsChecked, out string Author)
			{
				//IL_0002: Unknown result type (might be due to invalid IL or missing references)
				//IL_0007: Unknown result type (might be due to invalid IL or missing references)
				//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)
				//IL_0023: Unknown result type (might be due to invalid IL or missing references)
				//IL_0029: Expected I4, but got Unknown
				OwnerId = this.OwnerId;
				Tag = this.Tag;
				Pos = this.Pos;
				Type = (PinType)(int)this.Type;
				IsChecked = this.IsChecked;
				Author = this.Author;
			}
		}

		private sealed class PlayerState(PlayerID playerID)
		{
			[CompilerGenerated]
			private HashSet<ServersideQoLZDO> <UpToDateMapTables>k__BackingField;

			[CompilerGenerated]
			private HashSet<ServersideQoLZDO> <Portals>k__BackingField;

			[CompilerGenerated]
			private HashSet<ServersideQoLZDO> <Ships>k__BackingField;

			[CompilerGenerated]
			private HashSet<ServersideQoLZDO> <OreVeins>k__BackingField;

			[CompilerGenerated]
			private Dictionary<ServersideQoLZDO, (Vector3, string)?> <Dungeons>k__BackingField;

			public PlayerID PlayerID { get; } = playerID;

			public HashSet<ServersideQoLZDO> UpToDateMapTables => <UpToDateMapTables>k__BackingField ?? (<UpToDateMapTables>k__BackingField = new HashSet<ServersideQoLZDO>());

			public HashSet<ServersideQoLZDO> Portals => <Portals>k__BackingField ?? (<Portals>k__BackingField = new HashSet<ServersideQoLZDO>());

			public HashSet<ServersideQoLZDO> Ships => <Ships>k__BackingField ?? (<Ships>k__BackingField = new HashSet<ServersideQoLZDO>());

			public HashSet<ServersideQoLZDO> OreVeins => <OreVeins>k__BackingField ?? (<OreVeins>k__BackingField = new HashSet<ServersideQoLZDO>());

			public Dictionary<ServersideQoLZDO, (Vector3, string)?> Dungeons => <Dungeons>k__BackingField ?? (<Dungeons>k__BackingField = new Dictionary<ServersideQoLZDO, (Vector3, string)?>());
		}

		private sealed class MapTableState(ServersideQoLZDO zdo)
		{
			public ServersideQoLZDO ZDO { get; } = zdo;

			public uint LastDataRevision { get; set; }

			public HashSet<ServersideQoLZDO>? Wards { get; set; }

			public HashSet<PlayerID>? PermittedPlayerIDs { get; set; }
		}

		public const string Id = "05450dd6-13bd-42cc-9bd3-b1eed5e501af";

		private readonly Dictionary<ServersideQoLZDO, MapTableState> _mapTables = new Dictionary<ServersideQoLZDO, MapTableState>();

		private readonly Dictionary<PlayerID, PlayerState> _playerStates = new Dictionary<PlayerID, PlayerState>();

		private readonly HashSet<ServersideQoLZDO> _wards = new HashSet<ServersideQoLZDO>();

		private readonly Dictionary<ServersideQoLZDO, Vector3> _shipPositions = new Dictionary<ServersideQoLZDO, Vector3>();

		private readonly Dictionary<PlayerID, (Peer Peer, PlayerState PlayerState)> _updateList = new Dictionary<PlayerID, (Peer, PlayerState)>();

		private readonly List<Pin> _pins = new List<Pin>();

		private readonly HashSet<(PinType, string)> _oreDepositPins = new HashSet<(PinType, string)>();

		private byte[]? _emptyExplored;

		private float _mapTableRangeSqr;

		private float _oreDepositRangeSqr;

		private float _dungeonRangeSqr;

		private static readonly ServerVar<HashSet<PlayerID>> __playerIDsVar = ServersideQoLPluginBaseCore<AutoMapTablesPlugin, Config>.RegisterServerVar<HashSet<PlayerID>>("PlayerIDs");

		protected override void Initialize()
		{
			//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ac: Invalid comparison between Unknown and I4
			//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0413: Unknown result type (might be due to invalid IL or missing references)
			//IL_0419: Unknown result type (might be due to invalid IL or missing references)
			//IL_0217: Unknown result type (might be due to invalid IL or missing references)
			//IL_021c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0222: Unknown result type (might be due to invalid IL or missing references)
			//IL_0228: Unknown result type (might be due to invalid IL or missing references)
			//IL_022a: Unknown result type (might be due to invalid IL or missing references)
			//IL_025c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0261: Unknown result type (might be due to invalid IL or missing references)
			//IL_0267: Unknown result type (might be due to invalid IL or missing references)
			//IL_026d: Unknown result type (might be due to invalid IL or missing references)
			//IL_026f: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0481: Unknown result type (might be due to invalid IL or missing references)
			//IL_048d: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0345: Unknown result type (might be due to invalid IL or missing references)
			//IL_034a: Unknown result type (might be due to invalid IL or missing references)
			//IL_034d: Unknown result type (might be due to invalid IL or missing references)
			//IL_038d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0393: Invalid comparison between Unknown and I4
			//IL_0397: Unknown result type (might be due to invalid IL or missing references)
			//IL_039c: Unknown result type (might be due to invalid IL or missing references)
			//IL_03c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_03c8: Unknown result type (might be due to invalid IL or missing references)
			_mapTableRangeSqr = ConfigBase<Config>.Instance.MapTableRange.Value * ConfigBase<Config>.Instance.MapTableRange.Value;
			_oreDepositRangeSqr = ConfigBase<Config>.Instance.OreDepositsDiscoverRange.Value * ConfigBase<Config>.Instance.OreDepositsDiscoverRange.Value;
			_dungeonRangeSqr = ConfigBase<Config>.Instance.DungeonsDiscoverRange.Value * ConfigBase<Config>.Instance.DungeonsDiscoverRange.Value;
			_oreDepositPins.Clear();
			foreach (var (val3, val4) in ConfigBase<Config>.Instance.AutoUpdateOreDeposits.Values)
			{
				if ((int)val3.Value != 8)
				{
					_oreDepositPins.Add((val3.Value, val4.Value));
				}
			}
			_mapTables.Clear();
			_playerStates.Clear();
			_wards.Clear();
			_shipPositions.Clear();
			foreach (ServersideQoLZDO item in ZDOMan.instance.m_objectsByID.Values.Select((ZDO x) => x.ServersideQoLZDO))
			{
				PrefabInfo processorPrefabInfo = Processor<PrefabInfo>.GetProcessorPrefabInfo(item);
				if ((object)processorPrefabInfo == null)
				{
					continue;
				}
				MapTable mapTable = processorPrefabInfo.MapTable;
				if (mapTable == null)
				{
					PrivateArea privateArea = processorPrefabInfo.PrivateArea;
					if (privateArea == null)
					{
						TeleportWorld teleportWorld = processorPrefabInfo.TeleportWorld;
						ZDOVars vars;
						if (teleportWorld == null)
						{
							Ship ship = processorPrefabInfo.Ship;
							if (ship == null)
							{
								Config.OreDepositConfig mineRockPinConfig = processorPrefabInfo.MineRockPinConfig;
								if ((object)mineRockPinConfig == null)
								{
									LocationProxy locationProxy = processorPrefabInfo.LocationProxy;
									if (locationProxy == null)
									{
										continue;
									}
									HashSet<PlayerID> hashSet = __playerIDsVar.Get(item, (HashSet<PlayerID>)null);
									if (hashSet == null)
									{
										continue;
									}
									foreach (PlayerID item2 in hashSet)
									{
										GetOrAddPlayerState(item2).Dungeons.Add(item, null);
									}
									if ((int)ConfigBase<Config>.Instance.DungeonsPinType.Value == 8)
									{
										continue;
									}
									vars = item.Vars;
									int location = ((ZDOVars)(ref vars)).GetLocation(0);
									if (location != 0 && ZoneSystem.instance.m_locationsByHash.TryGetValue(location, out var value))
									{
										SoftReference<GameObject> prefab = value.m_prefab;
										if (prefab.IsValid && !prefab.IsLoaded && !prefab.IsLoading)
										{
											value.m_prefab.LoadAsync();
										}
									}
								}
								else
								{
									if (Character.InInterior(item.ZDO.GetPosition()))
									{
										continue;
									}
									item.Destroyed += OnOreDepositDestroyed;
									HashSet<PlayerID> hashSet2 = __playerIDsVar.Get(item, (HashSet<PlayerID>)null);
									if (hashSet2 == null)
									{
										continue;
									}
									foreach (PlayerID item3 in hashSet2)
									{
										GetOrAddPlayerState(item3).OreVeins.Add(item);
									}
								}
							}
							else
							{
								vars = item.Vars;
								GetOrAddPlayerState(((ZDOVars)(ref vars)).GetCreator(default(PlayerID))).Ships.Add(item);
								item.Destroyed += OnShipDestroyed;
							}
						}
						else
						{
							vars = item.Vars;
							GetOrAddPlayerState(((ZDOVars)(ref vars)).GetCreator(default(PlayerID))).Portals.Add(item);
							item.Destroyed += OnPortalDestroyed;
						}
					}
					else
					{
						_wards.Add(item);
						item.Destroyed += OnWardDestroyed;
					}
				}
				else
				{
					_mapTables.Add(item, new MapTableState(item));
					item.Destroyed += OnMapTableDestroyed;
				}
			}
			_playerStates.Remove(default(PlayerID));
			if (_wards.Count == 0)
			{
				return;
			}
			foreach (KeyValuePair<ServersideQoLZDO, MapTableState> mapTable2 in _mapTables)
			{
				mapTable2.Deconstruct(out var key, out var value2);
				ServersideQoLZDO val5 = key;
				MapTableState mapTableState = value2;
				foreach (ServersideQoLZDO ward in _wards)
				{
					if (!(Utils.DistanceXZ(ward.ZDO.GetPosition(), val5.ZDO.GetPosition()) > ward.Fields<PrivateArea>().GetFloat((Func<Expression<Func<PrivateArea, float>>>)(() => (PrivateArea x) => x.m_radius), "C:\\repos\\Valheim.ServersideQoL\\ServersideQoL.AutoMapTables\\AutoMapTablesProcessor.cs", 124)))
					{
						value2 = mapTableState;
						(value2.Wards ?? (value2.Wards = new HashSet<ServersideQoLZDO>())).Add(ward);
					}
				}
				UpdateMapTablePermittedPlayerIDs(mapTableState);
			}
		}

		protected unsafe override ProcessResult Process(ServersideQoLZDO zdo, IReadOnlyList<Peer> peers, PrefabInfo prefabInfo)
		{
			//IL_00f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fe: Unknown result type (might be due to invalid IL or missing references)
			//IL_0103: Unknown result type (might be due to invalid IL or missing references)
			//IL_03cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_03d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_03d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_03dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_03de: Unknown result type (might be due to invalid IL or missing references)
			//IL_03e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0465: Unknown result type (might be due to invalid IL or missing references)
			//IL_046a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0470: Unknown result type (might be due to invalid IL or missing references)
			//IL_0476: Unknown result type (might be due to invalid IL or missing references)
			//IL_0478: Unknown result type (might be due to invalid IL or missing references)
			//IL_047d: Unknown result type (might be due to invalid IL or missing references)
			//IL_044a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0410: Unknown result type (might be due to invalid IL or missing references)
			//IL_0060: Unknown result type (might be due to invalid IL or missing references)
			//IL_006b: Unknown result type (might be due to invalid IL or missing references)
			//IL_09f6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0741: Unknown result type (might be due to invalid IL or missing references)
			//IL_0746: Unknown result type (might be due to invalid IL or missing references)
			//IL_0524: Unknown result type (might be due to invalid IL or missing references)
			//IL_04aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_04bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_04c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_09f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_012a: Unknown result type (might be due to invalid IL or missing references)
			//IL_075f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0764: 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_03b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_0563: Unknown result type (might be due to invalid IL or missing references)
			//IL_0568: Unknown result type (might be due to invalid IL or missing references)
			//IL_056c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0571: Unknown result type (might be due to invalid IL or missing references)
			//IL_0559: Unknown result type (might be due to invalid IL or missing references)
			//IL_0510: Unknown result type (might be due to invalid IL or missing references)
			//IL_04f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_04f6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0144: Unknown result type (might be due to invalid IL or missing references)
			//IL_0149: Unknown result type (might be due to invalid IL or missing references)
			//IL_0275: Unknown result type (might be due to invalid IL or missing references)
			//IL_027a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0770: Unknown result type (might be due to invalid IL or missing references)
			//IL_0179: Unknown result type (might be due to invalid IL or missing references)
			//IL_078a: Unknown result type (might be due to invalid IL or missing references)
			//IL_078f: Unknown result type (might be due to invalid IL or missing references)
			//IL_09f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0167: Unknown result type (might be due to invalid IL or missing references)
			//IL_019f: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_07b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_07c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_07d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_07d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_07dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_07e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_07e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0598: Unknown result type (might be due to invalid IL or missing references)
			//IL_01be: Unknown result type (might be due to invalid IL or missing references)
			//IL_07f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_07f6: Unknown result type (might be due to invalid IL or missing references)
			//IL_07fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_07ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_09df: Unknown result type (might be due to invalid IL or missing references)
			//IL_09e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_072f: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e7: 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_05b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_05bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_05c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_020a: Unknown result type (might be due to invalid IL or missing references)
			//IL_05dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0826: Unknown result type (might be due to invalid IL or missing references)
			//IL_0638: Unknown result type (might be due to invalid IL or missing references)
			//IL_064b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0651: Invalid comparison between Unknown and I4
			//IL_0687: Unknown result type (might be due to invalid IL or missing references)
			//IL_0840: Unknown result type (might be due to invalid IL or missing references)
			//IL_0845: Unknown result type (might be due to invalid IL or missing references)
			//IL_084d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0854: Unknown result type (might be due to invalid IL or missing references)
			//IL_086a: Unknown result type (might be due to invalid IL or missing references)
			//IL_087b: Unknown result type (might be due to invalid IL or missing references)
			//IL_06eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_06f6: Unknown result type (might be due to invalid IL or missing references)
			//IL_08b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_08c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_08cd: Invalid comparison between Unknown and I4
			//IL_08ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_0985: Unknown result type (might be due to invalid IL or missing references)
			//IL_0990: Unknown result type (might be due to invalid IL or missing references)
			if (prefabInfo.MapTable != null)
			{
				if (!_mapTables.TryGetValue(zdo, out MapTableState value))
				{
					_mapTables.Add(zdo, value = new MapTableState(zdo));
					zdo.Destroyed += OnMapTableDestroyed;
					foreach (ServersideQoLZDO ward in _wards)
					{
						if (!(Utils.DistanceXZ(ward.ZDO.GetPosition(), zdo.ZDO.GetPosition()) > ward.Fields<PrivateArea>().GetFloat((Func<Expression<Func<PrivateArea, float>>>)(() => (PrivateArea x) => x.m_radius), "C:\\repos\\Valheim.ServersideQoL\\ServersideQoL.AutoMapTables\\AutoMapTablesProcessor.cs", 148)))
						{
							MapTableState mapTableState = value;
							(mapTableState.Wards ?? (mapTableState.Wards = new HashSet<ServersideQoLZDO>())).Add(ward);
						}
					}
					UpdateMapTablePermittedPlayerIDs(value);
				}
				Enumerator<Peer> enumerator2 = ListExtensions.Enumerate<Peer>(peers).GetEnumerator();
				try
				{
					while (enumerator2.MoveNext())
					{
						Peer current2 = enumerator2.Current;
						PlayerState playerState = current2.PlayerState;
						PlayerID? val = ((playerState != null) ? new PlayerID?(playerState.PlayerID) : ((PlayerID?)null));
						if (val.HasValue)
						{
							PlayerID valueOrDefault = val.GetValueOrDefault();
							HashSet<PlayerID> permittedPlayerIDs = value.PermittedPlayerIDs;
							if ((permittedPlayerIDs == null || permittedPlayerIDs.Count <= 0 || value.PermittedPlayerIDs.Contains(valueOrDefault)) && _playerStates.TryGetValue(valueOrDefault, out PlayerState value2) && !value2.UpToDateMapTables.Contains(zdo) && !(Utils.DistanceSqr(zdo.ZDO.GetPosition(), current2.RefPos) > _mapTableRangeSqr) && !_updateList.TryAdd(valueOrDefault, (current2, value2)) && current2.ZNetPeer.m_rpc.GetTimeSinceLastPing() < _updateList[valueOrDefault].Peer.ZNetPeer.m_rpc.GetTimeSinceLastPing())
							{
								_updateList[valueOrDefault] = (current2, value2);
							}
						}
					}
				}
				finally
				{
					((IDisposable)enumerator2/*cast due to .constrained prefix*/).Dispose();
				}
				if (_updateList.Count > 0 || value.LastDataRevision != zdo.ZDO.DataRevision)
				{
					UpdateMapTable(value, _updateList);
					_updateList.Clear();
				}
				return ((Processor)this).ScheduleReprocessing(1f);
			}
			if (prefabInfo.PrivateArea != null)
			{
				if (_wards.Add(zdo))
				{
					zdo.Destroyed += OnWardDestroyed;
					foreach (KeyValuePair<ServersideQoLZDO, MapTableState> mapTable in _mapTables)
					{
						mapTable.Deconstruct(out var key, out var mapTableState);
						ServersideQoLZDO val2 = key;
						MapTableState mapTableState2 = mapTableState;
						if (!(Utils.DistanceXZ(zdo.ZDO.GetPosition(), val2.ZDO.GetPosition()) > zdo.Fields<PrivateArea>().GetFloat((Func<Expression<Func<PrivateArea, float>>>)(() => (PrivateArea x) => x.m_radius), "C:\\repos\\Valheim.ServersideQoL\\ServersideQoL.AutoMapTables\\AutoMapTablesProcessor.cs", 189)))
						{
							mapTableState = mapTableState2;
							(mapTableState.Wards ?? (mapTableState.Wards = new HashSet<ServersideQoLZDO>())).Add(zdo);
						}
					}
				}
				foreach (MapTableState value4 in _mapTables.Values)
				{
					UpdateMapTablePermittedPlayerIDs(value4);
				}
				return (ProcessResult)0;
			}
			ZDOVars vars;
			if (prefabInfo.TeleportWorld != null)
			{
				vars = zdo.Vars;
				PlayerID playerID = ((ZDOVars)(ref vars)).GetCreator(default(PlayerID));
				if (((PlayerID)(ref playerID)).Value == 0L)
				{
					return (ProcessResult)2;
				}
				if (peers.Any(delegate(Peer x)
				{
					//IL_000c: Unknown result type (might be due to invalid IL or missing references)
					//IL_0012: Unknown result type (might be due to invalid IL or missing references)
					PlayerState playerState4 = x.PlayerState;
					return playerState4 != null && playerState4.PlayerID == playerID;
				}))
				{
					PlayerState orAddPlayerState = GetOrAddPlayerState(playerID);
					if (orAddPlayerState.Portals.Add(zdo))
					{
						zdo.Destroyed += OnPortalDestroyed;
						orAddPlayerState.UpToDateMapTables.Clear();
					}
				}
				return (ProcessResult)0;
			}
			if (prefabInfo.Ship != null)
			{
				vars = zdo.Vars;
				PlayerID playerID2 = ((ZDOVars)(ref vars)).GetCreator(default(PlayerID));
				if (((PlayerID)(ref playerID2)).Value == 0L)
				{
					return (ProcessResult)2;
				}
				if (peers.Any(delegate(Peer x)
				{
					//IL_000c: Unknown result type (might be due to invalid IL or missing references)
					//IL_0012: Unknown result type (might be due to invalid IL or missing references)
					PlayerState playerState4 = x.PlayerState;
					return playerState4 != null && playerState4.PlayerID == playerID2;
				}))
				{
					PlayerState orAddPlayerState2 = GetOrAddPlayerState(playerID2);
					Vector3 position = zdo.ZDO.GetPosition();
					if (orAddPlayerState2.Ships.Add(zdo))
					{
						zdo.Destroyed += OnShipDestroyed;
					}
					if (!_shipPositions.TryGetValue(zdo, out var value3) || Utils.DistanceXZ(position, value3) >= Minimap.instance.m_pixelSize)
					{
						_shipPositions[zdo] = position;
						orAddPlayerState2.UpToDateMapTables.Clear();
					}
				}
				return (ProcessResult)0;
			}
			if ((object)prefabInfo != null && prefabInfo.MineRock5 != null && (object)prefabInfo.MineRockPinConfig != null)
			{
				if (Character.InInterior(zdo.ZDO.GetPosition()))
				{
					return (ProcessResult)2;
				}
				HashSet<PlayerID> hashSet3 = null;
				Enumerator<Peer> enumerator5 = ListExtensions.Enumerate<Peer>(peers).GetEnumerator();
				try
				{
					while (enumerator5.MoveNext())
					{
						Peer current4 = enumerator5.Current;
						PlayerState playerState2 = current4.PlayerState;
						PlayerID? val = ((playerState2 != null) ? new PlayerID?(playerState2.PlayerID) : ((PlayerID?)null));
						if (!val.HasValue)
						{
							continue;
						}
						PlayerID valueOrDefault2 = val.GetValueOrDefault();
						if (Utils.DistanceSqr(zdo.ZDO.GetPosition(), current4.RefPos) > _oreDepositRangeSqr)
						{
							continue;
						}
						PlayerState orAddPlayerState3 = GetOrAddPlayerState(valueOrDefault2);
						if (!orAddPlayerState3.OreVeins.Add(zdo))
						{
							continue;
						}
						zdo.Destroyed -= OnOreDepositDestroyed;
						zdo.Destroyed += OnOreDepositDestroyed;
						if (hashSet3 == null)
						{
							hashSet3 = __playerIDsVar.Get(zdo, (HashSet<PlayerID>)null) ?? new HashSet<PlayerID>();
						}
						hashSet3.Add(valueOrDefault2);
						if ((int)prefabInfo.MineRockPinConfig.PinType.Value != 8)
						{
							Processor.ShowMessage((IEnumerable<Peer>)new <>z__ReadOnlySingleElementList<Peer>(current4), zdo, ConfigBase<Config>.Instance.Localization.Value.Discovered(prefabInfo.MineRock5.m_name), ConfigBase<Config>.Instance.DiscoveredMessageType.Value, (TextType)0);
							if ((ConfigBase<Config>.Instance.OreDepositsPinTarget.Value & Config.PinTargets.MapTable) != 0)
							{
								orAddPlayerState3.UpToDateMapTables.Clear();
							}
							if ((ConfigBase<Config>.Instance.OreDepositsPinTarget.Value & Config.PinTargets.DiscoveringPlayer) != 0)
							{
								RPC.DiscoverLocationResponse(current4.ZNetPeer.m_uid, prefabInfo.MineRockPinConfig.Label.Value, prefabInfo.MineRockPinConfig.PinType.Value, zdo.ZDO.GetPosition(), false);
							}
						}
					}
				}
				finally
				{
					((IDisposable)enumerator5/*cast due to .constrained prefix*/).Dispose();
				}
				if (hashSet3 != null)
				{
					__playerIDsVar.Set(zdo, hashSet3);
				}
				return (ProcessResult)0;
			}
			if (prefabInfo.LocationProxy != null)
			{
				vars = zdo.Vars;
				int location = ((ZDOVars)(ref vars)).GetLocation(0);
				if (location == 0)
				{
					return (ProcessResult)0;
				}
				Location andLoadLocationByHash = PrivateAccessor.GetAndLoadLocationByHash(ZoneSystem.instance, location);
				try
				{
					if (!((Location)(ref andLoadLocationByHash)).IsValid)
					{
						return (ProcessResult)2;
					}
					GameObject prefab = ((Location)(ref andLoadLocationByHash)).Prefab;
					if (prefab == null)
					{
						return ((Processor)this).ScheduleReprocessing(0f);
					}
					HashSet<PlayerID> hashSet4 = null;
					Teleport[] componentsInChildren = prefab.GetComponentsInChildren<Teleport>();
					foreach (Teleport val3 in componentsInChildren)
					{
						Vector3 val4 = zdo.ZDO.GetPosition() + zdo.ZDO.GetRotation() * ((Component)val3).gameObject.transform.position;
						if (Character.InInterior(val4))
						{
							continue;
						}
						Enumerator<Peer> enumerator6 = ListExtensions.Enumerate<Peer>(peers).GetEnumerator();
						try
						{
							while (enumerator6.MoveNext())
							{
								Peer current5 = enumerator6.Current;
								PlayerState playerState3 = current5.PlayerState;
								PlayerID? val = ((playerState3 != null) ? new PlayerID?(playerState3.PlayerID) : ((PlayerID?)null));
								if (!val.HasValue)
								{
									continue;
								}
								PlayerID valueOrDefault3 = val.GetValueOrDefault();
								if (Utils.DistanceSqr(zdo.ZDO.GetPosition(), current5.RefPos) > _dungeonRangeSqr)
								{
									continue;
								}
								PlayerState orAddPlayerState4 = GetOrAddPlayerState(valueOrDefault3);
								if (!orAddPlayerState4.Dungeons.TryAdd(zdo, (val4, val3.m_enterText)))
								{
									continue;
								}
								if (hashSet4 == null)
								{
									hashSet4 = __playerIDsVar.Get(zdo, (HashSet<PlayerID>)null) ?? new HashSet<PlayerID>();
								}
								hashSet4.Add(valueOrDefault3);
								if ((int)ConfigBase<Config>.Instance.DungeonsPinType.Value != 8)
								{
									Processor.ShowMessage((IEnumerable<Peer>)new <>z__ReadOnlySingleElementList<Peer>(current5), zdo, ConfigBase<Config>.Instance.Localization.Value.Discovered(val3.m_enterText), ConfigBase<Config>.Instance.DiscoveredMessageType.Value, (TextType)0);
									if ((ConfigBase<Config>.Instance.DungeonsPinTarget.Value & Config.PinTargets.MapTable) != 0)
									{
										orAddPlayerState4.UpToDateMapTables.Clear();
									}
									if ((ConfigBase<Config>.Instance.DungeonsPinTarget.Value & Config.PinTargets.DiscoveringPlayer) != 0)
									{
										RPC.DiscoverLocationResponse(current5.ZNetPeer.m_uid, (ConfigBase<Config>.Instance.DungeonsLabel.Value == "Default") ? val3.m_enterText : ConfigBase<Config>.Instance.DungeonsLabel.Value, ConfigBase<Config>.Instance.DungeonsPinType.Value, zdo.ZDO.GetPosition(), false);
									}
								}
							}
						}
						finally
						{
							((IDisposable)enumerator6/*cast due to .constrained prefix*/).Dispose();
						}
						break;
					}
					if (hashSet4 != null)
					{
						__playerIDsVar.Set(zdo, hashSet4);
					}
					return ((Processor)this).ScheduleReprocessing(0.5f);
				}
				finally
				{
					((IDisposable)(*(Location*)(&andLoadLocationByHash))/*cast due to .constrained prefix*/).Dispose();
				}
			}
			return (ProcessResult)2;
		}

		private PlayerState GetOrAddPlayerState(PlayerID playerID)
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			if (!_playerStates.TryGetValue(playerID, out PlayerState value))
			{
				_playerStates.Add(playerID, value = new PlayerState(playerID));
			}
			return value;
		}

		private static void AddPermittedPlayerIDs(ServersideQoLZDO ward, HashSet<PlayerID> permittedPlayerIDs)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//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_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: 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_0066: Unknown result type (might be due to invalid IL or missing references)
			ZDOVars vars = ward.Vars;
			permittedPlayerIDs.Add(((ZDOVars)(ref vars)).GetCreator(default(PlayerID)));
			vars = ward.Vars;
			int permitted = ((ZDOVars)(ref vars)).GetPermitted(0);
			for (int i = 0; i < permitted; i++)
			{
				long num = ward.ZDO.GetLong(FormattableString.Invariant($"pu_id{i}"), 0L);
				if (num != 0L)
				{
					permittedPlayerIDs.Add(new PlayerID(num));
				}
			}
		}

		private void UpdateMapTablePermittedPlayerIDs(MapTableState state)
		{
			//IL_0084: 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)
			foreach (PlayerState value in _playerStates.Values)
			{
				value.UpToDateMapTables.Remove(state.ZDO);
			}
			state.PermittedPlayerIDs?.Clear();
			HashSet<ServersideQoLZDO> wards = state.Wards;
			if (wards == null || wards.Count <= 0)
			{
				return;
			}
			foreach (ServersideQoLZDO ward in state.Wards)
			{
				ZDOVars vars = ward.Vars;
				if (((ZDOVars)(ref vars)).GetEnabled(false))
				{
					AddPermittedPlayerIDs(ward, state.PermittedPlayerIDs ?? (state.PermittedPlayerIDs = new HashSet<PlayerID>()));
				}
			}
		}

		private unsafe void UpdateMapTable(MapTableState state, Dictionary<PlayerID, (Peer, PlayerState)> peers)
		{
			//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_0035: 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_0038: Invalid comparison between Unknown and I4
			//IL_004d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b9: Invalid comparison between Unknown and I4
			//IL_024f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0255: Invalid comparison between Unknown and I4
			//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fe: Unknown result type (might be due to invalid IL or missing references)
			//IL_0103: Unknown result type (might be due to invalid IL or missing references)
			//IL_03f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_03fe: Invalid comparison between Unknown and I4
			//IL_0111: Unknown result type (might be due to invalid IL or missing references)
			//IL_01df: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0208: Unknown result type (might be due to invalid IL or missing references)
			//IL_0217: Unknown result type (might be due to invalid IL or missing references)
			//IL_0142: Unknown result type (might be due to invalid IL or missing references)
			//IL_027b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0280: Unknown result type (might be due to invalid IL or missing references)
			//IL_0284: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_06df: Unknown result type (might be due to invalid IL or missing references)
			//IL_06e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0702: Unknown result type (might be due to invalid IL or missing references)
			//IL_070f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0719: Expected I4, but got Unknown
			//IL_0752: Unknown result type (might be due to invalid IL or missing references)
			//IL_0757: Unknown result type (might be due to invalid IL or missing references)
			//IL_07c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0464: Unknown result type (might be due to invalid IL or missing references)
			//IL_0469: Unknown result type (might be due to invalid IL or missing references)
			//IL_0482: Unknown result type (might be due to invalid IL or missing references)
			//IL_0487: Unknown result type (might be due to invalid IL or missing references)
			//IL_0566: Unknown result type (might be due to invalid IL or missing references)
			//IL_056b: Unknown result type (might be due to invalid IL or missing references)
			//IL_056f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0352: Unknown result type (might be due to invalid IL or missing references)
			//IL_0358: Invalid comparison between Unknown and I4
			//IL_05ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_05bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_036f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0374: Unknown result type (might be due to invalid IL or missing references)
			//IL_0378: Unknown result type (might be due to invalid IL or missing references)
			//IL_060d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0612: Unknown result type (might be due to invalid IL or missing references)
			//IL_0624: Unknown result type (might be due to invalid IL or missing references)
			//IL_04c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_04d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_04e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_04e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_04ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_04f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_04f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_03b1: 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_050f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0522: Unknown result type (might be due to invalid IL or missing references)
			ZPackage instance = SingletonCache<ZPackage>.Instance;
			ZDOVars vars = state.ZDO.Vars;
			byte[] array = ((ZDOVars)(ref vars)).GetData((byte[])null);
			PlayerID val2;
			if (array != null)
			{
				array = Utils.Decompress(array);
				instance.Load(array);
				SharedMap val = (SharedMap)instance.ReadInt();
				if ((int)val != 3)
				{
					((Processor)this).Logger.LogWarning((object)FormattableString.Invariant($"MapTable data version {val:D} [{val}] is not supported"));
					return;
				}
				array = instance.ReadByteArray();
				if (array.Length != Minimap.instance.m_textureSize * Minimap.instance.m_textureSize)
				{
					((Processor)this).Logger.LogWarning((object)"Invalid explored map data length");
					array = null;
				}
				int num = instance.ReadInt();
				if (_pins.Capacity < num)
				{
					_pins.Capacity = num;
				}
				PlayerID key = default(PlayerID);
				for (int i = 0; i < num; i++)
				{
					Pin item = new Pin(new PlayerID(instance.ReadLong()), instance.ReadString(), instance.ReadVector3(), (PinType)instance.ReadInt(), instance.ReadBool(), instance.ReadString());
					val2 = item.OwnerId;
					if (((PlayerID)(ref val2)).IsModPlayerID(ref key))
					{
						if (!peers.ContainsKey(key))
						{
							_pins.Add(item);
						}
					}
					else if (!ConfigBase<Config>.Instance.DiscardPlayerPins.Value || _oreDepositPins.Contains((item.Type, item.Tag)))
					{
						_pins.Add(item);
					}
				}
			}
			foreach (var value in peers.Values)
			{
				PlayerState item2 = value.Item2;
				item2.UpToDateMapTables.Add(state.ZDO);
				if ((int)ConfigBase<Config>.Instance.PortalsPinType.Value != 8)
				{
					foreach (ServersideQoLZDO portal in item2.Portals)
					{
						List<Pin> pins = _pins;
						val2 = item2.PlayerID;
						PlayerID ownerId = ((PlayerID)(ref val2)).AsModPlayerID();
						vars = portal.Vars;
						pins.Add(new Pin(ownerId, ((ZDOVars)(ref vars)).GetTag(""), portal.ZDO.GetPosition(), ConfigBase<Config>.Instance.PortalsPinType.Value, IsChecked: false, "ArgusMagnus.ServersideQoL.AutoMapTables"));
					}
				}
				if ((int)ConfigBase<Config>.Instance.ShipsPinType.Value != 8)
				{
					foreach (ServersideQoLZDO ship in item2.Ships)
					{
						List<Pin> pins2 = _pins;
						val2 = item2.PlayerID;
						pins2.Add(new Pin(((PlayerID)(ref val2)).AsModPlayerID(), Processor<PrefabInfo>.GetProcessorPrefabInfo(ship).Piece.m_name, ship.ZDO.GetPosition(), ConfigBase<Config>.Instance.ShipsPinType.Value, IsChecked: false, "ArgusMagnus.ServersideQoL.AutoMapTables"));
					}
				}
				if (_oreDepositPins.Count != 0 && (ConfigBase<Config>.Instance.OreDepositsPinTarget.Value & Config.PinTargets.MapTable) != 0)
				{
					foreach (ServersideQoLZDO oreVein in item2.OreVeins)
					{
						PrefabInfo processorPrefabInfo = Processor<PrefabInfo>.GetProcessorPrefabInfo(oreVein);
						if ((object)processorPrefabInfo == null)
						{
							continue;
						}
						Config.OreDepositConfig mineRockPinConfig = processorPrefabInfo.MineRockPinConfig;
						if ((object)mineRockPinConfig == null)
						{
							continue;
						}
						ConfigEntry<PinType> pinType = mineRockPinConfig.PinType;
						if (pinType != null && (int)pinType.Value != 8)
						{
							MineRock5 mineRock = processorPrefabInfo.MineRock5;
							if (mineRock != null)
							{
								List<Pin> pins3 = _pins;
								val2 = item2.PlayerID;
								pins3.Add(new Pin(((PlayerID)(ref val2)).AsModPlayerID(), (mineRockPinConfig.Label.Value == "Default") ? mineRock.m_name : mineRockPinConfig.Label.Value, oreVein.ZDO.GetPosition(), mineRockPinConfig.PinType.Value, IsChecked: false, "ArgusMagnus.ServersideQoL.AutoMapTables"));
							}
						}
					}
				}
				if ((int)ConfigBase<Config>.Instance.DungeonsPinType.Value == 8 || (ConfigBase<Config>.Instance.DungeonsPinTarget.Value & Config.PinTargets.MapTable) == 0)
				{
					continue;
				}
				List<(ServersideQoLZDO, Vector3, string)> list = null;
				foreach (var (val4, tuple2) in item2.Dungeons)
				{
					(Vector3, string) tuple3;
					if (tuple2.HasValue)
					{
						tuple3 = tuple2.GetValueOrDefault();
						goto IL_055e;
					}
					vars = val4.Vars;
					int location = ((ZDOVars)(ref vars)).GetLocation(0);
					if (location == 0)
					{
						continue;
					}
					Location andLoadLocationByHash = PrivateAccessor.GetAndLoadLocationByHash(ZoneSystem.instance, location);
					try
					{
						GameObject prefab = ((Location)(ref andLoadLocationByHash)).Prefab;
						if (prefab == null)
						{
							continue;
						}
						bool flag = false;
						tuple3 = default((Vector3, string));
						Teleport[] componentsInChildren = prefab.GetComponentsInChildren<Teleport>();
						foreach (Teleport val5 in componentsInChildren)
						{
							Vector3 val6 = val4.ZDO.GetPosition() + val4.ZDO.GetRotation() * ((Component)val5).gameObject.transform.position;
							if (!Character.InInterior(val6))
							{
								flag = true;
								(list ?? (list = new List<(ServersideQoLZDO, Vector3, string)>())).Add((val4, val6, val5.m_enterText));
								tuple3 = (val6, val5.m_enterText);
								break;
							}
						}
						if (!flag)
						{
							continue;
						}
						goto IL_055e;
					}
					finally
					{
						((IDisposable)(*(Location*)(&andLoadLocationByHash))/*cast due to .constrained prefix*/).Dispose();
					}
					IL_055e:
					List<Pin> pins4 = _pins;
					val2 = item2.PlayerID;
					pins4.Add(new Pin(((PlayerID)(ref val2)).AsModPlayerID(), (ConfigBase<Config>.Instance.DungeonsLabel.Value == "Default") ? tuple3.Item2 : ConfigBase<Config>.Instance.DungeonsLabel.Value, val4.ZDO.GetPosition(), ConfigBase<Config>.Instance.DungeonsPinType.Value, IsChecked: false, "ArgusMagnus.ServersideQoL.AutoMapTables"));
				}
				if (list == null)
				{
					continue;
				}
				foreach (var (key2, item3, item4) in list)
				{
					item2.Dungeons[key2] = (item3, item4);
				}
			}
			instance.Clear();
			instance.Write(3);
			instance.Write(array ?? _emptyExplored ?? (_emptyExplored = new byte[Minimap.instance.m_textureSize * Minimap.instance.m_textureSize]));
			instance.Write(_pins.Count);
			foreach (Pin pin in _pins)
			{
				val2 = pin.OwnerId;
				instance.Write(((PlayerID)(ref val2)).Value);
				instance.Write(pin.Tag);
				instance.Write(pin.Pos);
				instance.Write((int)pin.Type);
				instance.Write(pin.IsChecked);
				instance.Write(pin.Author);
			}
			vars = state.ZDO.Vars;
			((ZDOVars)(ref vars)).SetData(Utils.Compress(instance.GetArray()), "C:\\repos\\Valheim.ServersideQoL\\ServersideQoL.AutoMapTables\\AutoMapTablesProcessor.cs", 493);
			Processor.ShowMessage(peers.Values.Select<(Peer, PlayerState), Peer>(((Peer, PlayerState) x) => x.Item1), state.ZDO, ConfigBase<Config>.Instance.Localization.Value.Updated, ConfigBase<Config>.Instance.UpdatedMessageType.Value, (TextType)0);
			state.LastDataRevision = state.ZDO.ZDO.DataRevision;
			_pins.Clear();
		}

		private void OnMapTableDestroyed(ServersideQoLZDO zdo)
		{
			if (!_mapTables.Remove(zdo))
			{
				return;
			}
			foreach (PlayerState value in _playerStates.Values)
			{
				value.UpToDateMapTables.Remove(zdo);
			}
		}

		private void OnPortalDestroyed(ServersideQoLZDO zdo)
		{
			//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)
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			Dictionary<PlayerID, PlayerState> playerStates = _playerStates;
			ZDOVars vars = zdo.Vars;
			if (playerStates.TryGetValue(((ZDOVars)(ref vars)).GetCreator(default(PlayerID)), out PlayerState value) && value.Portals.Remove(zdo))
			{
				value.UpToDateMapTables.Clear();
			}
		}

		private void OnShipDestroyed(ServersideQoLZDO zdo)
		{
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: 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_0025: Unknown result type (might be due to invalid IL or missing references)
			_shipPositions.Remove(zdo);
			Dictionary<PlayerID, PlayerState> playerStates = _playerStates;
			ZDOVars vars = zdo.Vars;
			if (playerStates.TryGetValue(((ZDOVars)(ref vars)).GetCreator(default(PlayerID)), out PlayerState value) && value.Ships.Remove(zdo))
			{
				value.UpToDateMapTables.Clear();
			}
		}

		private void OnWardDestroyed(ServersideQoLZDO zdo)
		{
			if (!_wards.Remove(zdo))
			{
				return;
			}
			foreach (MapTableState value in _mapTables.Values)
			{
				if (value.Wards?.Remove(zdo) ?? false)
				{
					UpdateMapTablePermittedPlayerIDs(value);
				}
			}
		}

		private void OnOreDepositDestroyed(ServersideQoLZDO zdo)
		{
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			HashSet<PlayerID> hashSet = __playerIDsVar.Get(zdo, (HashSet<PlayerID>)null);
			if (hashSet == null)
			{
				return;
			}
			foreach (PlayerID item in hashSet)
			{
				if (_playerStates.TryGetValue(item, out PlayerState value) && value.OreVeins.Remove(zdo) && (ConfigBase<Config>.Instance.OreDepositsPinTarget.Value & Config.PinTargets.MapTable) != 0)
				{
					value.UpToDateMapTables.Clear();
				}
			}
		}
	}
	public sealed class Config : ConfigBase<Config>
	{
		public sealed record OreDepositConfig(ConfigEntry<PinType> PinType, ConfigEntry<string> Label);

		[Flags]
		public enum PinTargets
		{
			MapTable = 1,
			DiscoveringPlayer = 2
		}

		public sealed class LocalizationConfig
		{
			public string Updated { get; init; } = "$msg_mapsaved";

			private string DiscoveredFormat { get; init; } = "{0} discovered";

			public string Discovered(string name)
			{
				return string.Format(DiscoveredFormat, name);
			}
		}

		public sealed class AdvancedConfig
		{
			public float MapTableUpdateInterval { get; init; } = 5f;
		}

		private static readonly AcceptableEnum<PinType> __acceptablePins;

		internal const string DefaultOreDepositName = "Default";

		public override ConfigEntry<bool> Enabled { get; } = ConfigBase<Config>.BindEx<bool>(cfg, true, "Enables/disables the entire mod", (IAcceptableValueBase<bool>)null, (Deprecated<Config>)null, "Enabled");

		public ConfigEntry<float> MapTableRange { get; } = ConfigBase<Config>.BindEx<float>(cfg, 64f, "If a player enters this range around a map table, their discovered information (portal/ship/ore deposits/etc. position) is transfered to the map table.", (IAcceptableValueBase<float>)null, (Deprecated<Config>)null, "MapTableRange");

		public ConfigEntry<PinType> PortalsPinType { get; } = ConfigBase<Config>.BindEx<PinType>(cfg, (PinType)6, "The pin type for portals on the map table", (IAcceptableValueBase<PinType>)(object)__acceptablePins, (Deprecated<Config>)null, "PortalsPinType");

		public ConfigEntry<PinType> ShipsPinType { get; }

		public ConfigEntry<PinType> DungeonsPinType { get; }

		public ConfigEntry<string> DungeonsLabel { get; }

		public ConfigEntry<PinTargets> DungeonsPinTarget { get; }

		public ConfigEntry<float> DungeonsDiscoverRange { get; }

		public IReadOnlyDictionary<int, OreDepositConfig> AutoUpdateOreDeposits { get; }

		public ConfigEntry<PinTargets> OreDepositsPinTarget { get; }

		public ConfigEntry<float> OreDepositsDiscoverRange { get; }

		public ConfigEntry<MessageTypes> UpdatedMessageType { get; }

		public ConfigEntry<MessageTypes> DiscoveredMessageType { get; }

		public ConfigEntry<bool> DiscardPlayerPins { get; }

		public YamlConfigEntry<LocalizationConfig> Localization { get; }

		public YamlConfigEntry<AdvancedConfig> Advanced { get; }

		public Config(ConfigFile cfg, Logger logger)
		{
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0081: Unknown result type (might be due to invalid IL or missing references)
			//IL_0085: Unknown result type (might be due to invalid IL or missing references)
			//IL_0088: Expected I4, but got Unknown
			IReadOnlyList<PinType> acceptableValues = __acceptablePins.AcceptableValues;
			int num = 0;
			PinType[] array = (PinType[])(object)new PinType[1 + acceptableValues.Count];
			foreach (PinType item in acceptableValues)
			{
				array[num] = (PinType)(int)item;
				num++;
			}
			array[num] = (PinType)10;
			ShipsPinType = ConfigBase<Config>.BindEx<PinType>(cfg, (PinType)10, "The pin type for ships on the map table", (IAcceptableValueBase<PinType>)(object)new AcceptableEnum<PinType>((IEnumerable<PinType>)new <>z__ReadOnlyArray<PinType>(array)), (Deprecated<Config>)null, "ShipsPinType");
			DungeonsPinType = ConfigBase<Config>.BindEx<PinType>(cfg, (PinType)2, "The pin type for dungeons on the map table", (IAcceptableValueBase<PinType>)(object)__acceptablePins, (Deprecated<Config>)null, "DungeonsPinType");
			DungeonsLabel = ConfigBase<Config>.BindEx<string>(cfg, "Default", "The pin label for dungeons", (IAcceptableValueBase<string>)null, (Deprecated<Config>)null, "DungeonsLabel");
			DungeonsPinTarget = ConfigBase<Config>.BindEx<PinTargets>(cfg, PinTargets.MapTable, "Whether to add the pin to map tables, the map of the discovering player or both.\r\nWARNING: Pins added to player maps can only be removed by the players themselves and will remain even if the mod is removed.", (IAcceptableValueBase<PinTargets>)null, (Deprecated<Config>)null, "DungeonsPinTarget");
			DungeonsDiscoverRange = ConfigBase<Config>.BindEx<float>(cfg, 4f, "A dungeon is considered 'discovered by a player' when that player is detected within this range around the entrance", (IAcceptableValueBase<float>)null, (Deprecated<Config>)null, "DungeonsDiscoverRange");
			AutoUpdateOreDeposits = GetPrefabPinConfig(cfg, logger) ?? EmptyReadOnlyCollections<int, OreDepositConfig>.Dictionary;
			OreDepositsPinTarget = ConfigBase<Config>.BindEx<PinTargets>(cfg, PinTargets.MapTable, "Whether to add the pin to map tables, the map of the discovering player or both.\r\nWARNING: Pins added to player maps can only be removed by the players themselves and will remain even if the mod is removed.", (IAcceptableValueBase<PinTargets>)null, (Deprecated<Config>)null, "OreDepositsPinTarget");
			OreDepositsDiscoverRange = ConfigBase<Config>.BindEx<float>(cfg, 32f, "An ore deposit is considered 'discovered by a player' when that player was within this range around the deposit while it was struck by a pickaxe", (IAcceptableValueBase<float>)null, (Deprecated<Config>)null, "OreDepositsDiscoverRange");
			UpdatedMessageType = ConfigBase<Config>.BindEx<MessageTypes>(cfg, (MessageTypes)0, "Type of message to show when a map table is updated", (IAcceptableValueBase<MessageTypes>)(object)AcceptableEnum<MessageTypes>.Default, (Deprecated<Config>)null, "UpdatedMessageType");
			MessageTypes[] array2 = new MessageTypes[4];
			RuntimeHelpers.InitializeArray(array2, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/);
			DiscoveredMessageType = ConfigBase<Config>.BindEx<MessageTypes>(cfg, (MessageTypes)2, "Type of message to show to a player when they discovered map information", (IAcceptableValueBase<MessageTypes>)(object)new AcceptableEnum<MessageTypes>((IEnumerable<MessageTypes>)new <>z__ReadOnlyArray<MessageTypes>((MessageTypes[])(object)array2)), (Deprecated<Config>)null, "DiscoveredMessageType");
			DiscardPlayerPins = ConfigBase<Config>.BindEx<bool>(cfg, false, "True to discard custom player pins from map tables", (IAcceptableValueBase<bool>)null, (Deprecated<Config>)null, "DiscardPlayerPins");
			Localization = ConfigBase<Config>.BindYaml<LocalizationConfig>(cfg, "Localization");
			Advanced = ConfigBase<Config>.BindYaml<AdvancedConfig>(cfg, "Advanced");
			base..ctor(cfg, logger);
		}

		private static IReadOnlyDictionary<int, OreDepositConfig>? GetPrefabPinConfig(ConfigFile cfg, Logger logger)
		{
			//IL_020b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0215: Expected O, but got Unknown
			Dictionary<ItemDrop, OreDepositConfig> dictionary = new Dictionary<ItemDrop, OreDepositConfig>();
			List<MineRock5> list = new List<MineRock5>();
			foreach (GameObject prefab in ZNetScene.instance.m_prefabs)
			{
				Smelter component = prefab.GetComponent<Smelter>();
				if (component != null)
				{
					foreach (ItemDrop item in from x in component.m_conversion
						select x.m_from into x
						where x != null
						select x)
					{
						dictionary.TryAdd(item, null);
					}
				}
				else
				{
					MineRock5 component2 = prefab.GetComponent<MineRock5>();
					if (component2 != null)
					{
						list.Add(component2);
					}
				}
			}
			Dictionary<int, OreDepositConfig> dictionary2 = null;
			PinType[] array = new PinType[6];
			RuntimeHelpers.InitializeArray(array, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/);
			AcceptableEnum<PinType> val = new AcceptableEnum<PinType>((IEnumerable<PinType>)new <>z__ReadOnlyArray<PinType>((PinType[])(object)array));
			foreach (MineRock5 item2 in list)
			{
				OreDepositConfig value = null;
				foreach (ItemDrop item3 in item2.m_dropItems.m_drops.Select((DropData x) => x.m_item.GetComponent<ItemDrop>()))
				{
					if (item3 == null || !dictionary.TryGetValue(item3, out value))
					{
						continue;
					}
					if ((object)value == null)
					{
						string text = ((Object)item3).name;
						if (!char.IsUpper(text[0]))
						{
							text = $"{char.ToUpperInvariant(text[0])}{text.Substring(1)}";
						}
						value = (dictionary[item3] = new OreDepositConfig(cfg.Bind<PinType>(ConfigBase<Config>.Section, text + "PinType", (PinType)3, new ConfigDescription("The pin icon to use for " + Localization.instance.Localize(item3.m_itemData.m_shared.m_name) + ".\r\nPins will only be added to the map table after the ore deposit was hit at least once with a pickaxe.", (AcceptableValueBase)(object)val, Array.Empty<object>())), cfg.Bind<string>(ConfigBase<Config>.Section, text + "Label", GetDefaultLabel(text), "The label to use for " + Localization.instance.Localize(item3.m_itemData.m_shared.m_name) + " pins")));
					}
					break;
				}
				if ((object)value != null)
				{
					(dictionary2 ?? (dictionary2 = new Dictionary<int, OreDepositConfig>())).Add(StringExtensionMethods.GetStableHashCode(((Object)((Component)item2).gameObject).name), value);
				}
			}
			return dictionary2;
			static string GetDefaultLabel(string itemName)
			{
				if (itemName.Contains("Iron", StringComparison.OrdinalIgnoreCase))
				{
					return "Fe";
				}
				if (itemName.Contains("Copper", StringComparison.OrdinalIgnoreCase))
				{
					return "Cu";
				}
				if (itemName.Contains("Silver", StringComparison.OrdinalIgnoreCase))
				{
					return "Ag";
				}
				if (itemName.Contains("Tin", StringComparison.OrdinalIgnoreCase))
				{
					return "Sn";
				}
				return "Default";
			}
		}

		static Config()
		{
			PinType[] array = new PinType[6];
			RuntimeHelpers.InitializeArray(array, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/);
			__acceptablePins = new AcceptableEnum<PinType>((IEnumerable<PinType>)new <>z__ReadOnlyArray<PinType>((PinType[])(object)array));
		}
	}
}