Decompiled source of PvPBiomeDominions v1.4.0

PvPBiomeDominions.dll

Decompiled 4 days ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.IO.Compression;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Serialization;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Configuration;
using BepInEx.Logging;
using Groups;
using HarmonyLib;
using JetBrains.Annotations;
using Microsoft.CodeAnalysis;
using PvPBiomeDominions.Helpers;
using PvPBiomeDominions.Helpers.WardIsLove;
using PvPBiomeDominions.PositionManagement;
using PvPBiomeDominions.PositionManagement.UI;
using PvPBiomeDominions.PvPManagement;
using PvPBiomeDominions.RPC;
using ServerSync;
using TMPro;
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.UI;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("PvPBiomeDominions")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("PvPBiomeDominions")]
[assembly: AssemblyCopyright("Copyright ©  2025")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("11065244-3969-420d-b128-c28acbaa0aa9")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
[assembly: AssemblyVersion("1.0.0.0")]
[PublicAPI]
public static class Marketplace_API
{
	[Flags]
	public enum TerritoryFlags
	{
		None = 0,
		PushAway = 1,
		NoBuild = 2,
		NoPickaxe = 4,
		NoInteract = 8,
		NoAttack = 0x10,
		PvpOnly = 0x20,
		PveOnly = 0x40,
		PeriodicHeal = 0x80,
		PeriodicDamage = 0x100,
		IncreasedPlayerDamage = 0x200,
		IncreasedMonsterDamage = 0x400,
		NoMonsters = 0x800,
		CustomEnvironment = 0x1000,
		MoveSpeedMultiplier = 0x2000,
		NoDeathPenalty = 0x4000,
		NoPortals = 0x8000,
		PeriodicHealALL = 0x10000,
		ForceGroundHeight = 0x20000,
		ForceBiome = 0x40000,
		AddGroundHeight = 0x80000,
		NoBuildDamage = 0x100000,
		MonstersAddStars = 0x200000,
		InfiniteFuel = 0x400000,
		NoInteractItems = 0x800000,
		NoInteractCraftingStation = 0x1000000,
		NoInteractItemStands = 0x2000000,
		NoInteractChests = 0x4000000,
		NoInteractDoors = 0x8000000,
		NoStructureSupport = 0x10000000,
		NoInteractPortals = 0x20000000,
		CustomPaint = 0x40000000,
		LimitZoneHeight = int.MinValue
	}

	[Flags]
	public enum AdditionalTerritoryFlags
	{
		None = 0,
		NoItemLoss = 1,
		SnowMask = 2,
		NoMist = 4,
		InfiniteEitr = 8,
		InfiniteStamina = 0x10,
		DropMultiplier = 0x20,
		ForceWind = 0x40,
		GodMode = 0x80
	}

	public enum API_NPCType
	{
		None,
		Trader,
		Info,
		Teleporter,
		Feedback,
		Banker,
		Gambler,
		Quests,
		Buffer,
		Transmog,
		Marketplace
	}

	private static readonly bool _IsInstalled;

	private static readonly MethodInfo MI_IsPlayerInsideTerritory;

	private static readonly MethodInfo MI_IsObjectInsideTerritoryWithFlag;

	private static readonly MethodInfo MI_IsObjectInsideTerritoryWithFlag_Additional;

	private static readonly MethodInfo MI_ResetTraderItems;

	private static readonly MethodInfo MI_OpenQuestJournal;

	public static bool IsInstalled()
	{
		return _IsInstalled;
	}

	public static bool IsPlayerInsideTerritory(out string name, out TerritoryFlags flags, out AdditionalTerritoryFlags additionalFlags)
	{
		flags = TerritoryFlags.None;
		additionalFlags = AdditionalTerritoryFlags.None;
		name = "";
		if (!_IsInstalled || MI_IsPlayerInsideTerritory == null)
		{
			return false;
		}
		object[] array = new object[3] { "", 0, 0 };
		bool result = (bool)MI_IsPlayerInsideTerritory.Invoke(null, array);
		name = (string)array[0];
		flags = (TerritoryFlags)array[1];
		additionalFlags = (AdditionalTerritoryFlags)array[2];
		return result;
	}

	public static bool IsObjectInsideTerritoryWithFlag(GameObject go, TerritoryFlags flag, out string name, out TerritoryFlags flags, out AdditionalTerritoryFlags additionalFlags)
	{
		//IL_0006: Unknown result type (might be due to invalid IL or missing references)
		return IsPointInsideTerritoryWithFlag(go.transform.position, flag, out name, out flags, out additionalFlags);
	}

	public static bool IsObjectInsideTerritoryWithFlag(GameObject go, AdditionalTerritoryFlags flag, out string name, out TerritoryFlags flags, out AdditionalTerritoryFlags additionalFlags)
	{
		//IL_0006: Unknown result type (might be due to invalid IL or missing references)
		return IsPointInsideTerritoryWithFlag(go.transform.position, flag, out name, out flags, out additionalFlags);
	}

	public static bool IsPointInsideTerritoryWithFlag(Vector3 pos, TerritoryFlags flag, out string name, out TerritoryFlags flags, out AdditionalTerritoryFlags additionalFlags)
	{
		//IL_0034: Unknown result type (might be due to invalid IL or missing references)
		name = "";
		flags = TerritoryFlags.None;
		additionalFlags = AdditionalTerritoryFlags.None;
		if (!_IsInstalled || MI_IsObjectInsideTerritoryWithFlag == null)
		{
			return false;
		}
		object[] array = new object[5]
		{
			pos,
			(int)flag,
			"",
			0,
			0
		};
		bool result = (bool)MI_IsObjectInsideTerritoryWithFlag.Invoke(null, array);
		name = (string)array[2];
		flags = (TerritoryFlags)array[3];
		additionalFlags = (AdditionalTerritoryFlags)array[4];
		return result;
	}

	public static bool IsPointInsideTerritoryWithFlag(Vector3 pos, AdditionalTerritoryFlags flag, out string name, out TerritoryFlags flags, out AdditionalTerritoryFlags additionalFlags)
	{
		//IL_0034: Unknown result type (might be due to invalid IL or missing references)
		name = "";
		flags = TerritoryFlags.None;
		additionalFlags = AdditionalTerritoryFlags.None;
		if (!_IsInstalled || MI_IsObjectInsideTerritoryWithFlag_Additional == null)
		{
			return false;
		}
		object[] array = new object[5]
		{
			pos,
			(int)flag,
			"",
			0,
			0
		};
		bool result = (bool)MI_IsObjectInsideTerritoryWithFlag_Additional.Invoke(null, array);
		name = (string)array[2];
		flags = (TerritoryFlags)array[3];
		additionalFlags = (AdditionalTerritoryFlags)array[4];
		return result;
	}

	public static void ResetTraderItems()
	{
		if (_IsInstalled && !(MI_ResetTraderItems == null))
		{
			MI_ResetTraderItems.Invoke(null, null);
		}
	}

	public static void OpenQuestJournal()
	{
		if (_IsInstalled && !(MI_OpenQuestJournal == null))
		{
			MI_OpenQuestJournal.Invoke(null, null);
		}
	}

	public static void SET_NPC_Type(this ZDO zdo, API_NPCType type)
	{
		zdo.Set("KGmarketNPC", (int)type);
	}

	public static void SET_NPC_Profile(this ZDO zdo, string profile)
	{
		zdo.Set("KGnpcProfile", profile);
	}

	public static void SET_NPC_Model(this ZDO zdo, string prefab)
	{
		zdo.Set("KGnpcModelOverride", prefab);
	}

	public static void SET_NPC_Name(this ZDO zdo, string name)
	{
		zdo.Set("KGnpcNameOverride", name);
	}

	public static void SET_NPC_Dialogue(this ZDO zdo, string dialogue)
	{
		zdo.Set("KGnpcDialogue", dialogue);
	}

	public static void SET_NPC_PatrolData(this ZDO zdo, string patrolData)
	{
		zdo.Set("KGmarket PatrolData", patrolData);
	}

	public static void SET_NPC_LeftItem(this ZDO zdo, string prefab)
	{
		zdo.Set("KGleftItem", prefab);
	}

	public static void SET_NPC_RightItem(this ZDO zdo, string prefab)
	{
		zdo.Set("KGrightItem", prefab);
	}

	public static void SET_NPC_HelmetItem(this ZDO zdo, string prefab)
	{
		zdo.Set("KGhelmetItem", prefab);
	}

	public static void SET_NPC_ChestItem(this ZDO zdo, string prefab)
	{
		zdo.Set("KGchestItem", prefab);
	}

	public static void SET_NPC_LegsItem(this ZDO zdo, string prefab)
	{
		zdo.Set("KGlegsItem", prefab);
	}

	public static void SET_NPC_CapeItem(this ZDO zdo, string prefab)
	{
		zdo.Set("KGcapeItem", prefab);
	}

	public static void SET_NPC_HairItem(this ZDO zdo, string prefab)
	{
		zdo.Set("KGhairItem", prefab);
	}

	public static void SET_NPC_HairColor(this ZDO zdo, string color)
	{
		zdo.Set("KGhairItemColor", color);
	}

	public static void SET_NPC_LeftItemBack(this ZDO zdo, string prefab)
	{
		zdo.Set("KGLeftItemBack", prefab);
	}

	public static void SET_NPC_RightItemBack(this ZDO zdo, string prefab)
	{
		zdo.Set("KGRightItemBack", prefab);
	}

	public static void SET_NPC_InteractAnimation(this ZDO zdo, string animation)
	{
		zdo.Set("KGinteractAnimation", animation);
	}

	public static void SET_NPC_GreetingAnimation(this ZDO zdo, string animation)
	{
		zdo.Set("KGgreetingAnimation", animation);
	}

	public static void SET_NPC_ByeAnimation(this ZDO zdo, string animation)
	{
		zdo.Set("KGbyeAnimation", animation);
	}

	public static void SET_NPC_GreetingText(this ZDO zdo, string text)
	{
		zdo.Set("KGgreetingText", text);
	}

	public static void SET_NPC_ByeText(this ZDO zdo, string text)
	{
		zdo.Set("KGbyeText", text);
	}

	public static void SET_NPC_SkinColor(this ZDO zdo, string color)
	{
		zdo.Set("KGskinColor", color);
	}

	public static void SET_NPC_CraftingAnimation(this ZDO zdo, string animation)
	{
		zdo.Set("KGcraftingAnimation", animation);
	}

	public static void SET_NPC_BeardItem(this ZDO zdo, string prefab)
	{
		zdo.Set("KGbeardItem", prefab);
	}

	public static void SET_NPC_BeardColor(this ZDO zdo, string color)
	{
		zdo.Set("KGbeardColor", color);
	}

	public static void SET_NPC_InteractSound(this ZDO zdo, string sound)
	{
		zdo.Set("KGinteractSound", sound);
	}

	public static void SET_NPC_TextSize(this ZDO zdo, string size)
	{
		zdo.Set("KGtextSize", float.TryParse(size, NumberStyles.AllowDecimalPoint, CultureInfo.InvariantCulture, out var result) ? result : 3f);
	}

	public static void SET_NPC_TextHeight(this ZDO zdo, string height)
	{
		zdo.Set("KGtextHeight", float.TryParse(height, NumberStyles.AllowDecimalPoint, CultureInfo.InvariantCulture, out var result) ? result : 0f);
	}

	public static void SET_NPC_PeriodicAnimation(this ZDO zdo, string animation)
	{
		zdo.Set("KGperiodicAnimation", animation);
	}

	public static void SET_NPC_PeriodicAnimationTime(this ZDO zdo, string time)
	{
		zdo.Set("KGperiodicAnimationTime", float.TryParse(time, NumberStyles.AllowDecimalPoint, CultureInfo.InvariantCulture, out var result) ? result : 0f);
	}

	public static void SET_NPC_PeriodicSound(this ZDO zdo, string sound)
	{
		zdo.Set("KGperiodicSound", sound);
	}

	public static void SET_NPC_PeriodicSoundTime(this ZDO zdo, string time)
	{
		zdo.Set("KGperiodicSoundTime", float.TryParse(time, NumberStyles.AllowDecimalPoint, CultureInfo.InvariantCulture, out var result) ? result : 0f);
	}

	public static void SET_NPC_NPCScale(this ZDO zdo, string scale)
	{
		zdo.Set("KGnpcScale", float.TryParse(scale, NumberStyles.AllowDecimalPoint, CultureInfo.InvariantCulture, out var result) ? result : 1f);
	}

	public static void SET_NPC_IsPinned(this ZDO zdo, bool pinned)
	{
		zdo.Set("KGmarketPinned", pinned);
	}

	public static void SET_NPC_PinIcon(this ZDO zdo, string pinIcon)
	{
		zdo.Set("KGmarketPinIcon", string.IsNullOrWhiteSpace(pinIcon) ? "" : pinIcon);
	}

	public static API_NPCType GET_NPC_Type(this ZDO zdo)
	{
		return (API_NPCType)zdo.GetInt("KGmarketNPC", 0);
	}

	public static string GET_NPC_Profile(this ZDO zdo)
	{
		return zdo.GetString("KGnpcProfile", "default");
	}

	public static string GET_NPC_Model(this ZDO zdo)
	{
		return zdo.GetString("KGnpcModelOverride", "");
	}

	public static string GET_NPC_Name(this ZDO zdo)
	{
		return zdo.GetString("KGnpcNameOverride", "");
	}

	public static string GET_NPC_Dialogue(this ZDO zdo)
	{
		return zdo.GetString("KGnpcDialogue", "");
	}

	public static string GET_NPC_PatrolData(this ZDO zdo)
	{
		return zdo.GetString("KGmarket PatrolData", "");
	}

	public static bool GET_NPC_IsPinned(this ZDO zdo)
	{
		return zdo.GetBool("KGmarketPinned", false);
	}

	public static string GET_NPC_PinIcon(this ZDO zdo)
	{
		return zdo.GetString("KGmarketPinIcon", "");
	}

	public static string GET_NPC_LeftItem(this ZDO zdo)
	{
		return zdo.GetString("KGleftItem", "");
	}

	public static string GET_NPC_RightItem(this ZDO zdo)
	{
		return zdo.GetString("KGrightItem", "");
	}

	public static string GET_NPC_HelmetItem(this ZDO zdo)
	{
		return zdo.GetString("KGhelmetItem", "");
	}

	public static string GET_NPC_ChestItem(this ZDO zdo)
	{
		return zdo.GetString("KGchestItem", "");
	}

	public static string GET_NPC_LegsItem(this ZDO zdo)
	{
		return zdo.GetString("KGlegsItem", "");
	}

	public static string GET_NPC_CapeItem(this ZDO zdo)
	{
		return zdo.GetString("KGcapeItem", "");
	}

	public static string GET_NPC_HairItem(this ZDO zdo)
	{
		return zdo.GetString("KGhairItem", "");
	}

	public static string GET_NPC_HairColor(this ZDO zdo)
	{
		return zdo.GetString("KGhairItemColor", "");
	}

	public static string GET_NPC_LeftItemBack(this ZDO zdo)
	{
		return zdo.GetString("KGLeftItemBack", "");
	}

	public static string GET_NPC_RightItemBack(this ZDO zdo)
	{
		return zdo.GetString("KGRightItemBack", "");
	}

	public static string GET_NPC_InteractAnimation(this ZDO zdo)
	{
		return zdo.GetString("KGinteractAnimation", "");
	}

	public static string GET_NPC_GreetingAnimation(this ZDO zdo)
	{
		return zdo.GetString("KGgreetingAnimation", "");
	}

	public static string GET_NPC_ByeAnimation(this ZDO zdo)
	{
		return zdo.GetString("KGbyeAnimation", "");
	}

	public static string GET_NPC_GreetingText(this ZDO zdo)
	{
		return zdo.GetString("KGgreetingText", "");
	}

	public static string GET_NPC_ByeText(this ZDO zdo)
	{
		return zdo.GetString("KGbyeText", "");
	}

	public static string GET_NPC_SkinColor(this ZDO zdo)
	{
		return zdo.GetString("KGskinColor", "");
	}

	public static string GET_NPC_CraftingAnimation(this ZDO zdo)
	{
		return zdo.GetString("KGcraftingAnimation", "");
	}

	public static string GET_NPC_BeardItem(this ZDO zdo)
	{
		return zdo.GetString("KGbeardItem", "");
	}

	public static string GET_NPC_BeardColor(this ZDO zdo)
	{
		return zdo.GetString("KGbeardColor", "");
	}

	public static string GET_NPC_InteractSound(this ZDO zdo)
	{
		return zdo.GetString("KGinteractSound", "");
	}

	public static float GET_NPC_TextSize(this ZDO zdo)
	{
		return zdo.GetFloat("KGtextSize", 3f);
	}

	public static float GET_NPC_TextHeight(this ZDO zdo)
	{
		return zdo.GetFloat("KGtextHeight", 0f);
	}

	public static string GET_NPC_PeriodicAnimation(this ZDO zdo)
	{
		return zdo.GetString("KGperiodicAnimation", "");
	}

	public static float GET_NPC_PeriodicAnimationTime(this ZDO zdo)
	{
		return zdo.GetFloat("KGperiodicAnimationTime", 0f);
	}

	public static string GET_NPC_PeriodicSound(this ZDO zdo)
	{
		return zdo.GetString("KGperiodicSound", "");
	}

	public static float GET_NPC_PeriodicSoundTime(this ZDO zdo)
	{
		return zdo.GetFloat("KGperiodicSoundTime", 0f);
	}

	public static float GET_NPC_NPCScale(this ZDO zdo)
	{
		return zdo.GetFloat("KGnpcScale", 1f);
	}

	static Marketplace_API()
	{
		Type type = Type.GetType("API.ClientSide, kg.Marketplace");
		if ((object)type == null)
		{
			_IsInstalled = false;
			return;
		}
		_IsInstalled = true;
		MI_IsPlayerInsideTerritory = type.GetMethod("IsPlayerInsideTerritory", BindingFlags.Static | BindingFlags.Public);
		MI_IsObjectInsideTerritoryWithFlag = type.GetMethod("IsObjectInsideTerritoryWithFlag", BindingFlags.Static | BindingFlags.Public);
		MI_IsObjectInsideTerritoryWithFlag_Additional = type.GetMethod("IsObjectInsideTerritoryWithFlag_Additional", BindingFlags.Static | BindingFlags.Public);
		MI_ResetTraderItems = type.GetMethod("ResetTraderItems", BindingFlags.Static | BindingFlags.Public);
		MI_OpenQuestJournal = type.GetMethod("OpenQuestJournal", BindingFlags.Static | BindingFlags.Public);
	}
}
namespace PvPBiomeDominions
{
	internal class ConfigurationFile
	{
		public enum Toggle
		{
			On = 1,
			Off = 0
		}

		public enum PvPBiomeRule
		{
			Pve,
			Pvp,
			PlayerChoose
		}

		public enum PvPWardRule
		{
			Pve,
			Pvp,
			PlayerChoose,
			FollowBiomeRule
		}

		public enum PositionSharingBiomeRule
		{
			HidePlayer,
			ShowPlayer,
			PlayerChoice
		}

		public enum PositionSharingWardRule
		{
			HidePlayer,
			ShowPlayer,
			PlayerChoice,
			FollowBiomeRule
		}

		private static ConfigEntry<bool> _serverConfigLocked = null;

		public static ConfigEntry<bool> debug;

		public static ConfigEntry<Vector2> mapPlayersListPosition;

		public static ConfigEntry<bool> mapPinColoring;

		public static ConfigEntry<int> maxPlayerNamesCharactersInList;

		public static ConfigEntry<bool> showMessageWhenLootingYourTombstone;

		public static ConfigFile configFile;

		private static readonly string ConfigFileName = "Turbero.PvPBiomeDominions.cfg";

		private static readonly string ConfigFileFullPath;

		public static readonly ConfigSync ConfigSync;

		public static ConfigEntry<Toggle> pvpAdminExempt;

		public static ConfigEntry<PvPWardRule> pvpRuleInWards;

		private static ConfigEntry<PvPBiomeRule> pvpRuleInMeadows;

		private static ConfigEntry<PvPBiomeRule> pvpRuleInBlackForest;

		private static ConfigEntry<PvPBiomeRule> pvpRuleInSwamp;

		private static ConfigEntry<PvPBiomeRule> pvpRuleInMountain;

		private static ConfigEntry<PvPBiomeRule> pvpRuleInPlains;

		private static ConfigEntry<PvPBiomeRule> pvpRuleInMistlands;

		private static ConfigEntry<PvPBiomeRule> pvpRuleInAshlands;

		private static ConfigEntry<PvPBiomeRule> pvpRuleInDeepNorth;

		private static ConfigEntry<PvPBiomeRule> pvpRuleInOcean;

		public static ConfigEntry<Toggle> wardCreationInMeadows;

		public static ConfigEntry<Toggle> wardCreationInBlackForest;

		public static ConfigEntry<Toggle> wardCreationInSwamp;

		public static ConfigEntry<Toggle> wardCreationInMountain;

		public static ConfigEntry<Toggle> wardCreationInPlains;

		public static ConfigEntry<Toggle> wardCreationInMistlands;

		public static ConfigEntry<Toggle> wardCreationInAshlands;

		public static ConfigEntry<Toggle> wardCreationInDeepNorth;

		public static ConfigEntry<Toggle> wardCreationInOcean;

		public static ConfigEntry<string> wardModsPrefabIds;

		public static ConfigEntry<string> pvpTombstoneLootAlertMessage;

		public static ConfigEntry<string> pvpTombstoneDestroyAlertMessage;

		public static ConfigEntry<int> pvpMinimapPlayersListRefresh;

		public static ConfigEntry<Toggle> positionAdminExempt;

		public static ConfigEntry<PositionSharingWardRule> positionRuleInWards;

		private static ConfigEntry<PositionSharingBiomeRule> positionRuleInMeadows;

		private static ConfigEntry<PositionSharingBiomeRule> positionRuleInBlackForest;

		private static ConfigEntry<PositionSharingBiomeRule> positionRuleInSwamp;

		private static ConfigEntry<PositionSharingBiomeRule> positionRuleInMountain;

		private static ConfigEntry<PositionSharingBiomeRule> positionRuleInPlains;

		private static ConfigEntry<PositionSharingBiomeRule> positionRuleInMistlands;

		private static ConfigEntry<PositionSharingBiomeRule> positionRuleInAshlands;

		private static ConfigEntry<PositionSharingBiomeRule> positionRuleInDeepNorth;

		private static ConfigEntry<PositionSharingBiomeRule> positionRuleInOcean;

		public static ConfigEntry<Toggle> pvpWackyEpicMMOLevelDifferenceLimitEnabled;

		public static ConfigEntry<int> pvpWackyEpicMMOLevelDifferenceLimitValue;

		public static ConfigEntry<string> playersListPanelButtonText;

		public static ConfigEntry<string> playersMapListTitle;

		public static ConfigEntry<string> wardCreationNotAllowed;

		public static PvPBiomeRule getCurrentBiomeRulePvPRule()
		{
			//IL_001e: 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_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)
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Invalid comparison between Unknown and I4
			//IL_0059: Unknown result type (might be due to invalid IL or missing references)
			//IL_005c: Invalid comparison between Unknown and I4
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			//IL_0047: Expected I4, but got Unknown
			//IL_006f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0075: Invalid comparison between Unknown and I4
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0061: Invalid comparison between Unknown and I4
			//IL_0049: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Invalid comparison between Unknown and I4
			//IL_0079: Unknown result type (might be due to invalid IL or missing references)
			//IL_007f: Invalid comparison between Unknown and I4
			//IL_0065: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Invalid comparison between Unknown and I4
			//IL_004f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0052: Invalid comparison between Unknown and I4
			if (!Object.op_Implicit((Object)(object)EnvMan.instance))
			{
				return PvPBiomeRule.PlayerChoose;
			}
			Biome currentBiome = EnvMan.instance.GetCurrentBiome();
			Biome val = currentBiome;
			Biome val2 = val;
			if ((int)val2 <= 16)
			{
				switch (val2 - 1)
				{
				default:
					if ((int)val2 != 8)
					{
						if ((int)val2 != 16)
						{
							break;
						}
						return pvpRuleInPlains.Value;
					}
					return pvpRuleInBlackForest.Value;
				case 0:
					return pvpRuleInMeadows.Value;
				case 1:
					return pvpRuleInSwamp.Value;
				case 3:
					return pvpRuleInMountain.Value;
				case 2:
					break;
				}
			}
			else if ((int)val2 <= 64)
			{
				if ((int)val2 == 32)
				{
					return pvpRuleInAshlands.Value;
				}
				if ((int)val2 == 64)
				{
					return pvpRuleInDeepNorth.Value;
				}
			}
			else
			{
				if ((int)val2 == 256)
				{
					return pvpRuleInOcean.Value;
				}
				if ((int)val2 == 512)
				{
					return pvpRuleInMistlands.Value;
				}
			}
			return PvPBiomeRule.PlayerChoose;
		}

		public static PositionSharingBiomeRule getCurrentBiomeRulePosition()
		{
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			if (!Object.op_Implicit((Object)(object)EnvMan.instance))
			{
				return PositionSharingBiomeRule.PlayerChoice;
			}
			return getBiomeRulePosition(EnvMan.instance.GetCurrentBiome());
		}

		public static PositionSharingBiomeRule getBiomeRulePosition(Biome biome)
		{
			//IL_0019: 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_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Invalid comparison between Unknown and I4
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_004f: Invalid comparison between Unknown and I4
			//IL_0022: 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_003a: Expected I4, but got Unknown
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Invalid comparison between Unknown and I4
			//IL_0051: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: Invalid comparison between Unknown and I4
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			//IL_003e: Invalid comparison between Unknown and I4
			//IL_006c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0072: Invalid comparison between Unknown and I4
			//IL_0058: Unknown result type (might be due to invalid IL or missing references)
			//IL_005b: Invalid comparison between Unknown and I4
			//IL_0042: Unknown result type (might be due to invalid IL or missing references)
			//IL_0045: Invalid comparison between Unknown and I4
			if (!Object.op_Implicit((Object)(object)EnvMan.instance))
			{
				return PositionSharingBiomeRule.PlayerChoice;
			}
			if ((int)biome <= 16)
			{
				switch (biome - 1)
				{
				default:
					if ((int)biome != 8)
					{
						if ((int)biome != 16)
						{
							break;
						}
						return positionRuleInPlains.Value;
					}
					return positionRuleInBlackForest.Value;
				case 0:
					return positionRuleInMeadows.Value;
				case 1:
					return positionRuleInSwamp.Value;
				case 3:
					return positionRuleInMountain.Value;
				case 2:
					break;
				}
			}
			else if ((int)biome <= 64)
			{
				if ((int)biome == 32)
				{
					return positionRuleInAshlands.Value;
				}
				if ((int)biome == 64)
				{
					return positionRuleInDeepNorth.Value;
				}
			}
			else
			{
				if ((int)biome == 256)
				{
					return positionRuleInOcean.Value;
				}
				if ((int)biome == 512)
				{
					return positionRuleInMistlands.Value;
				}
			}
			return PositionSharingBiomeRule.PlayerChoice;
		}

		public static bool IsWardCreationAllowedInCurrentBiomeRule()
		{
			//IL_001e: 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_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)
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Invalid comparison between Unknown and I4
			//IL_0059: Unknown result type (might be due to invalid IL or missing references)
			//IL_005c: Invalid comparison between Unknown and I4
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			//IL_0047: Expected I4, but got Unknown
			//IL_0075: Unknown result type (might be due to invalid IL or missing references)
			//IL_007b: Invalid comparison between Unknown and I4
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0061: Invalid comparison between Unknown and I4
			//IL_0049: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Invalid comparison between Unknown and I4
			//IL_0082: Unknown result type (might be due to invalid IL or missing references)
			//IL_0088: Invalid comparison between Unknown and I4
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006b: Invalid comparison between Unknown and I4
			//IL_004f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0052: Invalid comparison between Unknown and I4
			if (!Object.op_Implicit((Object)(object)EnvMan.instance))
			{
				return true;
			}
			Biome currentBiome = EnvMan.instance.GetCurrentBiome();
			Biome val = currentBiome;
			Biome val2 = val;
			if ((int)val2 <= 16)
			{
				switch (val2 - 1)
				{
				default:
					if ((int)val2 != 8)
					{
						if ((int)val2 != 16)
						{
							break;
						}
						return wardCreationInPlains.Value == Toggle.On;
					}
					return wardCreationInBlackForest.Value == Toggle.On;
				case 0:
					return wardCreationInMeadows.Value == Toggle.On;
				case 1:
					return wardCreationInSwamp.Value == Toggle.On;
				case 3:
					return wardCreationInMountain.Value == Toggle.On;
				case 2:
					break;
				}
			}
			else if ((int)val2 <= 64)
			{
				if ((int)val2 == 32)
				{
					return wardCreationInAshlands.Value == Toggle.On;
				}
				if ((int)val2 == 64)
				{
					return wardCreationInDeepNorth.Value == Toggle.On;
				}
			}
			else
			{
				if ((int)val2 == 256)
				{
					return wardCreationInOcean.Value == Toggle.On;
				}
				if ((int)val2 == 512)
				{
					return wardCreationInMistlands.Value == Toggle.On;
				}
			}
			return true;
		}

		internal static void LoadConfig(BaseUnityPlugin plugin)
		{
			//IL_0067: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ef: Expected O, but got Unknown
			//IL_010a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0115: Expected O, but got Unknown
			//IL_0130: Unknown result type (might be due to invalid IL or missing references)
			//IL_013b: Expected O, but got Unknown
			//IL_0156: Unknown result type (might be due to invalid IL or missing references)
			//IL_0161: Expected O, but got Unknown
			//IL_017c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0187: Expected O, but got Unknown
			//IL_01a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ad: Expected O, but got Unknown
			//IL_01c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d3: Expected O, but got Unknown
			//IL_01ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f9: Expected O, but got Unknown
			//IL_0214: Unknown result type (might be due to invalid IL or missing references)
			//IL_021f: Expected O, but got Unknown
			//IL_023a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0245: Expected O, but got Unknown
			//IL_0260: Unknown result type (might be due to invalid IL or missing references)
			//IL_026b: Expected O, but got Unknown
			//IL_028a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0295: Expected O, but got Unknown
			//IL_02b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_02bf: Expected O, but got Unknown
			//IL_02db: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e6: Expected O, but got Unknown
			//IL_0301: Unknown result type (might be due to invalid IL or missing references)
			//IL_030c: Expected O, but got Unknown
			//IL_0327: Unknown result type (might be due to invalid IL or missing references)
			//IL_0332: Expected O, but got Unknown
			//IL_034d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0358: Expected O, but got Unknown
			//IL_0373: Unknown result type (might be due to invalid IL or missing references)
			//IL_037e: Expected O, but got Unknown
			//IL_0399: Unknown result type (might be due to invalid IL or missing references)
			//IL_03a4: Expected O, but got Unknown
			//IL_03bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ca: Expected O, but got Unknown
			//IL_03e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_03f0: Expected O, but got Unknown
			//IL_040b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0416: Expected O, but got Unknown
			//IL_0431: Unknown result type (might be due to invalid IL or missing references)
			//IL_043c: Expected O, but got Unknown
			//IL_0457: Unknown result type (might be due to invalid IL or missing references)
			//IL_0462: Expected O, but got Unknown
			//IL_047d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0488: Expected O, but got Unknown
			//IL_04a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_04ae: Expected O, but got Unknown
			//IL_04ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_04d5: Expected O, but got Unknown
			//IL_04f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_04ff: Expected O, but got Unknown
			//IL_051e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0529: Expected O, but got Unknown
			//IL_0548: Unknown result type (might be due to invalid IL or missing references)
			//IL_0553: Expected O, but got Unknown
			//IL_056e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0579: Expected O, but got Unknown
			//IL_0594: Unknown result type (might be due to invalid IL or missing references)
			//IL_059f: Expected O, but got Unknown
			//IL_05ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_05c5: Expected O, but got Unknown
			//IL_05e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_05eb: Expected O, but got Unknown
			//IL_0606: Unknown result type (might be due to invalid IL or missing references)
			//IL_0611: Expected O, but got Unknown
			//IL_062c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0637: Expected O, but got Unknown
			//IL_0652: Unknown result type (might be due to invalid IL or missing references)
			//IL_065d: Expected O, but got Unknown
			//IL_0678: Unknown result type (might be due to invalid IL or missing references)
			//IL_0683: Expected O, but got Unknown
			//IL_069e: Unknown result type (might be due to invalid IL or missing references)
			//IL_06a9: Expected O, but got Unknown
			//IL_06c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_06d3: Expected O, but got Unknown
			configFile = plugin.Config;
			_serverConfigLocked = config("1 - General", "Lock Configuration", value: true, "If on, the configuration is locked and can be changed by server admins only.");
			ConfigSync.AddLockingConfigEntry<bool>(_serverConfigLocked);
			debug = config("1 - General", "DebugMode", value: false, "Enabling/Disabling the debugging in the console (default = false)", synchronizedSetting: false);
			mapPlayersListPosition = config<Vector2>("1 - General", "Map Players List Position", new Vector2(-568f, 100f), "Left corner position for the map players list (default: x=-568, y=100)", synchronizedSetting: false);
			mapPinColoring = config("1 - General", "Map Pins PvP Coloring", value: true, "Enable/disable the pins coloring in the player maps according to their pvp status", synchronizedSetting: false);
			maxPlayerNamesCharactersInList = config("1 - General", "Max Player Names Number of Characters In List", 15, "Limits the player name shown in the map players list and replace by '...' when too long to avoid overlap with other elements", synchronizedSetting: false);
			showMessageWhenLootingYourTombstone = config("1 - General", "Show Message When Looting Your Tombstone", value: true, "Enable/disable showing alert in your screen when your tombstone is being looted.");
			pvpAdminExempt = config("2 - PvP Settings", "Admin Exempt", Toggle.On, new ConfigDescription("If on, server admins can bypass the pvp biomes rules.", (AcceptableValueBase)null, Array.Empty<object>()));
			pvpRuleInWards = config("2 - PvP Settings", "PvP Rule In Wards (override biome)", PvPWardRule.FollowBiomeRule, new ConfigDescription("Set up the pvp rule inside wards, overriding biome rules if it's needed. Possible values: Pvp,Pve,PlayerChoice,FollowBiomeRule", (AcceptableValueBase)null, Array.Empty<object>()));
			pvpRuleInMeadows = config("2 - PvP Settings", "Biome 1 - Meadows Rule", PvPBiomeRule.Pvp, new ConfigDescription("Set up the pvp rule in Meadows. Possible values: Pvp,Pve,PlayerChoice.", (AcceptableValueBase)null, Array.Empty<object>()));
			pvpRuleInBlackForest = config("2 - PvP Settings", "Biome 2 - Black Forest Rule", PvPBiomeRule.Pvp, new ConfigDescription("Set up the pvp rule in Black Forest. Possible values: Pvp,Pve,PlayerChoice.", (AcceptableValueBase)null, Array.Empty<object>()));
			pvpRuleInSwamp = config("2 - PvP Settings", "Biome 3 - Swamp Rule", PvPBiomeRule.Pvp, new ConfigDescription("Set up the pvp rule in Swamp. Possible values: Pvp,Pve,PlayerChoice.", (AcceptableValueBase)null, Array.Empty<object>()));
			pvpRuleInMountain = config("2 - PvP Settings", "Biome 4 - Mountain Rule", PvPBiomeRule.Pvp, new ConfigDescription("Set up the pvp rule in Mountain. Possible values: Pvp,Pve,PlayerChoice.", (AcceptableValueBase)null, Array.Empty<object>()));
			pvpRuleInPlains = config("2 - PvP Settings", "Biome 5 - Plains Rule", PvPBiomeRule.Pvp, new ConfigDescription("Set up the pvp rule in Plains. Possible values: Pvp,Pve,PlayerChoice.", (AcceptableValueBase)null, Array.Empty<object>()));
			pvpRuleInMistlands = config("2 - PvP Settings", "Biome 6 - Mistlands Rule", PvPBiomeRule.Pvp, new ConfigDescription("Set up the pvp rule in Mistlands. Possible values: Pvp,Pve,PlayerChoice.", (AcceptableValueBase)null, Array.Empty<object>()));
			pvpRuleInAshlands = config("2 - PvP Settings", "Biome 7 - Ashlands Rule", PvPBiomeRule.Pvp, new ConfigDescription("Set up the pvp rule in Ashlands. Possible values: Pvp,Pve,PlayerChoice.", (AcceptableValueBase)null, Array.Empty<object>()));
			pvpRuleInDeepNorth = config("2 - PvP Settings", "Biome 8 - Deep North Rule", PvPBiomeRule.Pvp, new ConfigDescription("Set up the pvp rule in Deep North. Possible values: Pvp,Pve,PlayerChoice.", (AcceptableValueBase)null, Array.Empty<object>()));
			pvpRuleInOcean = config("2 - PvP Settings", "Biome 9 - Ocean Rule", PvPBiomeRule.Pvp, new ConfigDescription("Set up the pvp rule in Ocean. Possible values: Pvp,Pve,PlayerChoice.", (AcceptableValueBase)null, Array.Empty<object>()));
			pvpTombstoneLootAlertMessage = config("2 - PvP Settings", "Tombstone Looting Alert Message", "<color=red>{0} is looting your tombstone!</color>", new ConfigDescription("Shows alert on tombstone owner screen when being looted by a different player", (AcceptableValueBase)null, Array.Empty<object>()));
			pvpTombstoneDestroyAlertMessage = config("2 - PvP Settings", "Tombstone Destroy Alert Message", "<color=red>{0} sacked and destroyed your tombstone!</color>", new ConfigDescription("Shows alert on tombstone owner screen when destroyed by a different player", (AcceptableValueBase)null, Array.Empty<object>()));
			pvpMinimapPlayersListRefresh = config("2 - PvP Settings", "Map Players List Refresh", 10, new ConfigDescription("Time in seconds to refresh the players list in the map.", (AcceptableValueBase)null, Array.Empty<object>()));
			positionAdminExempt = config("3 - Map Position", "Admin Exempt", Toggle.On, new ConfigDescription("If on, server admins can bypass the 'Position Always On' rule.", (AcceptableValueBase)null, Array.Empty<object>()));
			positionRuleInWards = config("3 - Map Position", "Position Rule In Wards (override biome)", PositionSharingWardRule.FollowBiomeRule, new ConfigDescription("Set up the position sharing in wards, overriding biome rules if it's needed. Possible values: HidePlayer,ShowPlayer,PlayerChoice,FollowBiomeRule", (AcceptableValueBase)null, Array.Empty<object>()));
			positionRuleInMeadows = config("3 - Map Position", "Biome 1 - Meadows Rule", PositionSharingBiomeRule.ShowPlayer, new ConfigDescription("Set up the position sharing rule in Meadows. Possible values: HidePlayer,ShowPlayer,PlayerChoice.", (AcceptableValueBase)null, Array.Empty<object>()));
			positionRuleInBlackForest = config("3 - Map Position", "Biome 2 - Black Forest Rule", PositionSharingBiomeRule.ShowPlayer, new ConfigDescription("Set up the position sharing in Black Forest. Possible values: HidePlayer,ShowPlayer,PlayerChoice.", (AcceptableValueBase)null, Array.Empty<object>()));
			positionRuleInSwamp = config("3 - Map Position", "Biome 3 - Swamp Rule", PositionSharingBiomeRule.ShowPlayer, new ConfigDescription("Set up the position sharing in Swamp. Possible values: HidePlayer,ShowPlayer,PlayerChoice.", (AcceptableValueBase)null, Array.Empty<object>()));
			positionRuleInMountain = config("3 - Map Position", "Biome 4 - Mountain Rule", PositionSharingBiomeRule.ShowPlayer, new ConfigDescription("Set up the position sharing in Mountain. Possible values: HidePlayer,ShowPlayer,PlayerChoice.", (AcceptableValueBase)null, Array.Empty<object>()));
			positionRuleInPlains = config("3 - Map Position", "Biome 5 - Plains Rule", PositionSharingBiomeRule.ShowPlayer, new ConfigDescription("Set up the position sharing in Plains. Possible values: HidePlayer,ShowPlayer,PlayerChoice.", (AcceptableValueBase)null, Array.Empty<object>()));
			positionRuleInMistlands = config("3 - Map Position", "Biome 6 - Mistlands Rule", PositionSharingBiomeRule.ShowPlayer, new ConfigDescription("Set up the position sharing in Mistlands. Possible values: HidePlayer,ShowPlayer,PlayerChoice.", (AcceptableValueBase)null, Array.Empty<object>()));
			positionRuleInAshlands = config("3 - Map Position", "Biome 7 - Ashlands Rule", PositionSharingBiomeRule.ShowPlayer, new ConfigDescription("Set up the position sharing in Ashlands. Possible values: HidePlayer,ShowPlayer,PlayerChoice.", (AcceptableValueBase)null, Array.Empty<object>()));
			positionRuleInDeepNorth = config("3 - Map Position", "Biome 8 - Deep North Rule", PositionSharingBiomeRule.ShowPlayer, new ConfigDescription("Set up the position sharing in Deep North. Possible values: HidePlayer,ShowPlayer,PlayerChoice.", (AcceptableValueBase)null, Array.Empty<object>()));
			positionRuleInOcean = config("3 - Map Position", "Biome 9 - Ocean Rule", PositionSharingBiomeRule.ShowPlayer, new ConfigDescription("Set up the position sharing in Ocean. Possible values: HidePlayer,ShowPlayer,PlayerChoice.", (AcceptableValueBase)null, Array.Empty<object>()));
			pvpWackyEpicMMOLevelDifferenceLimitEnabled = config("4 - Mods integration", "Max Level Difference to damage in PvP areas - Activation", Toggle.Off, new ConfigDescription("Activate the limits the difference of levels between players to damage each other in pvp areas.", (AcceptableValueBase)null, Array.Empty<object>()));
			pvpWackyEpicMMOLevelDifferenceLimitValue = config("4 - Mods integration", "Max Level Difference to damage in PvP areas - Value", 100, new ConfigDescription("Limits the difference of levels between players to damage each other in pvp areas (default = 100).", (AcceptableValueBase)null, Array.Empty<object>()));
			playersListPanelButtonText = config("5 - Translations", "Players List Panel Button Text", "Show/Hide list", new ConfigDescription("Button name used to show/hide the players panel list in the minimap.", (AcceptableValueBase)null, Array.Empty<object>()));
			playersMapListTitle = config("5 - Translations", "Players Map List Title", "Players", new ConfigDescription("Title of the map players list with connected count.", (AcceptableValueBase)null, Array.Empty<object>()));
			wardCreationNotAllowed = config("5 - Translations", "Ward Creation Not Allowed", "Ward Creation is not allowed in this biome", new ConfigDescription("Title of the map players list with connected count.", (AcceptableValueBase)null, Array.Empty<object>()));
			wardCreationInMeadows = config("6 - Ward Creation", "Ward Creation 1 - Meadows Rule", Toggle.On, new ConfigDescription("Enable/disable if the player can place wards in Meadows.", (AcceptableValueBase)null, Array.Empty<object>()));
			wardCreationInBlackForest = config("6 - Ward Creation", "Ward Creation 2 - Black Forest Rule", Toggle.On, new ConfigDescription("Enable/disable if the player can place wards in Black Forest.", (AcceptableValueBase)null, Array.Empty<object>()));
			wardCreationInSwamp = config("6 - Ward Creation", "Ward Creation 3 - Swamp Rule", Toggle.On, new ConfigDescription("Enable/disable if the player can place wards in Swamp.", (AcceptableValueBase)null, Array.Empty<object>()));
			wardCreationInMountain = config("6 - Ward Creation", "Ward Creation 4 - Mountain Rule", Toggle.On, new ConfigDescription("Enable/disable if the player can place wards in Mountains.", (AcceptableValueBase)null, Array.Empty<object>()));
			wardCreationInPlains = config("6 - Ward Creation", "Ward Creation 5 - Plains Rule", Toggle.On, new ConfigDescription("Enable/disable if the player can place wards in Plains.", (AcceptableValueBase)null, Array.Empty<object>()));
			wardCreationInMistlands = config("6 - Ward Creation", "Ward Creation 6 - Mistlands Rule", Toggle.On, new ConfigDescription("Enable/disable if the player can place wards in Mistlands.", (AcceptableValueBase)null, Array.Empty<object>()));
			wardCreationInAshlands = config("6 - Ward Creation", "Ward Creation 7 - Ashlands Rule", Toggle.On, new ConfigDescription("Enable/disable if the player can place wards in Ashlands.", (AcceptableValueBase)null, Array.Empty<object>()));
			wardCreationInDeepNorth = config("6 - Ward Creation", "Ward Creation 8 - Deep North Rule", Toggle.On, new ConfigDescription("Enable/disable if the player can place wards in Deep North.", (AcceptableValueBase)null, Array.Empty<object>()));
			wardCreationInOcean = config("6 - Ward Creation", "Ward Creation 9 - Ocean Rule", Toggle.On, new ConfigDescription("Enable/disable if the player can place wards in Ocean.", (AcceptableValueBase)null, Array.Empty<object>()));
			wardModsPrefabIds = config("6 - Ward Creation", "Ward Creation Mods PrefabIds", "Thorward", new ConfigDescription("Comma-separated list of extra ward pieces from other mods to include in the ward creation check (default = Thorward).", (AcceptableValueBase)null, Array.Empty<object>()));
			SetupWatcher();
		}

		private static void SetupWatcher()
		{
			FileSystemWatcher fileSystemWatcher = new FileSystemWatcher(Paths.ConfigPath, ConfigFileName);
			fileSystemWatcher.Changed += ReadConfigValues;
			fileSystemWatcher.Created += ReadConfigValues;
			fileSystemWatcher.Renamed += ReadConfigValues;
			fileSystemWatcher.IncludeSubdirectories = true;
			fileSystemWatcher.SynchronizingObject = ThreadingHelper.SynchronizingObject;
			fileSystemWatcher.EnableRaisingEvents = true;
		}

		private static void ReadConfigValues(object sender, FileSystemEventArgs e)
		{
			if (!File.Exists(ConfigFileFullPath))
			{
				return;
			}
			try
			{
				Logger.Log("Attempting to reload configuration...");
				configFile.Reload();
				SettingsChanged(null, null);
			}
			catch
			{
				Logger.LogError("There was an issue loading " + ConfigFileName);
			}
		}

		private static void SettingsChanged(object sender, EventArgs e)
		{
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			if (MinimapUpdatePatch.panel != null)
			{
				((TMP_Text)((Component)MinimapUpdatePatch.panel.showHidePanelButton).GetComponentInChildren<TextMeshProUGUI>()).text = playersListPanelButtonText.Value;
				MinimapUpdatePatch.panel.panelRT.anchoredPosition = mapPlayersListPosition.Value;
			}
		}

		private static ConfigEntry<T> config<T>(string group, string name, T value, string description, bool synchronizedSetting = true)
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Expected O, but got Unknown
			return config(group, name, value, new ConfigDescription(description, (AcceptableValueBase)null, Array.Empty<object>()), synchronizedSetting);
		}

		private static ConfigEntry<T> config<T>(string group, string name, T value, ConfigDescription description, bool synchronizedSetting = true)
		{
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Expected O, but got Unknown
			ConfigDescription val = new ConfigDescription(description.Description + (synchronizedSetting ? " [Synced with Server]" : " [Not Synced with Server]"), description.AcceptableValues, description.Tags);
			ConfigEntry<T> val2 = configFile.Bind<T>(group, name, value, val);
			SyncedConfigEntry<T> syncedConfigEntry = ConfigSync.AddConfigEntry<T>(val2);
			syncedConfigEntry.SynchronizedConfig = synchronizedSetting;
			return val2;
		}

		static ConfigurationFile()
		{
			string configPath = Paths.ConfigPath;
			char directorySeparatorChar = Path.DirectorySeparatorChar;
			ConfigFileFullPath = configPath + directorySeparatorChar + ConfigFileName;
			ConfigSync = new ConfigSync("Turbero.PvPBiomeDominions")
			{
				DisplayName = "PvP Biome Dominions",
				CurrentVersion = "1.4.0",
				MinimumRequiredVersion = "1.4.0"
			};
		}
	}
	public static class Logger
	{
		public static ManualLogSource logger = Logger.CreateLogSource("PvP Biome Dominions");

		internal static void Log(object s)
		{
			if (ConfigurationFile.debug.Value)
			{
				logger.LogInfo((object)s?.ToString());
			}
		}

		internal static void LogInfo(object s)
		{
			logger.LogInfo((object)s?.ToString());
		}

		internal static void LogWarning(object s)
		{
			string text = "PvP Biome Dominions 1.4.0: " + ((s != null) ? s.ToString() : "null");
			Debug.LogWarning((object)text);
		}

		internal static void LogError(object s)
		{
			string text = "PvP Biome Dominions 1.4.0: " + ((s != null) ? s.ToString() : "null");
			Debug.LogError((object)text);
		}
	}
	[BepInPlugin("Turbero.PvPBiomeDominions", "PvP Biome Dominions", "1.4.0")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	public class PvPBiomeDominions : BaseUnityPlugin
	{
		public const string GUID = "Turbero.PvPBiomeDominions";

		public const string NAME = "PvP Biome Dominions";

		public const string VERSION = "1.4.0";

		private readonly Harmony harmony = new Harmony("Turbero.PvPBiomeDominions");

		private void Awake()
		{
			ConfigurationFile.LoadConfig((BaseUnityPlugin)(object)this);
			harmony.PatchAll();
		}

		private void onDestroy()
		{
			harmony.UnpatchSelf();
		}
	}
	[HarmonyPatch]
	public class NoWarnings
	{
		[HarmonyPatch(typeof(Debug), "LogWarning", new Type[]
		{
			typeof(object),
			typeof(Object)
		})]
		[HarmonyPrefix]
		private static bool LogWarning(object message, Object context)
		{
			if (message.ToString().Contains("The LiberationSans SDF Font Asset was not found") || message.ToString().Contains("The character used for Ellipsis is not available in font asset"))
			{
				return false;
			}
			return true;
		}
	}
}
namespace PvPBiomeDominions.RPC
{
	public class RPC_PlayerRelevantInfo
	{
		public string playerName;

		public int level;

		public bool isPvP;

		public string GetLevelText()
		{
			return (level > 0) ? level.ToString() : "???";
		}

		public ZPackage GetPackage()
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Expected O, but got Unknown
			ZPackage val = new ZPackage();
			val.Write(playerName);
			val.Write(level);
			val.Write(isPvP);
			return val;
		}

		public static RPC_PlayerRelevantInfo FromPackage(ZPackage pkg)
		{
			return new RPC_PlayerRelevantInfo
			{
				playerName = pkg.ReadString(),
				level = pkg.ReadInt(),
				isPvP = pkg.ReadBool()
			};
		}
	}
	[HarmonyPatch(typeof(Game), "Start")]
	public class GameStartPatch
	{
		private static void Prefix()
		{
			ZRoutedRpc.instance.Register<bool>("RPC_TombStoneAlertPlayer", (Action<long, bool>)TombStoneAlertsPatch.RPC_TombStoneAlertPlayer);
			ZRoutedRpc.instance.Register("RPC_RequestPlayerRelevantInfo", (Action<long>)RPC_PlayersListPanel.RPC_RequestPlayerRelevantInfo);
			ZRoutedRpc.instance.Register<ZPackage>("RPC_ResponsePlayerRelevantInfo", (Action<long, ZPackage>)RPC_PlayersListPanel.RPC_ResponsePlayerRelevantInfo);
			ZRoutedRpc.instance.Register<string>("RPC_AddKillToKiller", (Action<long, string>)PvPKillCountPatch.RPC_AddKillToKiller);
		}
	}
}
namespace PvPBiomeDominions.PvPManagement
{
	[HarmonyPatch(typeof(Minimap), "UpdatePlayerPins")]
	[HarmonyPriority(0)]
	public static class Minimap_UpdatePlayerPins_Patch
	{
		private static void Postfix(Minimap __instance)
		{
			//IL_011d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0124: Invalid comparison between Unknown and I4
			//IL_01ef: Unknown result type (might be due to invalid IL or missing references)
			if (!ConfigurationFile.mapPinColoring.Value || MinimapUpdatePatch.panel == null)
			{
				return;
			}
			Dictionary<string, PlayerInfo> dictionary = (from p in ZNet.instance.GetPlayerList()
				group p by p.m_name).ToDictionary((IGrouping<string, PlayerInfo> p) => p.Key, (IGrouping<string, PlayerInfo> p) => p.First());
			List<PinData> source = (List<PinData>)GameManager.GetPrivateValue(__instance, "m_pins");
			List<PinData> list = source.Where((PinData p) => (int)p.m_type == 10).ToList();
			List<PlayerReference> list2 = new List<PlayerReference>();
			if (API.IsLoaded())
			{
				list2.AddRange(API.GroupPlayers());
			}
			foreach (PinData pin in list)
			{
				if ((int)pin.m_type != 10 || string.IsNullOrEmpty(pin.m_name) || pin.m_name == Player.m_localPlayer.GetPlayerName() || !dictionary.Keys.Contains(pin.m_name) || list2.FindIndex((PlayerReference pRef) => pRef.name == pin.m_name) >= 0)
				{
					continue;
				}
				RectTransform uiElement = pin.m_uiElement;
				Image val = ((uiElement != null) ? ((Component)uiElement).GetComponent<Image>() : null);
				if (!((Object)(object)val == (Object)null))
				{
					bool flag = MinimapUpdatePatch.panel.cachedPlayerEntries.Find((PlayerEntry cpe) => cpe.name.Equals(pin.m_name))?.isPvP ?? GameManager.isInfoPVP(GeneralExtensions.GetValueSafe<string, PlayerInfo>(dictionary, pin.m_name));
					val.sprite = (flag ? ImageManager.getSpriteIconVanillaImage() : ImageManager.spriteBlueIconImage);
				}
			}
		}
	}
	[HarmonyPatch(typeof(Player), "GetKnownTexts")]
	public class FixCompendium
	{
		public static void Postfix(ref List<KeyValuePair<string, string>> __result)
		{
			__result = __result.Where((KeyValuePair<string, string> p) => !p.Key.StartsWith("Turbero.PvPBiomeDominions")).ToList();
		}
	}
	[HarmonyPatch(typeof(Character), "ApplyDamage")]
	public class PvPKillCountPatch
	{
		[HarmonyPostfix]
		public static void ApplyReceivedDamageToCharacter(Character __instance, HitData hit)
		{
			//IL_00f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0122: Unknown result type (might be due to invalid IL or missing references)
			//IL_0127: Unknown result type (might be due to invalid IL or missing references)
			Logger.Log("[ApplyReceivedDamageToCharacter] Postfix. Damage received to character type: " + ((object)__instance).GetType());
			if (__instance.IsTamed() || __instance.GetHealth() > 0f || (Object)(object)__instance != (Object)(object)Player.m_localPlayer)
			{
				return;
			}
			Logger.Log("Player killed detected!");
			Player val = (Player)(object)((__instance is Player) ? __instance : null);
			Character attacker = hit.GetAttacker();
			if (!(((Object)((Component)attacker).gameObject).name != "Player(Clone)"))
			{
				Player val2 = (Player)(object)((attacker is Player) ? attacker : null);
				string playerName = val2.GetPlayerName();
				Logger.Log("Player killed by Player " + playerName + " detected!");
				int newCount = updateLocalPlayerKnownText(GameManager.PREFIX_KILLEDBY + playerName, "PvPKillCountPatch");
				if (MinimapUpdatePatch.panel != null)
				{
					MinimapUpdatePatch.panel.UpdatePlayerKilledByCount(playerName, newCount);
				}
				ZDOID zDOID = ((Character)val2).GetZDOID();
				Logger.Log($"Trying RPC with {((ZDOID)(ref zDOID)).UserID} and {val.GetPlayerName()}");
				ZRoutedRpc instance = ZRoutedRpc.instance;
				zDOID = ((Character)val2).GetZDOID();
				instance.InvokeRoutedRPC(((ZDOID)(ref zDOID)).UserID, "RPC_AddKillToKiller", new object[1] { val.GetPlayerName() });
			}
		}

		public static void RPC_AddKillToKiller(long sender, string killedPlayerName)
		{
			Logger.Log("[RPC_AddKillToKiller] RPC called.");
			int newCount = updateLocalPlayerKnownText(GameManager.PREFIX_KILLS + killedPlayerName, "RPC_AddKillToKiller");
			if (MinimapUpdatePatch.panel != null)
			{
				MinimapUpdatePatch.panel.UpdatePlayerKillsCount(killedPlayerName, newCount);
			}
		}

		private static int updateLocalPlayerKnownText(string knownTextToUpdate, string callerMethod)
		{
			Dictionary<string, string> dictionary = (Dictionary<string, string>)GameManager.GetPrivateValue(Player.m_localPlayer, "m_knownTexts");
			int result = 1;
			if (dictionary.ContainsKey(knownTextToUpdate))
			{
				string valueSafe = GeneralExtensions.GetValueSafe<string, string>(dictionary, knownTextToUpdate);
				if (int.TryParse(valueSafe, out var result2))
				{
					dictionary.Remove(knownTextToUpdate);
					dictionary.Add(knownTextToUpdate, (result2 + 1).ToString() ?? "");
					result = result2 + 1;
					Logger.Log("[" + callerMethod + "] New key value: " + result);
				}
				else
				{
					dictionary.Remove(knownTextToUpdate);
					dictionary.Add(knownTextToUpdate, result.ToString());
					Logger.Log("[" + callerMethod + "] Add new knownText: " + knownTextToUpdate + " with value=1");
				}
			}
			else
			{
				dictionary.Add(knownTextToUpdate, "1");
				Logger.Log("[" + callerMethod + "] Add new knownText: " + knownTextToUpdate + " with value=1");
			}
			return result;
		}
	}
	[HarmonyPatch(typeof(Character), "Damage")]
	[HarmonyPriority(700)]
	public class PvPDamageCheckWackyEpicMMOPatch
	{
		private static bool Prefix(HitData hit, Character __instance)
		{
			if (!EpicMMOSystem_API.IsLoaded() || ConfigurationFile.pvpWackyEpicMMOLevelDifferenceLimitEnabled.Value == ConfigurationFile.Toggle.Off)
			{
				return true;
			}
			if ((Object)(object)__instance != (Object)null && ((object)__instance).GetType() == typeof(Player))
			{
				Character attacker = hit.GetAttacker();
				if ((Object)(object)attacker != (Object)null && ((object)attacker).GetType() == typeof(Player))
				{
					if (((object)attacker).GetType() == typeof(Player))
					{
						Character obj = ((__instance is Player) ? __instance : null);
						string obj2 = ((obj != null) ? ((Player)obj).GetPlayerName() : null);
						Character obj3 = ((attacker is Player) ? attacker : null);
						if (obj2 == ((obj3 != null) ? ((Player)obj3).GetPlayerName() : null))
						{
							return true;
						}
					}
					Player obj4 = (Player)(object)((attacker is Player) ? attacker : null);
					Dictionary<string, string> dictionary = (Dictionary<string, string>)GameManager.GetPrivateValue(obj4, "m_knownTexts");
					string s = dictionary["EpicMMOSystem_LevelSystem_Level"];
					int result;
					bool flag = int.TryParse(s, out result);
					Player obj5 = (Player)(object)((__instance is Player) ? __instance : null);
					Dictionary<string, string> dictionary2 = (Dictionary<string, string>)GameManager.GetPrivateValue(obj5, "m_knownTexts");
					string s2 = dictionary2["EpicMMOSystem_LevelSystem_Level"];
					int result2;
					bool flag2 = int.TryParse(s2, out result2);
					if (flag && flag2 && result2 - result > ConfigurationFile.pvpWackyEpicMMOLevelDifferenceLimitValue.Value)
					{
						return false;
					}
				}
			}
			return true;
		}
	}
	[HarmonyPatch]
	public class PlayerUpdatePatch
	{
		[HarmonyPatch(typeof(Player), "Update")]
		[HarmonyPatch(typeof(InventoryGui), "UpdateCharacterStats")]
		[HarmonyPostfix]
		public static void Postfix(Player __instance)
		{
			//IL_008e: Unknown result type (might be due to invalid IL or missing references)
			if (!Object.op_Implicit((Object)(object)ZNetScene.instance) || (Object.op_Implicit((Object)(object)Game.instance) && !Object.op_Implicit((Object)(object)Player.m_localPlayer)) || !Object.op_Implicit((Object)(object)InventoryGui.instance) || (ConfigurationFile.pvpAdminExempt.Value == ConfigurationFile.Toggle.On && ConfigurationFile.ConfigSync.IsAdmin) || (Marketplace_API.IsInstalled() && Marketplace_API.IsPointInsideTerritoryWithFlag(((Component)Player.m_localPlayer).transform.position, Marketplace_API.TerritoryFlags.PveOnly, out var _, out var _, out var _)))
			{
				return;
			}
			bool flag = WardIsLovePlugin.IsInsideWard();
			ConfigurationFile.PvPWardRule value = ConfigurationFile.pvpRuleInWards.Value;
			if (flag && value != ConfigurationFile.PvPWardRule.FollowBiomeRule)
			{
				if (value == ConfigurationFile.PvPWardRule.PlayerChoose)
				{
					((Selectable)InventoryGui.instance.m_pvp).interactable = true;
					return;
				}
				((Selectable)InventoryGui.instance.m_pvp).interactable = false;
				SetupPvP(InventoryGui.instance, value == ConfigurationFile.PvPWardRule.Pvp);
				return;
			}
			ConfigurationFile.PvPBiomeRule currentBiomeRulePvPRule = ConfigurationFile.getCurrentBiomeRulePvPRule();
			if (currentBiomeRulePvPRule == ConfigurationFile.PvPBiomeRule.PlayerChoose)
			{
				((Selectable)InventoryGui.instance.m_pvp).interactable = true;
				return;
			}
			((Selectable)InventoryGui.instance.m_pvp).interactable = false;
			SetupPvP(InventoryGui.instance, currentBiomeRulePvPRule == ConfigurationFile.PvPBiomeRule.Pvp);
		}

		private static void SetupPvP(InventoryGui invGUI, bool isPvPOn)
		{
			Player.m_localPlayer.SetPVP(isPvPOn);
			invGUI.m_pvp.isOn = isPvPOn;
		}
	}
	[HarmonyPatch(typeof(Player), "TryPlacePiece")]
	public static class PvPWardPatch
	{
		private static bool Prefix(Player __instance, Piece piece)
		{
			string text = ((Object)piece).name.Replace("(Clone)", "");
			if (text.ToLowerInvariant().Contains("guard_stone") || ConfigurationFile.wardModsPrefabIds.Value.ToLowerInvariant().Contains(text.ToLowerInvariant()))
			{
				Logger.Log("Ward creation detected. Checking...");
				if (!ConfigurationFile.IsWardCreationAllowedInCurrentBiomeRule())
				{
					Logger.Log("Not allowed in current biome.");
					((Character)__instance).Message((MessageType)2, ConfigurationFile.wardCreationNotAllowed.Value, 0, (Sprite)null);
					return false;
				}
			}
			Logger.Log("Allowed!");
			return true;
		}
	}
	public class TombStoneAlertsPatch
	{
		[HarmonyPatch(typeof(Container), "Interact")]
		public class Container_Interact_Patch
		{
			private static void Postfix(Container __instance, Humanoid character, bool hold, bool alt, ref bool __result)
			{
				if (!ConfigurationFile.showMessageWhenLootingYourTombstone.Value || ConfigurationFile.pvpTombstoneLootAlertMessage.Value == string.Empty)
				{
					return;
				}
				TombStone componentInParent = ((Component)__instance).GetComponentInParent<TombStone>();
				if (!((Object)(object)componentInParent == (Object)null))
				{
					Logger.Log("Checking tombstone interact alert...");
					if (__instance.GetInventory().GetAllItems().Count > 0)
					{
						processRPCWarning(componentInParent.GetOwnerName(), isInteractAlert: true);
					}
				}
			}
		}

		[HarmonyPatch(typeof(Container), "TakeAll")]
		public class Container_TakeAll_Patch
		{
			private static void Postfix(Container __instance, Humanoid character, ref bool __result)
			{
				if (!(ConfigurationFile.pvpTombstoneDestroyAlertMessage.Value == string.Empty) && __result)
				{
					TombStone componentInParent = ((Component)__instance).GetComponentInParent<TombStone>();
					if (!((Object)(object)componentInParent == (Object)null))
					{
						Logger.Log("Checking tombstone takeAll alert...");
						processRPCWarning(componentInParent.GetOwnerName(), isInteractAlert: false);
					}
				}
			}
		}

		private static void processRPCWarning(string owner, bool isInteractAlert)
		{
			//IL_0064: Unknown result type (might be due to invalid IL or missing references)
			//IL_0069: Unknown result type (might be due to invalid IL or missing references)
			Player localPlayer = Player.m_localPlayer;
			Logger.Log("owner " + owner + " vs localPlayer " + localPlayer.GetPlayerName());
			if (owner != localPlayer.GetPlayerName())
			{
				PlayerInfo val = ((IEnumerable<PlayerInfo>)ZNet.instance.GetPlayerList()).FirstOrDefault((Func<PlayerInfo, bool>)((PlayerInfo p) => p.m_name.Equals(owner)));
				long userID = ((ZDOID)(ref val.m_characterID)).UserID;
				if (userID == 0)
				{
					Logger.Log("Not found (probably disconnected)");
					return;
				}
				Logger.Log($"Sending alert message to tombStone owner {owner} with ID {userID}...");
				ZRoutedRpc.instance.InvokeRoutedRPC(userID, "RPC_TombStoneAlertPlayer", new object[1] { isInteractAlert });
			}
			else
			{
				Logger.Log("Recovering tombStone content...");
			}
		}

		public static void RPC_TombStoneAlertPlayer(long sender, bool isInteractAlert)
		{
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0034: Unknown result type (might be due to invalid IL or missing references)
			//IL_004f: Unknown result type (might be due to invalid IL or missing references)
			//IL_009c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0076: Unknown result type (might be due to invalid IL or missing references)
			Logger.Log("[RPC_TombStoneAlertPlayer] entered");
			PlayerInfo val = ((IEnumerable<PlayerInfo>)ZNet.instance.GetPlayerList()).FirstOrDefault((Func<PlayerInfo, bool>)((PlayerInfo p) => ((ZDOID)(ref p.m_characterID)).UserID == sender));
			Player localPlayer = Player.m_localPlayer;
			Logger.Log("[RPC_TombStoneAlertPlayer] RPC sent to " + Player.m_localPlayer.GetPlayerName() + " from " + val.m_name);
			if (isInteractAlert)
			{
				((Character)localPlayer).Message((MessageType)2, ConfigurationFile.pvpTombstoneLootAlertMessage.Value.Replace("{0}", val.m_name), 0, (Sprite)null);
			}
			else
			{
				((Character)localPlayer).Message((MessageType)2, ConfigurationFile.pvpTombstoneDestroyAlertMessage.Value.Replace("{0}", val.m_name), 0, (Sprite)null);
			}
		}
	}
}
namespace PvPBiomeDominions.PositionManagement
{
	[HarmonyPatch(typeof(Minimap), "Update")]
	public static class MinimapUpdatePatch
	{
		private static bool created;

		private static float lastUpdateTime;

		public static PlayersListPanel panel;

		public static void Postfix(Minimap __instance)
		{
			//IL_0131: Unknown result type (might be due to invalid IL or missing references)
			//IL_0136: Unknown result type (might be due to invalid IL or missing references)
			//IL_0138: Unknown result type (might be due to invalid IL or missing references)
			if (!Object.op_Implicit((Object)(object)__instance) || (Object)(object)Player.m_localPlayer == (Object)null)
			{
				return;
			}
			HandlePlayersListPanel(__instance);
			if ((Object)(object)__instance.m_largeRoot != (Object)null && __instance.m_largeRoot.activeSelf && Time.time - lastUpdateTime >= (float)ConfigurationFile.pvpMinimapPlayersListRefresh.Value)
			{
				lastUpdateTime = Time.time;
				ConfigurationFile.configFile.Reload();
			}
			if (ConfigurationFile.positionAdminExempt.Value == ConfigurationFile.Toggle.On && ConfigurationFile.ConfigSync.IsAdmin)
			{
				return;
			}
			bool flag = WardIsLovePlugin.IsInsideWard();
			ConfigurationFile.PositionSharingWardRule value = ConfigurationFile.positionRuleInWards.Value;
			if (flag && value != ConfigurationFile.PositionSharingWardRule.FollowBiomeRule)
			{
				if (value != ConfigurationFile.PositionSharingWardRule.PlayerChoice)
				{
					__instance.m_publicPosition.isOn = value == ConfigurationFile.PositionSharingWardRule.ShowPlayer;
				}
				return;
			}
			FieldInfo field = ((object)__instance).GetType().GetField("m_biome", BindingFlags.Instance | BindingFlags.NonPublic);
			if (field == null)
			{
				return;
			}
			object value2 = field.GetValue(__instance);
			if (value2 == null)
			{
				return;
			}
			Biome currentBiome = Player.m_localPlayer.GetCurrentBiome();
			ConfigurationFile.PositionSharingBiomeRule biomeRulePosition = ConfigurationFile.getBiomeRulePosition(currentBiome);
			if (biomeRulePosition != ConfigurationFile.PositionSharingBiomeRule.PlayerChoice)
			{
				__instance.m_publicPosition.isOn = biomeRulePosition == ConfigurationFile.PositionSharingBiomeRule.ShowPlayer;
				if (__instance.m_publicPosition.isOn)
				{
					ImageManager.UpdateMapSelectorIcon();
				}
			}
		}

		private static void HandlePlayersListPanel(Minimap __instance)
		{
			if ((Object)(object)__instance.m_largeRoot == (Object)null)
			{
				return;
			}
			if (!created || panel == null || (Object)(object)panel.panelRoot == (Object)null)
			{
				Logger.Log("HandlePlayersListPanel - First time");
				panel = new PlayersListPanel(__instance);
				created = true;
				if (IsBigMapOpened(__instance))
				{
					panel.RefreshContent((from p in ZNet.instance.GetPlayerList()
						orderby p.m_name
						select p).ToList(), createNewCache: true);
				}
			}
			else if (IsBigMapOpened(__instance) && Time.time - lastUpdateTime >= (float)ConfigurationFile.pvpMinimapPlayersListRefresh.Value)
			{
				lastUpdateTime = Time.time;
				panel.RefreshContent(ZNet.instance.GetPlayerList(), createNewCache: false);
			}
		}

		private static bool IsBigMapOpened(Minimap __instance)
		{
			return (Object)(object)__instance.m_largeRoot != (Object)null && __instance.m_largeRoot.activeSelf && panel != null && (Object)(object)panel.panelRoot != (Object)null && panel.panelRoot.activeSelf;
		}
	}
	[HarmonyPatch(typeof(ZNet), "SetPublicReferencePosition")]
	public class PublicReferencePositionPatch
	{
		public static void Postfix(ref bool pub, ref bool ___m_publicReferencePosition)
		{
			if (ConfigurationFile.positionAdminExempt.Value == ConfigurationFile.Toggle.On && ConfigurationFile.ConfigSync.IsAdmin)
			{
				return;
			}
			bool flag = WardIsLovePlugin.IsInsideWard();
			ConfigurationFile.PositionSharingWardRule value = ConfigurationFile.positionRuleInWards.Value;
			if (flag && value != ConfigurationFile.PositionSharingWardRule.FollowBiomeRule)
			{
				if (value != ConfigurationFile.PositionSharingWardRule.PlayerChoice)
				{
					___m_publicReferencePosition = value == ConfigurationFile.PositionSharingWardRule.ShowPlayer;
				}
				return;
			}
			ConfigurationFile.PositionSharingBiomeRule currentBiomeRulePosition = ConfigurationFile.getCurrentBiomeRulePosition();
			if (currentBiomeRulePosition != ConfigurationFile.PositionSharingBiomeRule.PlayerChoice)
			{
				___m_publicReferencePosition = currentBiomeRulePosition == ConfigurationFile.PositionSharingBiomeRule.ShowPlayer;
				if (___m_publicReferencePosition)
				{
					ImageManager.UpdateMapSelectorIcon();
				}
			}
		}
	}
	[HarmonyPatch(typeof(Player), "OnSpawned")]
	public class PlayerOnSpawnedPatch
	{
		public static void Postfix(Player __instance)
		{
			if (ConfigurationFile.positionAdminExempt.Value == ConfigurationFile.Toggle.On && ConfigurationFile.ConfigSync.IsAdmin)
			{
				return;
			}
			bool flag = WardIsLovePlugin.IsInsideWard();
			ConfigurationFile.PositionSharingWardRule value = ConfigurationFile.positionRuleInWards.Value;
			if (flag && value != ConfigurationFile.PositionSharingWardRule.FollowBiomeRule)
			{
				if (value != ConfigurationFile.PositionSharingWardRule.PlayerChoice)
				{
					GameManager.SetPrivateValue(ZNet.instance, "m_publicReferencePosition", value == ConfigurationFile.PositionSharingWardRule.ShowPlayer);
				}
				return;
			}
			ConfigurationFile.PositionSharingBiomeRule currentBiomeRulePosition = ConfigurationFile.getCurrentBiomeRulePosition();
			if (currentBiomeRulePosition != ConfigurationFile.PositionSharingBiomeRule.PlayerChoice)
			{
				GameManager.SetPrivateValue(ZNet.instance, "m_publicReferencePosition", currentBiomeRulePosition == ConfigurationFile.PositionSharingBiomeRule.ShowPlayer);
				if (ZNet.instance.IsReferencePositionPublic())
				{
					ImageManager.UpdateMapSelectorIcon();
				}
			}
		}
	}
	public static class MessageHud_ShowMessage_Patch
	{
		private static bool Prefix(MessageHud __instance, MessageType type, string text)
		{
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: Invalid comparison between Unknown and I4
			Logger.Log("Text to look up: " + text + ". " + text.Contains("$msg_welcome"));
			if ((int)type == 2 && !(bool)GameManager.GetPrivateValue(ZNet.instance, "m_publicReferencePosition") && text.Contains("$msg_welcome"))
			{
				return false;
			}
			return true;
		}
	}
}
namespace PvPBiomeDominions.PositionManagement.UI
{
	public class PlayerEntry
	{
		public string name;

		public int level;

		public TextMeshProUGUI levelUI;

		public TextMeshProUGUI killsTimesUI;

		public TextMeshProUGUI killedByTimesUI;

		public Image iconPlayer;

		public bool isPvP;

		public string GetLevelText()
		{
			return (level > 0) ? level.ToString() : "???";
		}
	}
	public enum PlayersListOrderType
	{
		ByName,
		ByLevel
	}
	public enum PlayersListOrderDirection
	{
		ASC,
		DESC
	}
	public class PlayersListPanel
	{
		private static readonly Vector2 ROW_SIZE_DELTA = new Vector2(230f, 24f);

		private static readonly int LEVEL_DATA_UI_LENGTH = 80;

		public readonly GameObject panelRoot;

		public readonly RectTransform panelRT;

		private readonly GameObject content;

		private readonly Sprite killsIconSprite;

		public Button showHidePanelButton;

		private Button azSortButton;

		private Button levelSortButton;

		private readonly List<GameObject> playerEntriesObjects = new List<GameObject>();

		public readonly List<PlayerEntry> cachedPlayerEntries = new List<PlayerEntry>();

		private PlayersListOrderType orderType = PlayersListOrderType.ByName;

		private PlayersListOrderDirection orderDirection = PlayersListOrderDirection.ASC;

		public PlayersListPanel(Minimap minimap)
		{
			//IL_0052: Unknown result type (might be due to invalid IL or missing references)
			//IL_005c: Expected O, but got Unknown
			//IL_009f: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_010f: Unknown result type (might be due to invalid IL or missing references)
			//IL_013b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0178: Unknown result type (might be due to invalid IL or missing references)
			//IL_017e: Expected O, but got Unknown
			//IL_01b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0242: Unknown result type (might be due to invalid IL or missing references)
			//IL_0249: Expected O, but got Unknown
			//IL_0268: 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_0282: Unknown result type (might be due to invalid IL or missing references)
			//IL_028f: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_030a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0314: Expected O, but got Unknown
			//IL_0346: Unknown result type (might be due to invalid IL or missing references)
			//IL_035d: 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_0381: Unknown result type (might be due to invalid IL or missing references)
			//IL_038e: 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_03e0: Expected O, but got Unknown
			//IL_0447: Unknown result type (might be due to invalid IL or missing references)
			//IL_045e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0475: Unknown result type (might be due to invalid IL or missing references)
			//IL_048c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0499: Unknown result type (might be due to invalid IL or missing references)
			panelRoot = new GameObject("PlayersListPanel", new Type[2]
			{
				typeof(RectTransform),
				typeof(Image)
			});
			panelRoot.transform.SetParent(((Component)minimap).transform.Find("large"), false);
			panelRT = panelRoot.GetComponent<RectTransform>();
			panelRT.anchorMin = new Vector2(0.5f, 0.5f);
			panelRT.anchorMax = new Vector2(0.5f, 0.5f);
			panelRT.pivot = new Vector2(0.5f, 0.5f);
			panelRT.anchoredPosition = ConfigurationFile.mapPlayersListPosition.Value;
			panelRT.sizeDelta = new Vector2((float)(420 - getLevelUIContentLength(returnIfLoaded: false)), 620f);
			Image component = panelRoot.GetComponent<Image>();
			((Graphic)component).color = new Color(0f, 0f, 0f, 0.5f);
			GameObject val = new GameObject("ScrollView", new Type[3]
			{
				typeof(RectTransform),
				typeof(ScrollRect),
				typeof(Image)
			});
			val.transform.SetParent(panelRoot.transform, false);
			Object.Destroy((Object)(object)val.GetComponent<Image>());
			RectTransform component2 = val.GetComponent<RectTransform>();
			component2.anchorMin = new Vector2(0f, 0f);
			component2.anchorMax = new Vector2(1f, 1f);
			component2.offsetMin = Vector2.zero;
			component2.offsetMax = Vector2.zero;
			ScrollRect component3 = val.GetComponent<ScrollRect>();
			component3.horizontal = false;
			component3.scrollSensitivity = 2000f;
			component3.movementType = (MovementType)2;
			GameObject val2 = new GameObject("Viewport", new Type[3]
			{
				typeof(RectTransform),
				typeof(Mask),
				typeof(Image)
			});
			val2.transform.SetParent(val.transform, false);
			RectTransform component4 = val2.GetComponent<RectTransform>();
			component4.anchorMin = Vector2.zero;
			component4.anchorMax = Vector2.one;
			component4.offsetMin = Vector2.zero;
			component4.offsetMax = Vector2.zero;
			((Graphic)val2.GetComponent<Image>()).color = new Color(1f, 1f, 1f, 0.05f);
			val2.GetComponent<Mask>().showMaskGraphic = false;
			component3.viewport = component4;
			content = new GameObject("Content", new Type[3]
			{
				typeof(RectTransform),
				typeof(VerticalLayoutGroup),
				typeof(ContentSizeFitter)
			});
			content.transform.SetParent(val2.transform, false);
			RectTransform component5 = content.GetComponent<RectTransform>();
			component5.anchorMin = new Vector2(0f, 1f);
			component5.anchorMax = new Vector2(1f, 1f);
			component5.pivot = new Vector2(0.5f, 1f);
			component5.anchoredPosition = Vector2.zero;
			component5.sizeDelta = Vector2.zero;
			VerticalLayoutGroup component6 = content.GetComponent<VerticalLayoutGroup>();
			((HorizontalOrVerticalLayoutGroup)component6).childForceExpandHeight = false;
			((HorizontalOrVerticalLayoutGroup)component6).childForceExpandWidth = true;
			((LayoutGroup)component6).childAlignment = (TextAnchor)0;
			((HorizontalOrVerticalLayoutGroup)component6).spacing = 35f;
			((LayoutGroup)component6).padding = new RectOffset(0, 0, 20, 20);
			ContentSizeFitter component7 = content.GetComponent<ContentSizeFitter>();
			component7.verticalFit = (FitMode)2;
			component3.content = component5;
			GameObject gameObject = ((Component)InventoryGui.instance.m_recipeListScroll).gameObject;
			GameObject val3 = Object.Instantiate<GameObject>(gameObject, panelRoot.transform);
			((Object)val3).name = "Scrollbar";
			RectTransform component8 = val3.GetComponent<RectTransform>();
			component8.anchorMin = new Vector2(1f, 0f);
			component8.anchorMax = new Vector2(1f, 1f);
			component8.pivot = new Vector2(1f, 1f);
			component8.sizeDelta = new Vector2(11f, 0f);
			component8.anchoredPosition = Vector2.zero;
			Scrollbar component9 = val3.GetComponent<Scrollbar>();
			component9.direction = (Direction)2;
			component3.verticalScrollbar = component9;
			component3.verticalScrollbarVisibility = (ScrollbarVisibility)2;
			createButtons(minimap);
			killsIconSprite = ((Component)minimap.m_largeRoot.transform.Find("IconPanel2/IconDeath")).GetComponent<Image>().sprite;
		}

		private void createButtons(Minimap minimap)
		{
			//IL_0060: Unknown result type (might be due to invalid IL or missing references)
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0087: Expected O, but got Unknown
			//IL_009a: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a4: Expected O, but got Unknown
			//IL_00c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0148: Unknown result type (might be due to invalid IL or missing references)
			//IL_015f: Unknown result type (might be due to invalid IL or missing references)
			//IL_01aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_01dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e7: Expected O, but got Unknown
			//IL_01fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_0204: Expected O, but got Unknown
			//IL_0265: Unknown result type (might be due to invalid IL or missing references)
			//IL_027c: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_02fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_0304: Expected O, but got Unknown
			//IL_0317: Unknown result type (might be due to invalid IL or missing references)
			//IL_0321: Expected O, but got Unknown
			GameObject val = Object.Instantiate<GameObject>(((Component)((Component)InventoryGui.instance.m_skillsDialog).transform.Find("SkillsFrame/Closebutton")).gameObject, ((Component)minimap).transform.Find("large"));
			((Object)val).name = "PlayersListPanelButton";
			RectTransform component = val.GetComponent<RectTransform>();
			component.anchoredPosition = new Vector2(-680f, 45f);
			showHidePanelButton = val.GetComponent<Button>();
			showHidePanelButton.onClick = new ButtonClickedEvent();
			((UnityEvent)showHidePanelButton.onClick).AddListener((UnityAction)delegate
			{
				panelRoot.SetActive(!panelRoot.activeSelf);
			});
			TextMeshProUGUI componentInChildren = ((Component)showHidePanelButton).GetComponentInChildren<TextMeshProUGUI>();
			((TMP_Text)componentInChildren).fontStyle = (FontStyles)0;
			((Graphic)componentInChildren).color = new Color(1f, 0.7176f, 0.3603f);
			((TMP_Text)componentInChildren).alignment = (TextAlignmentOptions)514;
			((TMP_Text)componentInChildren).text = ConfigurationFile.playersListPanelButtonText.Value;
			GameObject val2 = Object.Instantiate<GameObject>(((Component)((Component)InventoryGui.instance.m_skillsDialog).transform.Find("SkillsFrame/Closebutton")).gameObject, ((Component)minimap).transform.Find("large"));
			((Object)val2).name = "PlayersListPanelAZButton";
			RectTransform component2 = val2.GetComponent<RectTransform>();
			component2.anchoredPosition = new Vector2(-555f, 45f);
			component2.sizeDelta = new Vector2(70f, 46f);
			azSortButton = val2.GetComponent<Button>();
			TextMeshProUGUI azSortbuttonText = ((Component)azSortButton).GetComponentInChildren<TextMeshProUGUI>();
			((TMP_Text)azSortbuttonText).fontStyle = (FontStyles)0;
			((Graphic)azSortbuttonText).color = new Color(1f, 0.7176f, 0.3603f);
			((TMP_Text)azSortbuttonText).alignment = (TextAlignmentOptions)514;
			((TMP_Text)azSortbuttonText).text = "A-Z";
			azSortButton.onClick = new ButtonClickedEvent();
			((UnityEvent)azSortButton.onClick).AddListener((UnityAction)delegate
			{
				orderType = PlayersListOrderType.ByName;
				if (((TMP_Text)azSortbuttonText).text.Equals("A-Z"))
				{
					((TMP_Text)azSortbuttonText).text = "Z-A";
					orderDirection = PlayersListOrderDirection.DESC;
				}
				else
				{
					((TMP_Text)azSortbuttonText).text = "A-Z";
					orderDirection = PlayersListOrderDirection.ASC;
				}
				RefreshContent(ZNet.instance.GetPlayerList(), createNewCache: false);
			});
			GameObject val3 = Object.Instantiate<GameObject>(((Component)((Component)InventoryGui.instance.m_skillsDialog).transform.Find("SkillsFrame/Closebutton")).gameObject, ((Component)minimap).transform.Find("large"));
			val3.SetActive(false);
			((Object)val3).name = "PlayersListPanelLevelButton";
			RectTransform component3 = val3.GetComponent<RectTransform>();
			component3.anchoredPosition = new Vector2(-480f, 45f);
			component3.sizeDelta = new Vector2(70f, 46f);
			levelSortButton = val3.GetComponent<Button>();
			TextMeshProUGUI levelSortbuttonText = ((Component)levelSortButton).GetComponentInChildren<TextMeshProUGUI>();
			((TMP_Text)levelSortbuttonText).fontStyle = (FontStyles)0;
			((Graphic)levelSortbuttonText).color = new Color(1f, 0.7176f, 0.3603f);
			((TMP_Text)levelSortbuttonText).alignment = (TextAlignmentOptions)514;
			((TMP_Text)levelSortbuttonText).text = "1-100";
			levelSortButton.onClick = new ButtonClickedEvent();
			((UnityEvent)levelSortButton.onClick).AddListener((UnityAction)delegate
			{
				orderType = PlayersListOrderType.ByLevel;
				if (((TMP_Text)levelSortbuttonText).text.Equals("1-100"))
				{
					((TMP_Text)levelSortbuttonText).text = "100-1";
					orderDirection = PlayersListOrderDirection.DESC;
				}
				else
				{
					((TMP_Text)levelSortbuttonText).text = "1-100";
					orderDirection = PlayersListOrderDirection.ASC;
				}
				RefreshContent(ZNet.instance.GetPlayerList(), createNewCache: false);
			});
		}

		public void RefreshContent(List<PlayerInfo> players, bool createNewCache)
		{
			//IL_0134: Unknown result type (might be due to invalid IL or missing references)
			//IL_0139: Unknown result type (might be due to invalid IL or missing references)
			//IL_0145: Unknown result type (might be due to invalid IL or missing references)
			//IL_0175: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_01eb: Unknown result type (might be due to invalid IL or missing references)
			foreach (GameObject playerEntriesObject in playerEntriesObjects)
			{
				Object.Destroy((Object)(object)playerEntriesObject);
			}
			playerEntriesObjects.Clear();
			if (createNewCache)
			{
				cachedPlayerEntries.Clear();
			}
			else
			{
				List<PlayerEntry> list = new List<PlayerEntry>();
				foreach (PlayerEntry cachedPlayerEntry in cachedPlayerEntries)
				{
					if (!players.Exists((PlayerInfo p) => p.m_name.Equals(cachedPlayerEntry.name)))
					{
						list.Add(cachedPlayerEntry);
					}
				}
				foreach (PlayerEntry item in list)
				{
					cachedPlayerEntries.Remove(item);
				}
			}
			List<PlayerReference> groupPlayers = GameManager.GetGroupPlayers();
			AddTitleHeaderToScrollList(players.Count);
			players = sortList(players);
			foreach (PlayerInfo player in players)
			{
				string playerName = player.m_name;
				if (groupPlayers.FindIndex((PlayerReference pRef) => pRef.name.Equals(playerName)) >= 0)
				{
					AddRowToScrollList(player, isInCurrentGroup: true, createNewCache);
				}
			}
			foreach (PlayerInfo player2 in players)
			{
				string playerName2 = player2.m_name;
				if (groupPlayers.FindIndex((PlayerReference pRef) => pRef.name.Equals(playerName2)) < 0)
				{
					AddRowToScrollList(player2, isInCurrentGroup: false, createNewCache);
				}
			}
			Logger.Log("Sending request to everyone");
			ZRoutedRpc.instance.InvokeRoutedRPC(ZRoutedRpc.Everybody, "RPC_RequestPlayerRelevantInfo", Array.Empty<object>());
		}

		private List<PlayerInfo> sortList(List<PlayerInfo> players)
		{
			if (orderType == PlayersListOrderType.ByName)
			{
				if (orderDirection == PlayersListOrderDirection.ASC)
				{
					return (from p in ZNet.instance.GetPlayerList()
						orderby p.m_name
						select p).ToList();
				}
				return (from p in ZNet.instance.GetPlayerList()
					orderby p.m_name
					select p).Reverse().ToList();
			}
			return players;
		}

		private void AddTitleHeaderToScrollList(int playersCount)
		{
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Expected O, but got Unknown
			//IL_0049: Unknown result type (might be due to invalid IL or missing references)
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0075: Unknown result type (might be due to invalid IL or missing references)
			//IL_008b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0097: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cd: Expected O, but got Unknown
			//IL_00e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_014b: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = new GameObject("Title_Row", new Type[1] { typeof(RectTransform) });
			val.transform.SetParent(content.transform, false);
			RectTransform component = val.GetComponent<RectTransform>();
			component.anchorMin = new Vector2(0.5f, 1f);
			component.anchorMax = new Vector2(0.5f, 1f);
			component.pivot = new Vector2(0.5f, 1f);
			component.anchoredPosition = new Vector2(0f, -10f);
			component.sizeDelta = ROW_SIZE_DELTA;
			GameObject val2 = new GameObject("Title_Name", new Type[2]
			{
				typeof(RectTransform),
				typeof(TextMeshProUGUI)
			});
			val2.transform.SetParent(val.transform, false);
			RectTransform component2 = val2.GetComponent<RectTransform>();
			component2.anchoredPosition = Vector2.zero;
			TextMeshProUGUI component3 = val2.GetComponent<TextMeshProUGUI>();
			((Object)component3).name = "name";
			((TMP_Text)component3).text = $"{ConfigurationFile.playersMapListTitle.Value}: <color=yellow>{playersCount}</color>";
			((TMP_Text)component3).font = GameManager.getFontAsset("Valheim-Norse");
			((TMP_Text)component3).fontSize = 22f;
			((Graphic)component3).color = Color.white;
			((TMP_Text)component3).fontStyle = (FontStyles)1;
			((TMP_Text)component3).alignment = (TextAlignmentOptions)514;
			playerEntriesObjects.Add(val);
		}

		private void AddRowToScrollList(PlayerInfo info, bool isInCurrentGroup, bool newCache)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: Expected O, but got Unknown
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			//IL_006c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0082: Unknown result type (might be due to invalid IL or missing references)
			//IL_0098: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00da: Expected O, but got Unknown
			//IL_0101: Unknown result type (might be due to invalid IL or missing references)
			//IL_0118: Unknown result type (might be due to invalid IL or missing references)
			//IL_015d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0164: Expected O, but got Unknown
			//IL_018d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0224: Unknown result type (might be due to invalid IL or missing references)
			//IL_022b: Expected O, but got Unknown
			//IL_0261: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b4: Expected O, but got Unknown
			//IL_02ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_031c: Unknown result type (might be due to invalid IL or missing references)
			//IL_034c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0351: Unknown result type (might be due to invalid IL or missing references)
			//IL_0391: Unknown result type (might be due to invalid IL or missing references)
			//IL_0398: Expected O, but got Unknown
			//IL_03e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0400: Unknown result type (might be due to invalid IL or missing references)
			//IL_043f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0446: Expected O, but got Unknown
			//IL_0491: Unknown result type (might be due to invalid IL or missing references)
			//IL_04ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_04de: Unknown result type (might be due to invalid IL or missing references)
			//IL_04e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0523: Unknown result type (might be due to invalid IL or missing references)
			//IL_052a: Expected O, but got Unknown
			//IL_0575: Unknown result type (might be due to invalid IL or missing references)
			//IL_0592: Unknown result type (might be due to invalid IL or missing references)
			//IL_063a: Unknown result type (might be due to invalid IL or missing references)
			//IL_078c: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = new GameObject("Player_Row", new Type[1] { typeof(RectTransform) });
			val.transform.SetParent(content.transform, false);
			RectTransform component = val.GetComponent<RectTransform>();
			component.anchorMin = new Vector2(0.5f, 1f);
			component.anchorMax = new Vector2(0.5f, 1f);
			component.pivot = new Vector2(0.5f, 1f);
			component.anchoredPosition = new Vector2(0f, -10f);
			component.sizeDelta = ROW_SIZE_DELTA;
			GameObject val2 = new GameObject("Player_Icon", new Type[2]
			{
				typeof(RectTransform),
				typeof(Image)
			});
			val2.transform.SetParent(val.transform, false);
			RectTransform component2 = val2.GetComponent<RectTransform>();
			component2.sizeDelta = new Vector2(32f, 32f);
			component2.anchoredPosition = new Vector2(-185f, 0f);
			Image component3 = val2.GetComponent<Image>();
			component3.sprite = ImageManager.getSpriteIconVanillaImage();
			GameObject val3 = new GameObject("Player_Name", new Type[2]
			{
				typeof(RectTransform),
				typeof(TextMeshProUGUI)
			});
			val3.transform.SetParent(val.transform, false);
			RectTransform component4 = val3.GetComponent<RectTransform>();
			component4.anchoredPosition = new Vector2(-65f, 0f);
			TextMeshProUGUI textEntryComponent = GetTextEntryComponent(val3, "Name");
			((TMP_Text)textEntryComponent).text = ((info.m_name.Length < ConfigurationFile.maxPlayerNamesCharactersInList.Value) ? info.m_name : (info.m_name.Substring(0, ConfigurationFile.maxPlayerNamesCharactersInList.Value - 3) + "..."));
			GameObject val4 = new GameObject("Player_Level", new Type[2]
			{
				typeof(RectTransform),
				typeof(TextMeshProUGUI)
			});
			val4.transform.SetParent(val.transform, false);
			val4.SetActive(EpicMMOSystem_API.IsLoaded());
			RectTransform component5 = val4.GetComponent<RectTransform>();
			component5.anchoredPosition = new Vector2(70f, 0f);
			TextMeshProUGUI textEntryComponent2 = GetTextEntryComponent(val4, "Level");
			((TMP_Text)textEntryComponent2).text = "LVL: ???";
			GameObject val5 = new GameObject("Player_KillsIcon", new Type[2]
			{
				typeof(RectTransform),
				typeof(Image)
			});
			val5.transform.SetParent(val.transform, false);
			val5.SetActive(info.m_name != Player.m_localPlayer.GetPlayerName());
			RectTransform component6 = val5.GetComponent<RectTransform>();
			component6.sizeDelta = new Vector2(32f, 32f);
			component6.anchoredPosition = new Vector2((float)(-15 + getLevelUIContentLength()), 0f);
			Image component7 = val5.GetComponent<Image>();
			component7.sprite = killsIconSprite;
			((Graphic)component7).color = Color32.op_Implicit(new Color32((byte)0, byte.MaxValue, (byte)0, byte.MaxValue));
			GameObject val6 = new GameObject("Player_Kills_" + info.m_name, new Type[2]
			{
				typeof(RectTransform),
				typeof(TextMeshProUGUI)
			});
			val6.transform.SetParent(val.transform, false);
			val6.SetActive(info.m_name != Player.m_localPlayer.GetPlayerName());
			RectTransform component8 = val6.GetComponent<RectTransform>();
			component8.sizeDelta = new Vector2(32f, 32f);
			component8.anchoredPosition = new Vector2((float)(25 + getLevelUIContentLength()), 0f);
			TextMeshProUGUI textEntryComponent3 = GetTextEntryComponent(val6, "Kills");
			GameObject val7 = new GameObject("Player_KilledByIcon", new Type[2]
			{
				typeof(RectTransform),
				typeof(Image)
			});
			val7.transform.SetParent(val.transform, false);
			val7.SetActive(info.m_name != Player.m_localPlayer.GetPlayerName());
			RectTransform component9 = val7.GetComponent<RectTransform>();
			component9.sizeDelta = new Vector2(32f, 32f);
			component9.anchoredPosition = new Vector2((float)(65 + getLevelUIContentLength()), 0f);
			Image component10 = val7.GetComponent<Image>();
			component10.sprite = killsIconSprite;
			((Graphic)component10).color = Color32.op_Implicit(new Color32(byte.MaxValue, (byte)0, (byte)0, byte.MaxValue));
			GameObject val8 = new GameObject("Player_KilledBy_" + info.m_name, new Type[2]
			{
				typeof(RectTransform),
				typeof(TextMeshProUGUI)
			});
			val8.transform.SetParent(val.transform, false);
			val8.SetActive(info.m_name != Player.m_localPlayer.GetPlayerName());
			RectTransform component11 = val8.GetComponent<RectTransform>();
			component11.sizeDelta = new Vector2(32f, 32f);
			component11.anchoredPosition = new Vector2((float)(105 + getLevelUIContentLength()), 0f);
			TextMeshProUGUI textEntryComponent4 = GetTextEntryComponent(val8, "KilledBy");
			playerEntriesObjects.Add(val);
			if (info.m_name == Player.m_localPlayer.GetPlayerName())
			{
				if (isInCurrentGroup)
				{
					component3.sprite = ImageManager.spriteGroupIconImage;
				}
				else
				{
					component3.sprite = (((Character)Player.m_localPlayer).IsPVPEnabled() ? ImageManager.getSpriteIconVanillaImage() : ImageManager.spriteBlueIconImage);
				}
				((TMP_Text)textEntryComponent2).text = $"LVL: {EpicMMOSystem_API.GetLevel()}";
				return;
			}
			if (newCache)
			{
				AddPlayerEntryToCachedPlayers(info, textEntryComponent2, textEntryComponent3, textEntryComponent4, component3);
				return;
			}
			Dictionary<string, string> dictionary = (Dictionary<string, string>)GameManager.GetPrivateValue(Player.m_localPlayer, "m_knownTexts");
			if (dictionary.ContainsKey(GameManager.PREFIX_KILLS + info.m_name))
			{
				((TMP_Text)textEntryComponent3).text = GeneralExtensions.GetValueSafe<string, string>(dictionary, GameManager.PREFIX_KILLS + info.m_name);
			}
			else
			{
				((TMP_Text)textEntryComponent3).text = "0";
			}
			if (dictionary.ContainsKey(GameManager.PREFIX_KILLEDBY + info.m_name))
			{
				((TMP_Text)textEntryComponent4).text = GeneralExtensions.GetValueSafe<string, string>(dictionary, GameManager.PREFIX_KILLEDBY + info.m_name);
			}
			else
			{
				((TMP_Text)textEntryComponent4).text = "0";
			}
			PlayerEntry playerEntry = cachedPlayerEntries.Find((PlayerEntry pe) => pe.name == info.m_name);
			if (playerEntry != null)
			{
				if (isInCurrentGroup)
				{
					component3.sprite = ImageManager.spriteGroupIconImage;
				}
				else
				{
					component3.sprite = (playerEntry.isPvP ? ImageManager.getSpriteIconVanillaImage() : ImageManager.spriteBlueIconImage);
				}
				((TMP_Text)textEntryComponent2).text = "LVL: " + playerEntry.GetLevelText();
			}
			else
			{
				AddPlayerEntryToCachedPlayers(info, textEntryComponent2, textEntryComponent3, textEntryComponent4, component3);
			}
		}

		private void AddPlayerEntryToCachedPlayers(PlayerInfo info, TextMeshProUGUI levelText, TextMeshProUGUI killsValue, TextMeshProUGUI killedByValue, Image playerIcon)
		{
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			Logger.Log("[AddPlayerEntryToCachedPlayers] Is killsValue object null? " + ((Object)(object)killsValue == (Object)null));
			cachedPlayerEntries.Add(new PlayerEntry
			{
				name = info.m_name,
				level = 0,
				levelUI = levelText,
				killsTimesUI = killsValue,
				killedByTimesUI = killedByValue,
				iconPlayer = playerIcon,
				isPvP = false
			});
			ZRoutedRpc.instance.InvokeRoutedRPC(((ZDOID)(ref info.m_characterID)).UserID, "RPC_RequestPlayerRelevantInfo", Array.Empty<object>());
		}

		private TextMeshProUGUI GetTextEntryComponent(GameObject parent, string name)
		{
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			TextMeshProUGUI component = parent.GetComponent<TextMeshProUGUI>();
			((Object)component).name = name;
			((TMP_Text)component).font = GameManager.getFontAsset("Valheim-Norse");
			((TMP_Text)component).fontSize = 22f;
			((Graphic)component).color = Color.white;
			((TMP_Text)component).fontStyle = (FontStyles)1;
			((TMP_Text)component).alignment = (TextAlignmentOptions)513;
			return component;
		}

		public void UpdatePlayerRelevantInfo(RPC_PlayerRelevantInfo playerRelevantInfo)
		{
			Logger.Log($"[UpdatePlayerRelevantInfo] playerEntry found: name {playerRelevantInfo.playerName}, level {playerRelevantInfo.level}, isPvP {playerRelevantInfo.isPvP}");
			PlayerEntry playerEntry = cachedPlayerEntries.Find((PlayerEntry p) => p.name.Equals(playerRelevantInfo.playerName));
			if ((Object)(object)playerEntry.iconPlayer != (Object)null && API.GroupPlayers().FindIndex((PlayerReference p) => p.name.Equals(playerRelevantInfo.playerName)) >= 0)
			{
				Logger.Log("[UpdatePlayerRelevantInfo] isInGroup");
				playerEntry.iconPlayer.sprite = ImageManager.spriteGroupIconImage;
			}
			else
			{
				playerEntry.iconPlayer.sprite = (playerRelevantInfo.isPvP ? ImageManager.getSpriteIconVanillaImage() : ImageManager.spriteBlueIconImage);
			}
			playerEntry.isPvP = playerRelevantIn