Decompiled source of KindredCommands v2.5.5

KindredCommands.dll

Decompiled 2 days ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using System.Text;
using System.Text.Json;
using System.Text.Json.Serialization;
using System.Text.RegularExpressions;
using System.Threading;
using System.Threading.Tasks;
using BepInEx;
using BepInEx.Core.Logging.Interpolation;
using BepInEx.Logging;
using BepInEx.Unity.IL2CPP;
using BepInEx.Unity.IL2CPP.Utils.Collections;
using HarmonyLib;
using Il2CppInterop.Runtime;
using Il2CppInterop.Runtime.InteropTypes.Arrays;
using Il2CppSystem;
using Il2CppSystem.Collections.Generic;
using KindredCommands;
using KindredCommands.Commands.Converters;
using KindredCommands.Data;
using KindredCommands.Models;
using KindredCommands.Services;
using Microsoft.CodeAnalysis;
using ProjectM;
using ProjectM.CastleBuilding;
using ProjectM.Gameplay.Clan;
using ProjectM.Gameplay.Scripting;
using ProjectM.Gameplay.Systems;
using ProjectM.Network;
using ProjectM.Physics;
using ProjectM.Scripting;
using ProjectM.Shared;
using ProjectM.Shared.Systems;
using ProjectM.Terrain;
using ProjectM.Tiles;
using Stunlock.Core;
using Stunlock.Localization;
using Stunlock.Network;
using Unity.Collections;
using Unity.Collections.LowLevel.Unsafe;
using Unity.Entities;
using Unity.Mathematics;
using Unity.Physics;
using Unity.Transforms;
using UnityEngine;
using VampireCommandFramework;
using VampireCommandFramework.Breadstone;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")]
[assembly: AssemblyCompany("odjit")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyDescription("Commands to expand Administration efforts and provide information")]
[assembly: AssemblyFileVersion("2.5.5.0")]
[assembly: AssemblyInformationalVersion("2.5.5+9cb808390a0e1f49e6eeeb6f27331d50932abe81")]
[assembly: AssemblyProduct("KindredCommands")]
[assembly: AssemblyTitle("KindredCommands")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("2.5.5.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableAttribute : Attribute
	{
		public readonly byte[] NullableFlags;

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

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

		public NullableContextAttribute(byte P_0)
		{
			Flag = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
[HarmonyBefore(new string[] { "gg.deca.VampireCommandFramework" })]
[HarmonyPatch(typeof(ChatMessageSystem), "OnUpdate")]
public static class StealthAdminChatPatch
{
	public static bool Prefix(ChatMessageSystem __instance)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		//IL_0006: Unknown result type (might be due to invalid IL or missing references)
		//IL_000a: Unknown result type (might be due to invalid IL or missing references)
		//IL_000f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0014: Unknown result type (might be due to invalid IL or missing references)
		//IL_0017: 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_017f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0186: Expected O, but got Unknown
		//IL_0024: Unknown result type (might be due to invalid IL or missing references)
		//IL_0029: Unknown result type (might be due to invalid IL or missing references)
		//IL_002a: Unknown result type (might be due to invalid IL or missing references)
		//IL_002b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0030: Unknown result type (might be due to invalid IL or missing references)
		//IL_0032: 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_0039: Unknown result type (might be due to invalid IL or missing references)
		//IL_003e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0040: Unknown result type (might be due to invalid IL or missing references)
		//IL_0041: Unknown result type (might be due to invalid IL or missing references)
		//IL_0046: Unknown result type (might be due to invalid IL or missing references)
		//IL_005c: Unknown result type (might be due to invalid IL or missing references)
		//IL_006a: 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_011b: Unknown result type (might be due to invalid IL or missing references)
		//IL_011d: Unknown result type (might be due to invalid IL or missing references)
		//IL_012a: Unknown result type (might be due to invalid IL or missing references)
		//IL_012c: Unknown result type (might be due to invalid IL or missing references)
		//IL_013e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0140: Unknown result type (might be due to invalid IL or missing references)
		//IL_014d: Unknown result type (might be due to invalid IL or missing references)
		//IL_015a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0164: Expected O, but got Unknown
		//IL_015f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0166: Expected O, but got Unknown
		//IL_016a: Unknown result type (might be due to invalid IL or missing references)
		//IL_016f: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
		//IL_0245: Unknown result type (might be due to invalid IL or missing references)
		//IL_0248: Invalid comparison between Unknown and I4
		//IL_028d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0294: Unknown result type (might be due to invalid IL or missing references)
		//IL_0297: Unknown result type (might be due to invalid IL or missing references)
		//IL_02b1: Expected I4, but got Unknown
		//IL_026c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0271: Unknown result type (might be due to invalid IL or missing references)
		//IL_0277: 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_0280: Unknown result type (might be due to invalid IL or missing references)
		//IL_0281: Unknown result type (might be due to invalid IL or missing references)
		//IL_03ff: Unknown result type (might be due to invalid IL or missing references)
		//IL_040a: Unknown result type (might be due to invalid IL or missing references)
		//IL_040c: Unknown result type (might be due to invalid IL or missing references)
		//IL_03d9: Unknown result type (might be due to invalid IL or missing references)
		//IL_03db: Unknown result type (might be due to invalid IL or missing references)
		//IL_03e0: Unknown result type (might be due to invalid IL or missing references)
		//IL_03e5: Unknown result type (might be due to invalid IL or missing references)
		//IL_03ef: Unknown result type (might be due to invalid IL or missing references)
		//IL_03f1: Unknown result type (might be due to invalid IL or missing references)
		//IL_03f6: Unknown result type (might be due to invalid IL or missing references)
		//IL_0389: Unknown result type (might be due to invalid IL or missing references)
		//IL_0390: Expected O, but got Unknown
		//IL_03c3: Unknown result type (might be due to invalid IL or missing references)
		//IL_03c8: Unknown result type (might be due to invalid IL or missing references)
		//IL_03cc: Unknown result type (might be due to invalid IL or missing references)
		//IL_0348: Unknown result type (might be due to invalid IL or missing references)
		//IL_034f: Expected O, but got Unknown
		//IL_02c0: Unknown result type (might be due to invalid IL or missing references)
		//IL_02c7: Expected O, but got Unknown
		//IL_0304: Unknown result type (might be due to invalid IL or missing references)
		//IL_030b: Expected O, but got Unknown
		//IL_0428: Unknown result type (might be due to invalid IL or missing references)
		//IL_042a: Unknown result type (might be due to invalid IL or missing references)
		//IL_042c: Unknown result type (might be due to invalid IL or missing references)
		//IL_042e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0433: Unknown result type (might be due to invalid IL or missing references)
		//IL_041a: Unknown result type (might be due to invalid IL or missing references)
		//IL_041c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0421: Unknown result type (might be due to invalid IL or missing references)
		EntityQuery _query_661171423_ = __instance.__query_661171423_0;
		NativeArray<Entity> val = ((EntityQuery)(ref _query_661171423_)).ToEntityArray(AllocatorHandle.op_Implicit((Allocator)2));
		Enumerator<Entity> enumerator = val.GetEnumerator();
		bool flag3 = default(bool);
		while (enumerator.MoveNext())
		{
			Entity current = enumerator.Current;
			FromCharacter val2 = current.Read<FromCharacter>();
			User val3 = val2.User.Read<User>();
			ChatMessageEvent val4 = current.Read<ChatMessageEvent>();
			string text = ((object)(FixedString512Bytes)(ref val4.MessageText)).ToString();
			bool flag = val3.IsAdmin;
			bool flag2 = Core.StealthAdminService.IsStealthAdmin(val2.User);
			if (!flag && flag2 && ((object)(FixedString512Bytes)(ref val4.MessageText)).ToString().StartsWith("."))
			{
				flag = true;
				val3.IsAdmin = true;
				val2.User.Write<User>(val3);
			}
			ChatCommandContext val5 = new ChatCommandContext((VChatEvent)typeof(VChatEvent).GetConstructor(BindingFlags.Instance | BindingFlags.NonPublic, null, new Type[5]
			{
				typeof(Entity),
				typeof(Entity),
				typeof(string),
				typeof(ChatMessageType),
				typeof(User)
			}, null).Invoke(new object[5] { val2.User, val2.Character, text, val4.MessageType, val3 }));
			CommandResult val6;
			try
			{
				val6 = CommandRegistry.Handle((ICommandContext)(object)val5, text);
			}
			catch (Exception ex)
			{
				ManualLogSource log = Core.Log;
				BepInExErrorLogInterpolatedStringHandler val7 = new BepInExErrorLogInterpolatedStringHandler(34, 1, ref flag3);
				if (flag3)
				{
					((BepInExLogInterpolatedStringHandler)val7).AppendLiteral("Error while handling chat message ");
					((BepInExLogInterpolatedStringHandler)val7).AppendFormatted<Exception>(ex);
				}
				log.LogError(val7);
				continue;
			}
			string[] array = text.Split(" ");
			string text2 = array[0];
			string text3 = ((array.Length > 1) ? array[1] : "");
			if (text2.ToLowerInvariant().Contains("nolog") || text2.ToLowerInvariant().Contains("password"))
			{
				text = text2 + " <Not Logging For Security>";
			}
			else if (text3.ToLowerInvariant().Contains("nolog") || text3.ToLowerInvariant().Contains("password"))
			{
				text = text2 + " " + text3 + " <Not Logging For Security>";
			}
			EntityManager entityManager;
			if ((int)val6 == 5 && text.StartsWith(".help-legacy", StringComparison.InvariantCulture))
			{
				val4.MessageText = FixedString512Bytes.op_Implicit(text.Replace("-legacy", string.Empty));
				entityManager = ((ComponentSystemBase)__instance).EntityManager;
				((EntityManager)(ref entityManager)).SetComponentData<ChatMessageEvent>(current, val4);
			}
			else if ((int)val6 != 0)
			{
				switch (val6 - 1)
				{
				case 3:
				{
					ManualLogSource log4 = Core.Log;
					BepInExInfoLogInterpolatedStringHandler val8 = new BepInExInfoLogInterpolatedStringHandler(35, 2, ref flag3);
					if (flag3)
					{
						((BepInExLogInterpolatedStringHandler)val8).AppendFormatted<string>(val5.Name);
						((BepInExLogInterpolatedStringHandler)val8).AppendLiteral(" was denied trying to use command: ");
						((BepInExLogInterpolatedStringHandler)val8).AppendFormatted<string>(text);
					}
					log4.LogInfo(val8);
					break;
				}
				case 4:
				{
					ManualLogSource log3 = Core.Log;
					BepInExInfoLogInterpolatedStringHandler val8 = new BepInExInfoLogInterpolatedStringHandler(15, 2, ref flag3);
					if (flag3)
					{
						((BepInExLogInterpolatedStringHandler)val8).AppendFormatted<string>(val5.Name);
						((BepInExLogInterpolatedStringHandler)val8).AppendLiteral(" used command: ");
						((BepInExLogInterpolatedStringHandler)val8).AppendFormatted<string>(text);
					}
					log3.LogInfo(val8);
					break;
				}
				case 2:
				{
					ManualLogSource log5 = Core.Log;
					BepInExInfoLogInterpolatedStringHandler val8 = new BepInExInfoLogInterpolatedStringHandler(46, 2, ref flag3);
					if (flag3)
					{
						((BepInExLogInterpolatedStringHandler)val8).AppendFormatted<string>(val5.Name);
						((BepInExLogInterpolatedStringHandler)val8).AppendLiteral(" had an internal error trying to use command: ");
						((BepInExLogInterpolatedStringHandler)val8).AppendFormatted<string>(text);
					}
					log5.LogInfo(val8);
					break;
				}
				case 0:
				{
					ManualLogSource log2 = Core.Log;
					BepInExInfoLogInterpolatedStringHandler val8 = new BepInExInfoLogInterpolatedStringHandler(42, 2, ref flag3);
					if (flag3)
					{
						((BepInExLogInterpolatedStringHandler)val8).AppendFormatted<string>(val5.Name);
						((BepInExLogInterpolatedStringHandler)val8).AppendLiteral(" had a usage error trying to use command: ");
						((BepInExLogInterpolatedStringHandler)val8).AppendFormatted<string>(text);
					}
					log2.LogInfo(val8);
					break;
				}
				}
				entityManager = Core.Server.EntityManager;
				((EntityManager)(ref entityManager)).DestroyEntity(current);
			}
			if (flag && flag2)
			{
				val3 = val2.User.Read<User>();
				val3.IsAdmin = false;
				val2.User.Write<User>(val3);
			}
			User toUser = default(User);
			if (Core.Players.TryFindUserFromNetworkId(val4.ReceiverEntity, out var userEntity))
			{
				toUser = userEntity.Read<User>();
			}
			Core.AuditService.LogChatMessage(val3, toUser, val4.MessageType, val6, text);
		}
		val.Dispose();
		return true;
	}
}
[HarmonyPatch(typeof(ServerBootstrapSystem), "OnUserConnected")]
public static class StealthAdminOnUserConnected_Patch
{
	public static void Postfix(ServerBootstrapSystem __instance, NetConnectionId netConnectionId)
	{
		//IL_0025: 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_0030: Unknown result type (might be due to invalid IL or missing references)
		if (Core.Players == null)
		{
			Core.InitializeAfterLoaded();
		}
		int num = __instance._NetEndPointToApprovedUserIndex[netConnectionId];
		Entity userEntity = ((Il2CppArrayBase<ServerClient>)(object)__instance._ApprovedUsersLookup)[num].UserEntity;
		Core.StealthAdminService.HandleUserConnecting(userEntity);
	}
}
[HarmonyPatch(typeof(ServerBootstrapSystem), "OnUserDisconnected")]
public static class StealthAdminOnUserDisconnected_Patch
{
	public static void Prefix(ServerBootstrapSystem __instance, NetConnectionId netConnectionId, ConnectionStatusChangeReason connectionStatusReason, string extraData)
	{
		//IL_0029: Unknown result type (might be due to invalid IL or missing references)
		//IL_002e: 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)
		if (Core.Players == null)
		{
			Core.InitializeAfterLoaded();
		}
		int num = default(int);
		if (__instance._NetEndPointToApprovedUserIndex.TryGetValue(netConnectionId, ref num))
		{
			Entity userEntity = ((Il2CppArrayBase<ServerClient>)(object)__instance._ApprovedUsersLookup)[num].UserEntity;
			Core.StealthAdminService.HandleUserDisconnecting(userEntity);
		}
	}
}
namespace KindredCommands
{
	internal class Buffs
	{
		public static bool AddBuff(Entity User, Entity Character, PrefabGUID buffPrefab, int duration = 0, bool immortal = true)
		{
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: 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_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: Unknown result type (might be due to invalid IL or missing references)
			//IL_0045: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_0058: Unknown result type (might be due to invalid IL or missing references)
			//IL_0063: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_0069: Unknown result type (might be due to invalid IL or missing references)
			//IL_006a: Unknown result type (might be due to invalid IL or missing references)
			//IL_007b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: Unknown result type (might be due to invalid IL or missing references)
			//IL_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_0091: Unknown result type (might be due to invalid IL or missing references)
			//IL_009b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00af: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0109: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0129: Unknown result type (might be due to invalid IL or missing references)
			//IL_0111: Unknown result type (might be due to invalid IL or missing references)
			//IL_0112: Unknown result type (might be due to invalid IL or missing references)
			//IL_0117: Unknown result type (might be due to invalid IL or missing references)
			//IL_011c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0121: 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_00ea: 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_00f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d2: 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_00de: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0137: Unknown result type (might be due to invalid IL or missing references)
			//IL_0131: Unknown result type (might be due to invalid IL or missing references)
			//IL_013f: Unknown result type (might be due to invalid IL or missing references)
			DebugEventsSystem existingSystemManaged = Core.Server.GetExistingSystemManaged<DebugEventsSystem>();
			ApplyBuffDebugEvent val = default(ApplyBuffDebugEvent);
			val.BuffPrefabGUID = buffPrefab;
			ApplyBuffDebugEvent val2 = val;
			FromCharacter val3 = default(FromCharacter);
			val3.User = User;
			val3.Character = Character;
			FromCharacter val4 = val3;
			Entity entity = default(Entity);
			if (!BuffUtility.TryGetBuff<EntityManager>(Core.Server.EntityManager, Character, PrefabIdentifier.op_Implicit(buffPrefab), ref entity))
			{
				existingSystemManaged.ApplyBuff(val4, val2);
				if (BuffUtility.TryGetBuff<EntityManager>(Core.Server.EntityManager, Character, PrefabIdentifier.op_Implicit(buffPrefab), ref entity))
				{
					if (entity.Has<CreateGameplayEventsOnSpawn>())
					{
						entity.Remove<CreateGameplayEventsOnSpawn>();
					}
					if (entity.Has<GameplayEventListeners>())
					{
						entity.Remove<GameplayEventListeners>();
					}
					if (immortal)
					{
						entity.Add<Buff_Persists_Through_Death>();
						if (entity.Has<RemoveBuffOnGameplayEvent>())
						{
							entity.Remove<RemoveBuffOnGameplayEvent>();
						}
						if (entity.Has<RemoveBuffOnGameplayEventEntry>())
						{
							entity.Remove<RemoveBuffOnGameplayEventEntry>();
						}
					}
					if (duration > -1 && duration != 0)
					{
						if (!entity.Has<LifeTime>())
						{
							entity.Add<LifeTime>();
							entity.Write<LifeTime>(new LifeTime
							{
								EndAction = (LifeTimeEndAction)2
							});
						}
						LifeTime componentData = entity.Read<LifeTime>();
						componentData.Duration = duration;
						entity.Write<LifeTime>(componentData);
					}
					else if (duration == -1)
					{
						if (entity.Has<LifeTime>())
						{
							LifeTime componentData2 = entity.Read<LifeTime>();
							componentData2.EndAction = (LifeTimeEndAction)0;
							entity.Write<LifeTime>(componentData2);
						}
						if (entity.Has<RemoveBuffOnGameplayEvent>())
						{
							entity.Remove<RemoveBuffOnGameplayEvent>();
						}
						if (entity.Has<RemoveBuffOnGameplayEventEntry>())
						{
							entity.Remove<RemoveBuffOnGameplayEventEntry>();
						}
					}
					return true;
				}
				return false;
			}
			return false;
		}

		public static void RemoveBuff(Entity Character, PrefabGUID buffPrefab)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: 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)
			Entity val = default(Entity);
			if (BuffUtility.TryGetBuff<EntityManager>(Core.EntityManager, Character, PrefabIdentifier.op_Implicit(buffPrefab), ref val))
			{
				DestroyUtility.Destroy(Core.EntityManager, val, (DestroyDebugReason)13, (string)null, 0);
			}
		}
	}
	internal static class Core
	{
		private static MonoBehaviour monoBehaviour;

		public const int MAX_REPLY_LENGTH = 509;

		private static bool _hasInitialized = false;

		public static World Server { get; } = GetWorld("Server") ?? throw new Exception("There is no Server world (yet). Did you install a server mod on the client?");


		public static EntityManager EntityManager { get; } = Server.EntityManager;


		public static GameDataSystem GameDataSystem { get; } = Server.GetExistingSystemManaged<GameDataSystem>();


		public static GenerateCastleSystem GenerateCastle { get; private set; }

		public static PrefabCollectionSystem PrefabCollectionSystem { get; internal set; }

		public static PrefabCollectionSystem PrefabCollection { get; } = Server.GetExistingSystemManaged<PrefabCollectionSystem>();


		public static RelicDestroySystem RelicDestroySystem { get; internal set; }

		public static ServerScriptMapper ServerScriptMapper { get; internal set; }

		public static double ServerTime => ServerGameManager.ServerTime;

		public static ServerGameManager ServerGameManager => ServerScriptMapper.GetServerGameManager();

		public static ServerGameSettingsSystem ServerGameSettingsSystem { get; internal set; }

		public static ManualLogSource Log { get; } = Plugin.PluginLog;


		public static AnnouncementsService AnnouncementsService { get; internal set; }

		public static AuditService AuditService { get; } = new AuditService();


		public static BloodBoundService BloodBoundService { get; private set; }

		public static BoostedPlayerService BoostedPlayerService { get; internal set; }

		public static BossService Boss { get; internal set; }

		public static CastleTerritoryService CastleTerritory { get; private set; }

		public static ConfigSettingsService ConfigSettings { get; internal set; }

		public static DropItemService DropItem { get; internal set; }

		public static GearService GearService { get; internal set; }

		public static GlobalMiscService GlobalMisc { get; internal set; }

		public static LocalizationService Localization { get; } = new LocalizationService();


		public static PlayerService Players { get; internal set; }

		public static PrefabService Prefabs { get; internal set; }

		public static PrisonerService Prisoners { get; internal set; }

		public static RegionService Regions { get; internal set; }

		public static SoulshardService SoulshardService { get; internal set; }

		public static StealthAdminService StealthAdminService { get; internal set; }

		public static TerritoryLocationService TerritoryLocation { get; internal set; }

		public static TrackPlayerEquipmentService TrackPlayerEquipment { get; internal set; }

		public static UnitSpawnerService UnitSpawner { get; internal set; }

		public static void LogException(Exception e, [CallerMemberName] string caller = null)
		{
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0010: Expected O, but got Unknown
			ManualLogSource log = Log;
			bool flag = default(bool);
			BepInExErrorLogInterpolatedStringHandler val = new BepInExErrorLogInterpolatedStringHandler(51, 5, ref flag);
			if (flag)
			{
				((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Failure in ");
				((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>(caller);
				((BepInExLogInterpolatedStringHandler)val).AppendLiteral("\nMessage: ");
				((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>(e.Message);
				((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" Inner:");
				((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>(e.InnerException?.Message);
				((BepInExLogInterpolatedStringHandler)val).AppendLiteral("\n\nStack: ");
				((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>(e.StackTrace);
				((BepInExLogInterpolatedStringHandler)val).AppendLiteral("\nInner Stack: ");
				((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>(e.InnerException?.StackTrace);
			}
			log.LogError(val);
		}

		internal static void InitializeAfterLoaded()
		{
			//IL_011c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0122: Expected O, but got Unknown
			if (!_hasInitialized)
			{
				GenerateCastle = Server.GetOrCreateSystemManaged<GenerateCastleSystem>();
				PrefabCollectionSystem = Server.GetExistingSystemManaged<PrefabCollectionSystem>();
				RelicDestroySystem = Server.GetExistingSystemManaged<RelicDestroySystem>();
				ServerGameSettingsSystem = Server.GetExistingSystemManaged<ServerGameSettingsSystem>();
				ServerScriptMapper = Server.GetExistingSystemManaged<ServerScriptMapper>();
				Prefabs = new PrefabService();
				ConfigSettings = new ConfigSettingsService();
				BoostedPlayerService = new BoostedPlayerService();
				Players = new PlayerService();
				AnnouncementsService = new AnnouncementsService();
				BloodBoundService = new BloodBoundService();
				Boss = new BossService();
				CastleTerritory = new CastleTerritoryService();
				DropItem = new DropItemService();
				GearService = new GearService();
				GlobalMisc = new GlobalMiscService();
				Prisoners = new PrisonerService();
				Regions = new RegionService();
				SoulshardService = new SoulshardService();
				StealthAdminService = new StealthAdminService();
				TerritoryLocation = new TerritoryLocationService();
				TrackPlayerEquipment = new TrackPlayerEquipmentService();
				UnitSpawner = new UnitSpawnerService();
				Character.Populate();
				_hasInitialized = true;
				ManualLogSource log = Log;
				bool flag = default(bool);
				BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(10, 1, ref flag);
				if (flag)
				{
					((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>("InitializeAfterLoaded");
					((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" completed");
				}
				log.LogInfo(val);
			}
		}

		private static World GetWorld(string name)
		{
			Enumerator<World> enumerator = World.s_AllWorlds.GetEnumerator();
			while (enumerator.MoveNext())
			{
				World current = enumerator.Current;
				if (current.Name == name)
				{
					return current;
				}
			}
			return null;
		}

		public static Coroutine StartCoroutine(IEnumerator routine)
		{
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Expected O, but got Unknown
			if ((Object)(object)monoBehaviour == (Object)null)
			{
				GameObject val = new GameObject("KindredCommands");
				monoBehaviour = (MonoBehaviour)(object)val.AddComponent<IgnorePhysicsDebugSystem>();
				Object.DontDestroyOnLoad((Object)val);
			}
			return monoBehaviour.StartCoroutine(CollectionExtensions.WrapToIl2Cpp(routine));
		}

		public static void StopCoroutine(Coroutine coroutine)
		{
			if (!((Object)(object)monoBehaviour == (Object)null))
			{
				monoBehaviour.StopCoroutine(coroutine);
			}
		}
	}
	public static class ECSExtensions
	{
		public delegate void ActionRef<T>(ref T item);

		public unsafe static void Write<T>(this Entity entity, T componentData) where T : struct
		{
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			ComponentType val = default(ComponentType);
			((ComponentType)(ref val))..ctor(Il2CppType.Of<T>(), (AccessMode)0);
			byte[] array = StructureToByteArray(componentData);
			int num = Marshal.SizeOf<T>();
			fixed (byte* ptr = array)
			{
				EntityManager entityManager = Core.EntityManager;
				((EntityManager)(ref entityManager)).SetComponentDataRaw(entity, val.TypeIndex, (void*)ptr, num);
			}
		}

		public static void With<T>(this Entity entity, ActionRef<T> action) where T : struct
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			T item = entity.ReadRW<T>();
			action(ref item);
			EntityManager entityManager = Core.EntityManager;
			((EntityManager)(ref entityManager)).SetComponentData<T>(entity, item);
		}

		public unsafe static T ReadRW<T>(this Entity entity) where T : struct
		{
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			ComponentType val = default(ComponentType);
			((ComponentType)(ref val))..ctor(Il2CppType.Of<T>(), (AccessMode)0);
			EntityManager entityManager = Core.EntityManager;
			return Marshal.PtrToStructure<T>(new IntPtr(((EntityManager)(ref entityManager)).GetComponentDataRawRW(entity, val.TypeIndex)));
		}

		public static byte[] StructureToByteArray<T>(T structure) where T : struct
		{
			int num = Marshal.SizeOf(structure);
			byte[] array = new byte[num];
			IntPtr intPtr = Marshal.AllocHGlobal(num);
			Marshal.StructureToPtr(structure, intPtr, fDeleteOld: true);
			Marshal.Copy(intPtr, array, 0, num);
			Marshal.FreeHGlobal(intPtr);
			return array;
		}

		public unsafe static T Read<T>(this Entity entity) where T : struct
		{
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			ComponentType val = default(ComponentType);
			((ComponentType)(ref val))..ctor(Il2CppType.Of<T>(), (AccessMode)0);
			EntityManager entityManager = Core.EntityManager;
			return Marshal.PtrToStructure<T>(new IntPtr(((EntityManager)(ref entityManager)).GetComponentDataRawRO(entity, val.TypeIndex)));
		}

		public static DynamicBuffer<T> ReadBuffer<T>(this Entity entity) where T : struct
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			EntityManager entityManager = Core.Server.EntityManager;
			return ((EntityManager)(ref entityManager)).GetBuffer<T>(entity, false);
		}

		public static bool Has<T>(this Entity entity)
		{
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			ComponentType val = default(ComponentType);
			((ComponentType)(ref val))..ctor(Il2CppType.Of<T>(), (AccessMode)0);
			EntityManager entityManager = Core.EntityManager;
			return ((EntityManager)(ref entityManager)).HasComponent(entity, val);
		}

		public static string LookupName(this PrefabGUID prefabGuid)
		{
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			PrefabCollectionSystem existingSystemManaged = Core.Server.GetExistingSystemManaged<PrefabCollectionSystem>();
			NativeParallelHashMap<PrefabGUID, Entity> guidToEntityMap = existingSystemManaged._PrefabLookupMap.GuidToEntityMap;
			if (!guidToEntityMap.ContainsKey(prefabGuid))
			{
				return "GUID Not Found";
			}
			PrefabLookupMap prefabLookupMap = existingSystemManaged._PrefabLookupMap;
			return ((PrefabLookupMap)(ref prefabLookupMap)).GetName(prefabGuid) + " PrefabGuid(" + ((PrefabGUID)(ref prefabGuid)).GuidHash + ")";
		}

		public static string PrefabName(this PrefabGUID prefabGuid)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			string prefabName = Core.Localization.GetPrefabName(prefabGuid);
			if (!string.IsNullOrEmpty(prefabName))
			{
				return prefabName;
			}
			return prefabGuid.LookupName();
		}

		public static string EntityName(this Entity entity)
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			string text = string.Empty;
			if (entity.Has<NameableInteractable>())
			{
				NameableInteractable val = entity.Read<NameableInteractable>();
				text = ((object)(FixedString64Bytes)(ref val.Name)).ToString();
			}
			if (string.IsNullOrEmpty(text) && entity.Has<PrefabGUID>())
			{
				text = entity.Read<PrefabGUID>().PrefabName();
			}
			if (string.IsNullOrEmpty(text))
			{
				text = ((object)(Entity)(ref entity)).ToString();
			}
			return text;
		}

		public static void Add<T>(this Entity entity)
		{
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			ComponentType val = default(ComponentType);
			((ComponentType)(ref val))..ctor(Il2CppType.Of<T>(), (AccessMode)0);
			EntityManager entityManager = Core.EntityManager;
			((EntityManager)(ref entityManager)).AddComponent(entity, val);
		}

		public static void Remove<T>(this Entity entity)
		{
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			ComponentType val = default(ComponentType);
			((ComponentType)(ref val))..ctor(Il2CppType.Of<T>(), (AccessMode)0);
			EntityManager entityManager = Core.EntityManager;
			((EntityManager)(ref entityManager)).RemoveComponent(entity, val);
		}
	}
	internal static class Helper
	{
		[CompilerGenerated]
		private sealed class <GetAllEntitiesInRadius>d__8<T> : IEnumerable<Entity>, IEnumerable, IEnumerator<Entity>, IEnumerator, IDisposable
		{
			private int <>1__state;

			private Entity <>2__current;

			private int <>l__initialThreadId;

			private float2 center;

			public float2 <>3__center;

			private float radius;

			public float <>3__radius;

			private NativeList<Entity> <entities>5__2;

			private Enumerator<Entity> <>7__wrap2;

			Entity IEnumerator<Entity>.Current
			{
				[DebuggerHidden]
				get
				{
					//IL_0001: Unknown result type (might be due to invalid IL or missing references)
					return <>2__current;
				}
			}

			object IEnumerator.Current
			{
				[DebuggerHidden]
				get
				{
					//IL_0001: Unknown result type (might be due to invalid IL or missing references)
					return <>2__current;
				}
			}

			[DebuggerHidden]
			public <GetAllEntitiesInRadius>d__8(int <>1__state)
			{
				this.<>1__state = <>1__state;
				<>l__initialThreadId = Environment.CurrentManagedThreadId;
			}

			[DebuggerHidden]
			void IDisposable.Dispose()
			{
				<>1__state = -2;
			}

			private bool MoveNext()
			{
				//IL_001f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0024: Unknown result type (might be due to invalid IL or missing references)
				//IL_002c: 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_0033: Unknown result type (might be due to invalid IL or missing references)
				//IL_0038: Unknown result type (might be due to invalid IL or missing references)
				//IL_003f: Unknown result type (might be due to invalid IL or missing references)
				//IL_004a: 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_0054: Unknown result type (might be due to invalid IL or missing references)
				//IL_0056: Unknown result type (might be due to invalid IL or missing references)
				//IL_0061: Unknown result type (might be due to invalid IL or missing references)
				//IL_0066: Unknown result type (might be due to invalid IL or missing references)
				//IL_006b: Unknown result type (might be due to invalid IL or missing references)
				//IL_006f: Unknown result type (might be due to invalid IL or missing references)
				//IL_007a: Unknown result type (might be due to invalid IL or missing references)
				//IL_0085: Unknown result type (might be due to invalid IL or missing references)
				//IL_0091: Unknown result type (might be due to invalid IL or missing references)
				//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
				//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
				//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
				//IL_00c6: Unknown result type (might be due to invalid IL or missing references)
				//IL_00d3: Unknown result type (might be due to invalid IL or missing references)
				//IL_00d8: Unknown result type (might be due to invalid IL or missing references)
				//IL_00da: Unknown result type (might be due to invalid IL or missing references)
				//IL_00e3: Unknown result type (might be due to invalid IL or missing references)
				//IL_00ec: Unknown result type (might be due to invalid IL or missing references)
				//IL_00ee: Unknown result type (might be due to invalid IL or missing references)
				//IL_00f3: Unknown result type (might be due to invalid IL or missing references)
				//IL_00f8: Unknown result type (might be due to invalid IL or missing references)
				//IL_00fb: Unknown result type (might be due to invalid IL or missing references)
				//IL_0102: Unknown result type (might be due to invalid IL or missing references)
				//IL_0115: Unknown result type (might be due to invalid IL or missing references)
				//IL_0117: Unknown result type (might be due to invalid IL or missing references)
				switch (<>1__state)
				{
				default:
					return false;
				case 0:
				{
					<>1__state = -1;
					TileModelSpatialLookupSystemData tileModelLookupSystemData = Core.GenerateCastle._TileModelLookupSystemData;
					TileModelSpatialLookupRO spatialLookupReadOnlyAndComplete = ((TileModelSpatialLookupSystemData)(ref tileModelLookupSystemData)).GetSpatialLookupReadOnlyAndComplete((SystemBase)(object)Core.GenerateCastle);
					ConvertPosToTileGrid(center);
					float2 val = ConvertPosToTileGrid(center - radius);
					float2 val2 = ConvertPosToTileGrid(center + radius);
					BoundsMinMax val3 = default(BoundsMinMax);
					((BoundsMinMax)(ref val3))..ctor(Mathf.FloorToInt(val.x), Mathf.FloorToInt(val.y), Mathf.CeilToInt(val2.x), Mathf.CeilToInt(val2.y));
					<entities>5__2 = ((TileModelSpatialLookupRO)(ref spatialLookupReadOnlyAndComplete)).GetEntities(ref val3, (TileType)255, 16, 16);
					<>7__wrap2 = <entities>5__2.GetEnumerator();
					break;
				}
				case 1:
					<>1__state = -1;
					break;
				}
				while (<>7__wrap2.MoveNext())
				{
					Entity current = <>7__wrap2.Current;
					if (current.Has<T>() && current.Has<Translation>())
					{
						float3 value = current.Read<Translation>().Value;
						if (math.distance(center, ((float3)(ref value)).xz) <= radius)
						{
							<>2__current = current;
							<>1__state = 1;
							return true;
						}
					}
				}
				<entities>5__2.Dispose();
				return false;
			}

			bool IEnumerator.MoveNext()
			{
				//ILSpy generated this explicit interface implementation from .override directive in MoveNext
				return this.MoveNext();
			}

			[DebuggerHidden]
			void IEnumerator.Reset()
			{
				throw new NotSupportedException();
			}

			[DebuggerHidden]
			IEnumerator<Entity> IEnumerable<Entity>.GetEnumerator()
			{
				//IL_002b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0030: Unknown result type (might be due to invalid IL or missing references)
				<GetAllEntitiesInRadius>d__8<T> <GetAllEntitiesInRadius>d__;
				if (<>1__state == -2 && <>l__initialThreadId == Environment.CurrentManagedThreadId)
				{
					<>1__state = 0;
					<GetAllEntitiesInRadius>d__ = this;
				}
				else
				{
					<GetAllEntitiesInRadius>d__ = new <GetAllEntitiesInRadius>d__8<T>(0);
				}
				<GetAllEntitiesInRadius>d__.center = <>3__center;
				<GetAllEntitiesInRadius>d__.radius = <>3__radius;
				return <GetAllEntitiesInRadius>d__;
			}

			[DebuggerHidden]
			IEnumerator IEnumerable.GetEnumerator()
			{
				return ((IEnumerable<Entity>)this).GetEnumerator();
			}
		}

		public static AdminAuthSystem adminAuthSystem = Core.Server.GetExistingSystemManaged<AdminAuthSystem>();

		public static ClanSystem_Server clanSystem = Core.Server.GetExistingSystemManaged<ClanSystem_Server>();

		public static EntityCommandBufferSystem entityCommandBufferSystem = Core.Server.GetExistingSystemManaged<EntityCommandBufferSystem>();

		public static PrefabGUID GetPrefabGUID(Entity entity)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: 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_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			EntityManager entityManager = Core.EntityManager;
			PrefabGUID componentData = default(PrefabGUID);
			try
			{
				componentData = ((EntityManager)(ref entityManager)).GetComponentData<PrefabGUID>(entity);
				return componentData;
			}
			catch
			{
				((PrefabGUID)(ref componentData))..ctor(0);
			}
			return componentData;
		}

		public static bool TryGetClanEntityFromPlayer(Entity User, out Entity ClanEntity)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: 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_002c: 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_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: Unknown result type (might be due to invalid IL or missing references)
			if (User.Read<TeamReference>().Value._Value.ReadBuffer<TeamAllies>().Length > 0)
			{
				ClanEntity = User.Read<TeamReference>().Value._Value.ReadBuffer<TeamAllies>()[0].Value;
				return true;
			}
			ClanEntity = default(Entity);
			return false;
		}

		public static Entity AddItemToInventory(Entity recipient, PrefabGUID guid, int amount)
		{
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: 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_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			try
			{
				ServerGameManager serverGameManager = Core.Server.GetExistingSystemManaged<ServerScriptMapper>()._ServerGameManager;
				return ((ServerGameManager)(ref serverGameManager)).TryAddInventoryItem(recipient, guid, amount).NewEntity;
			}
			catch (Exception e)
			{
				Core.LogException(e, "AddItemToInventory");
			}
			return default(Entity);
		}

		public static NativeArray<Entity> GetEntitiesByComponentType<T1>(bool includeAll = false, bool includeDisabled = false, bool includeSpawn = false, bool includePrefab = false, bool includeDestroyed = false)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: 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_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			//IL_004d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Unknown result type (might be due to invalid IL or missing references)
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_005c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			//IL_0067: Unknown result type (might be due to invalid IL or missing references)
			//IL_006b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0070: 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_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			EntityQueryOptions val = (EntityQueryOptions)0;
			if (includeAll)
			{
				val = (EntityQueryOptions)(val | 0xC3);
			}
			if (includeDisabled)
			{
				val = (EntityQueryOptions)(val | 2);
			}
			if (includeSpawn)
			{
				val = (EntityQueryOptions)(val | 0x40);
			}
			if (includePrefab)
			{
				val = (EntityQueryOptions)(val | 1);
			}
			if (includeDestroyed)
			{
				val = (EntityQueryOptions)(val | 0x80);
			}
			EntityQueryBuilder val2 = new EntityQueryBuilder(AllocatorHandle.op_Implicit((Allocator)2));
			val2 = ((EntityQueryBuilder)(ref val2)).AddAll(new ComponentType(Il2CppType.Of<T1>(), (AccessMode)0));
			EntityQueryBuilder val3 = ((EntityQueryBuilder)(ref val2)).WithOptions(val);
			EntityManager entityManager = Core.EntityManager;
			EntityQuery val4 = ((EntityManager)(ref entityManager)).CreateEntityQuery(ref val3);
			return ((EntityQuery)(ref val4)).ToEntityArray(AllocatorHandle.op_Implicit((Allocator)2));
		}

		public static NativeArray<Entity> GetEntitiesByComponentTypes<T1, T2>(bool includeAll = false, bool includeDisabled = false, bool includeSpawn = false, bool includePrefab = false, bool includeDestroyed = false)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: 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_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			//IL_004d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			//IL_005b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0060: Unknown result type (might be due to invalid IL or missing references)
			//IL_0063: Unknown result type (might be due to invalid IL or missing references)
			//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)
			//IL_006a: Unknown result type (might be due to invalid IL or missing references)
			//IL_006f: 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_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_007e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			EntityQueryOptions val = (EntityQueryOptions)0;
			if (includeAll)
			{
				val = (EntityQueryOptions)(val | 0xC3);
			}
			if (includeDisabled)
			{
				val = (EntityQueryOptions)(val | 2);
			}
			if (includeSpawn)
			{
				val = (EntityQueryOptions)(val | 0x40);
			}
			if (includePrefab)
			{
				val = (EntityQueryOptions)(val | 1);
			}
			if (includeDestroyed)
			{
				val = (EntityQueryOptions)(val | 0x80);
			}
			EntityQueryBuilder val2 = new EntityQueryBuilder(AllocatorHandle.op_Implicit((Allocator)2));
			val2 = ((EntityQueryBuilder)(ref val2)).AddAll(new ComponentType(Il2CppType.Of<T1>(), (AccessMode)0));
			val2 = ((EntityQueryBuilder)(ref val2)).AddAll(new ComponentType(Il2CppType.Of<T2>(), (AccessMode)0));
			EntityQueryBuilder val3 = ((EntityQueryBuilder)(ref val2)).WithOptions(val);
			EntityManager entityManager = Core.EntityManager;
			EntityQuery val4 = ((EntityManager)(ref entityManager)).CreateEntityQuery(ref val3);
			return ((EntityQuery)(ref val4)).ToEntityArray(AllocatorHandle.op_Implicit((Allocator)2));
		}

		[IteratorStateMachine(typeof(<GetAllEntitiesInRadius>d__8<>))]
		public static IEnumerable<Entity> GetAllEntitiesInRadius<T>(float2 center, float radius)
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
			return new <GetAllEntitiesInRadius>d__8<T>(-2)
			{
				<>3__center = center,
				<>3__radius = radius
			};
		}

		public static Entity FindClosestTilePosition(Vector3 pos, bool ignoreFloors = false)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0023: 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_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_004a: Unknown result type (might be due to invalid IL or missing references)
			//IL_005c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0073: Unknown result type (might be due to invalid IL or missing references)
			//IL_0078: Unknown result type (might be due to invalid IL or missing references)
			//IL_008e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0093: Unknown result type (might be due to invalid IL or missing references)
			//IL_009e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_011e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d7: 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_00e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0102: Unknown result type (might be due to invalid IL or missing references)
			//IL_0104: Unknown result type (might be due to invalid IL or missing references)
			TileModelSpatialLookupSystemData tileModelLookupSystemData = Core.GenerateCastle._TileModelLookupSystemData;
			TileModelSpatialLookupRO spatialLookupReadOnlyAndComplete = ((TileModelSpatialLookupSystemData)(ref tileModelLookupSystemData)).GetSpatialLookupReadOnlyAndComplete((SystemBase)(object)Core.GenerateCastle);
			float3 val = ConvertPosToTileGrid(float3.op_Implicit(pos));
			BoundsMinMax val2 = default(BoundsMinMax);
			((BoundsMinMax)(ref val2))..ctor((int)((double)val.x - 2.5), (int)((double)val.z - 2.5), (int)((double)val.x + 2.5), (int)((double)val.z + 2.5));
			Entity result = Entity.Null;
			float num = float.MaxValue;
			NativeList<Entity> entities = ((TileModelSpatialLookupRO)(ref spatialLookupReadOnlyAndComplete)).GetEntities(ref val2, (TileType)255, 16, 16);
			for (int i = 0; i < entities.Length; i++)
			{
				Entity val3 = entities[i];
				if (val3.Has<TilePosition>() && val3.Has<Translation>() && (!ignoreFloors || !val3.Has<CastleFloor>()))
				{
					float3 value = val3.Read<Translation>().Value;
					float num2 = math.distancesq(float3.op_Implicit(pos), value);
					if (num2 < num && GetPrefabGUID(val3).LookupName().StartsWith("TM_"))
					{
						num = num2;
						result = val3;
					}
				}
			}
			entities.Dispose();
			return result;
		}

		public static float2 ConvertPosToTileGrid(float2 pos)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			return new float2((float)(Mathf.FloorToInt(pos.x * 2f) + 6400), (float)(Mathf.FloorToInt(pos.y * 2f) + 6400));
		}

		public static float3 ConvertPosToTileGrid(float3 pos)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			return new float3((float)(Mathf.FloorToInt(pos.x * 2f) + 6400), pos.y, (float)(Mathf.FloorToInt(pos.z * 2f) + 6400));
		}

		public static void RepairGear(Entity Character, bool repair = true)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: Unknown result type (might be due to invalid IL or missing references)
			//IL_007b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0080: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_008e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0093: Unknown result type (might be due to invalid IL or missing references)
			//IL_0098: Unknown result type (might be due to invalid IL or missing references)
			//IL_009a: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cd: Unknown result type (might be due to invalid IL or missing references)
			Equipment val = Character.Read<Equipment>();
			NativeList<Entity> val2 = default(NativeList<Entity>);
			val2..ctor(AllocatorHandle.op_Implicit((Allocator)2));
			((Equipment)(ref val)).GetAllEquipmentEntities(val2, false);
			Enumerator<Entity> enumerator = val2.GetEnumerator();
			while (enumerator.MoveNext())
			{
				Entity current = enumerator.Current;
				if (current.Has<Durability>())
				{
					Durability val3 = current.Read<Durability>();
					if (repair)
					{
						val3.Value = val3.MaxDurability;
					}
					else
					{
						val3.Value = 0f;
					}
					current.Write<Durability>(val3);
				}
			}
			val2.Dispose();
			InventoryBuffer val4 = default(InventoryBuffer);
			for (int i = 0; i < 36; i++)
			{
				if (!InventoryUtilities.TryGetItemAtSlot<EntityManager>(Core.EntityManager, Character, i, ref val4))
				{
					continue;
				}
				Entity entity = val4.ItemEntity._Entity;
				if (entity.Has<Durability>())
				{
					Durability val5 = entity.Read<Durability>();
					if (repair)
					{
						val5.Value = val5.MaxDurability;
					}
					else
					{
						val5.Value = 0f;
					}
					entity.Write<Durability>(val5);
				}
			}
		}

		public static void ReviveCharacter(Entity Character, Entity User, ChatCommandContext ctx = null)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: 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_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_0084: Unknown result type (might be due to invalid IL or missing references)
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			//IL_009a: Unknown result type (might be due to invalid IL or missing references)
			//IL_009b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a0: 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_00a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b5: 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_00bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_005b: Unknown result type (might be due to invalid IL or missing references)
			//IL_005c: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_006e: 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_007e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00df: 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_00f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0101: Unknown result type (might be due to invalid IL or missing references)
			//IL_0104: Unknown result type (might be due to invalid IL or missing references)
			Health val = Character.Read<Health>();
			if (ctx != null)
			{
				ctx.Reply("TryGetbuff");
			}
			Entity val2 = default(Entity);
			if (BuffUtility.TryGetBuff<EntityManager>(Core.EntityManager, Character, PrefabIdentifier.op_Implicit(Prefabs.Buff_General_Vampire_Wounded_Buff), ref val2))
			{
				if (ctx != null)
				{
					ctx.Reply("Destroy");
				}
				DestroyUtility.Destroy(Core.EntityManager, val2, (DestroyDebugReason)13, (string)null, 0);
				if (ctx != null)
				{
					ctx.Reply("Health");
				}
				val.Value = ModifiableFloat.op_Implicit(val.MaxHealth);
				val.MaxRecoveryHealth = ModifiableFloat.op_Implicit(val.MaxHealth);
				Character.Write<Health>(val);
			}
			if (val.IsDead)
			{
				if (ctx != null)
				{
					ctx.Reply("Respawn");
				}
				LocalToWorld val3 = Character.Read<LocalToWorld>();
				float3 position = ((LocalToWorld)(ref val3)).Position;
				Nullable_Unboxed<float3> val4 = default(Nullable_Unboxed<float3>);
				val4.value = position;
				Nullable_Unboxed<float3> val5 = val4;
				if (ctx != null)
				{
					ctx.Reply("Respawn2");
				}
				ServerBootstrapSystem existingSystemManaged = Core.Server.GetExistingSystemManaged<ServerBootstrapSystem>();
				EntityCommandBuffer val6 = Core.Server.GetExistingSystemManaged<EntityCommandBufferSystem>().CreateCommandBuffer();
				if (ctx != null)
				{
					ctx.Reply("Respawn3");
				}
				existingSystemManaged.RespawnCharacter(val6, User, val5, Character, default(Entity), -1);
			}
		}

		public static void KickPlayer(Entity userEntity)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: 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_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0045: Unknown result type (might be due to invalid IL or missing references)
			//IL_004a: Unknown result type (might be due to invalid IL or missing references)
			//IL_004f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: 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_006a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0070: Unknown result type (might be due to invalid IL or missing references)
			//IL_0073: Unknown result type (might be due to invalid IL or missing references)
			//IL_007b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0086: Unknown result type (might be due to invalid IL or missing references)
			//IL_008e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
			EntityManager entityManager = Core.Server.EntityManager;
			User val = userEntity.Read<User>();
			if (val.IsConnected && val.PlatformId != 0L)
			{
				Entity entity = ((EntityManager)(ref entityManager)).CreateEntity((ComponentType[])(object)new ComponentType[3]
				{
					ComponentType.ReadOnly<NetworkEventType>(),
					ComponentType.ReadOnly<SendEventToUser>(),
					ComponentType.ReadOnly<KickEvent>()
				});
				entity.Write<KickEvent>(new KickEvent
				{
					PlatformId = val.PlatformId
				});
				entity.Write<SendEventToUser>(new SendEventToUser
				{
					UserIndex = val.Index
				});
				entity.Write<NetworkEventType>(new NetworkEventType
				{
					EventId = NetworkEvents.EventId_KickEvent,
					IsAdminEvent = false,
					IsDebugEvent = false
				});
			}
		}

		public static void UnlockWaypoints(Entity userEntity)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: 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_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: 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_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			//IL_0042: Unknown result type (might be due to invalid IL or missing references)
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			EntityManager entityManager = Core.EntityManager;
			DynamicBuffer<UnlockedWaypointElement> val = ((EntityManager)(ref entityManager)).AddBuffer<UnlockedWaypointElement>(userEntity);
			val.Clear();
			Enumerator<Entity> enumerator = GetEntitiesByComponentType<ChunkWaypoint>().GetEnumerator();
			while (enumerator.MoveNext())
			{
				Entity current = enumerator.Current;
				val.Add(new UnlockedWaypointElement
				{
					Waypoint = current.Read<NetworkId>()
				});
			}
		}

		public static void RevealMapForPlayer(Entity userEntity)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: 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_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: 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_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: 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_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: 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_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_004e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0060: Unknown result type (might be due to invalid IL or missing references)
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			//IL_006b: Unknown result type (might be due to invalid IL or missing references)
			EntityManager entityManager = Core.EntityManager;
			Enumerator<UserMapZoneElement> enumerator = ((EntityManager)(ref entityManager)).GetBuffer<UserMapZoneElement>(userEntity, false).GetEnumerator();
			while (enumerator.MoveNext())
			{
				UserMapZoneElement current = enumerator.Current;
				NetworkedEntity userZoneEntity = current.UserZoneEntity;
				Entity entityOnServer = ((NetworkedEntity)(ref userZoneEntity)).GetEntityOnServer();
				entityManager = Core.EntityManager;
				DynamicBuffer<UserMapZonePackedRevealElement> buffer = ((EntityManager)(ref entityManager)).GetBuffer<UserMapZonePackedRevealElement>(entityOnServer, false);
				buffer.Clear();
				UserMapZonePackedRevealElement val = default(UserMapZonePackedRevealElement);
				val.PackedPixel = byte.MaxValue;
				UserMapZonePackedRevealElement val2 = val;
				for (int i = 0; i < 8192; i++)
				{
					buffer.Add(val2);
				}
			}
		}
	}
	[BepInPlugin("aa.odjit.KindredCommands", "KindredCommands", "2.5.5")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	public class Plugin : BasePlugin
	{
		internal static Harmony Harmony;

		internal static ManualLogSource PluginLog;

		public static ManualLogSource LogInstance { get; private set; }

		public override void Load()
		{
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Expected O, but got Unknown
			//IL_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_008d: Expected O, but got Unknown
			if (!(Application.productName != "VRisingServer"))
			{
				PluginLog = ((BasePlugin)this).Log;
				ManualLogSource log = ((BasePlugin)this).Log;
				bool flag = default(bool);
				BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(27, 2, ref flag);
				if (flag)
				{
					((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Plugin ");
					((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>("aa.odjit.KindredCommands");
					((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" version ");
					((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>("2.5.5");
					((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" is loaded!");
				}
				log.LogInfo(val);
				LogInstance = ((BasePlugin)this).Log;
				Database.InitConfig();
				Harmony = new Harmony("aa.odjit.KindredCommands");
				Harmony.PatchAll(Assembly.GetExecutingAssembly());
				CommandRegistry.RegisterAll();
			}
		}

		public override bool Unload()
		{
			CommandRegistry.UnregisterAssembly();
			Harmony harmony = Harmony;
			if (harmony != null)
			{
				harmony.UnpatchSelf();
			}
			return true;
		}

		public void OnGameInitialized()
		{
			if (!HasLoaded())
			{
				((BasePlugin)this).Log.LogDebug((object)"Attempt to initialize before everything has loaded.");
			}
			else
			{
				Core.InitializeAfterLoaded();
			}
		}

		private static bool HasLoaded()
		{
			PrefabCollectionSystem existingSystemManaged = Core.Server.GetExistingSystemManaged<PrefabCollectionSystem>();
			if (existingSystemManaged == null)
			{
				return false;
			}
			return existingSystemManaged.SpawnableNameToPrefabGuidDictionary.Count > 0;
		}
	}
	public static class MyPluginInfo
	{
		public const string PLUGIN_GUID = "aa.odjit.KindredCommands";

		public const string PLUGIN_NAME = "KindredCommands";

		public const string PLUGIN_VERSION = "2.5.5";
	}
}
namespace KindredCommands.Services
{
	[HarmonyBefore(new string[] { "gg.deca.VampireCommandFramework" })]
	[HarmonyPatch(typeof(ServerBootstrapSystem), "SendRevealedMapData")]
	public static class RevealedMapDataPatch
	{
		public static void Prefix(ServerBootstrapSystem __instance, Entity userEntity, User user)
		{
			//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_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			if (Core.ConfigSettings == null)
			{
				Core.InitializeAfterLoaded();
			}
			if (Core.ConfigSettings.RevealMapToAll)
			{
				User val = userEntity.Read<User>();
				if (((FixedString64Bytes)(ref val.CharacterName)).IsEmpty)
				{
					Helper.RevealMapForPlayer(userEntity);
				}
			}
		}
	}
	internal class AdminService
	{
		public static void AdminUser(Entity userEntity)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: 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_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_0052: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0064: Unknown result type (might be due to invalid IL or missing references)
			User val = userEntity.Read<User>();
			EntityManager entityManager = Core.EntityManager;
			EntityArchetype val2 = ((EntityManager)(ref entityManager)).CreateArchetype((ComponentType[])(object)new ComponentType[2]
			{
				ComponentType.ReadWrite<FromCharacter>(),
				ComponentType.ReadWrite<AdminAuthEvent>()
			});
			entityManager = Core.EntityManager;
			((EntityManager)(ref entityManager)).CreateEntity(val2).Write<FromCharacter>(new FromCharacter
			{
				Character = ((NetworkedEntity)(ref val.LocalCharacter)).GetEntityOnServer(),
				User = userEntity
			});
		}
	}
	internal class AnnouncementsService
	{
		public struct Announcement
		{
			public string Name { get; set; }

			public string Time { get; set; }

			public string Message { get; set; }

			public bool OneTime { get; set; }
		}

		[CompilerGenerated]
		private sealed class <MessageCoroutine>d__7 : IEnumerator<object>, IEnumerator, IDisposable
		{
			private int <>1__state;

			private object <>2__current;

			public Announcement announcement;

			public AnnouncementsService <>4__this;

			private DateTime <announcementTime>5__2;

			object IEnumerator<object>.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			object IEnumerator.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			[DebuggerHidden]
			public <MessageCoroutine>d__7(int <>1__state)
			{
				this.<>1__state = <>1__state;
			}

			[DebuggerHidden]
			void IDisposable.Dispose()
			{
				<>1__state = -2;
			}

			private bool MoveNext()
			{
				//IL_0043: Unknown result type (might be due to invalid IL or missing references)
				//IL_0049: Expected O, but got Unknown
				//IL_012c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0131: Unknown result type (might be due to invalid IL or missing references)
				//IL_0133: Unknown result type (might be due to invalid IL or missing references)
				//IL_0107: Unknown result type (might be due to invalid IL or missing references)
				//IL_0111: Expected O, but got Unknown
				int num = <>1__state;
				AnnouncementsService announcementsService = <>4__this;
				if (num != 0)
				{
					if (num != 1)
					{
						return false;
					}
					<>1__state = -1;
					FixedString512Bytes val = FixedString512Bytes.op_Implicit(announcement.Message);
					ServerChatUtils.SendSystemMessageToAllClients(Core.EntityManager, ref val);
					<announcementTime>5__2 = <announcementTime>5__2.AddDays(1.0);
					announcementsService.SortAnnouncements();
					if (announcement.OneTime)
					{
						announcementsService.announcements.Remove(announcement);
						announcementsService.announcementCoroutines.Remove(announcement.Name);
						announcementsService.SaveAnnoucements();
						return false;
					}
				}
				else
				{
					<>1__state = -1;
					if (!DateTime.TryParse(announcement.Time, out <announcementTime>5__2))
					{
						ManualLogSource log = Core.Log;
						bool flag = default(bool);
						BepInExErrorLogInterpolatedStringHandler val2 = new BepInExErrorLogInterpolatedStringHandler(64, 3, ref flag);
						if (flag)
						{
							((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("Failed to parse time for announcement ");
							((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<string>(announcement.Name);
							((BepInExLogInterpolatedStringHandler)val2).AppendLiteral(" with time ");
							((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<string>(announcement.Time);
							((BepInExLogInterpolatedStringHandler)val2).AppendLiteral(" and message \"");
							((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<string>(announcement.Message);
							((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("\"");
						}
						log.LogError(val2);
						return false;
					}
					if (!announcement.OneTime && <announcementTime>5__2 < DateTime.Now)
					{
						<announcementTime>5__2 = <announcementTime>5__2.AddDays(1.0);
					}
				}
				<>2__current = (object)new WaitForSecondsRealtime((float)(<announcementTime>5__2 - DateTime.Now).TotalSeconds);
				<>1__state = 1;
				return true;
			}

			bool IEnumerator.MoveNext()
			{
				//ILSpy generated this explicit interface implementation from .override directive in MoveNext
				return this.MoveNext();
			}

			[DebuggerHidden]
			void IEnumerator.Reset()
			{
				throw new NotSupportedException();
			}
		}

		private static readonly string CONFIG_PATH = Path.Combine(Paths.ConfigPath, "KindredCommands");

		private static readonly string ANNOUNCEMENTS_PATH = Path.Combine(CONFIG_PATH, "announcements.json");

		private readonly List<Announcement> announcements = new List<Announcement>();

		private Dictionary<string, Coroutine> announcementCoroutines = new Dictionary<string, Coroutine>();

		public AnnouncementsService()
		{
			LoadAnnoucements();
		}

		private void ScheduleAnnouncement(Announcement announcement)
		{
			Coroutine val = Core.StartCoroutine(MessageCoroutine(announcement));
			if (val != null)
			{
				announcementCoroutines[announcement.Name] = val;
			}
		}

		[IteratorStateMachine(typeof(<MessageCoroutine>d__7))]
		private IEnumerator MessageCoroutine(Announcement announcement)
		{
			//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
			return new <MessageCoroutine>d__7(0)
			{
				<>4__this = this,
				announcement = announcement
			};
		}

		public bool AddAnnouncement(string name, string message, DateTime time, bool oneTime)
		{
			string nameLower = name.ToLowerInvariant();
			if (announcements.Where((Announcement a) => a.Name.ToLowerInvariant() == nameLower).Any())
			{
				return false;
			}
			Announcement announcement = default(Announcement);
			announcement.Name = name;
			announcement.Time = time.ToString();
			announcement.Message = message;
			announcement.OneTime = oneTime;
			Announcement announcement2 = announcement;
			announcements.Add(announcement2);
			ScheduleAnnouncement(announcement2);
			SortAnnouncements();
			SaveAnnoucements();
			return true;
		}

		private void SortAnnouncements()
		{
			announcements.Sort(AnnouncementCompare);
			static int AnnouncementCompare(Announcement x, Announcement y)
			{
				if (!DateTime.TryParse(x.Time, out var result))
				{
					return -1;
				}
				if (!DateTime.TryParse(y.Time, out var result2))
				{
					return 1;
				}
				DateTime now = DateTime.Now;
				if (result < now)
				{
					result = result.AddDays(1.0);
				}
				if (result2 < now)
				{
					result2 = result2.AddDays(1.0);
				}
				int num = DateTime.Compare(result, result2);
				if (num == 0)
				{
					num = string.Compare(x.Name, y.Name, StringComparison.InvariantCultureIgnoreCase);
				}
				return num;
			}
		}

		public bool RemoveAnnouncement(string name)
		{
			string nameLower = name.ToLowerInvariant();
			IEnumerable<string> source = from a in announcements
				where a.Name.ToLowerInvariant() == nameLower
				select a into x
				select x.Name;
			if (!source.Any())
			{
				return false;
			}
			name = source.First();
			announcements.RemoveAll((Announcement a) => a.Name == name);
			if (!announcementCoroutines.TryGetValue(name, out var value))
			{
				SaveAnnoucements();
				return true;
			}
			Core.StopCoroutine(value);
			announcementCoroutines.Remove(name);
			SaveAnnoucements();
			return true;
		}

		public IEnumerable<Announcement> GetAnnouncements()
		{
			return announcements;
		}

		private void LoadAnnoucements()
		{
			if (File.Exists(ANNOUNCEMENTS_PATH))
			{
				string json = File.ReadAllText(ANNOUNCEMENTS_PATH);
				announcements.Clear();
				announcements.AddRange(JsonSerializer.Deserialize<Announcement[]>(json));
				SortAnnouncements();
				foreach (Coroutine value in announcementCoroutines.Values)
				{
					Core.StopCoroutine(value);
				}
				announcementCoroutines.Clear();
				{
					foreach (Announcement announcement in announcements)
					{
						ScheduleAnnouncement(announcement);
					}
					return;
				}
			}
			SaveAnnoucements();
		}

		private void SaveAnnoucements()
		{
			if (!Directory.Exists(CONFIG_PATH))
			{
				Directory.CreateDirectory(CONFIG_PATH);
			}
			JsonSerializerOptions options = new JsonSerializerOptions
			{
				WriteIndented = true
			};
			string contents = JsonSerializer.Serialize(announcements, options);
			File.WriteAllText(ANNOUNCEMENTS_PATH, contents);
		}
	}
	internal class AuditService
	{
		private static readonly string CONFIG_PATH = Path.Combine(Paths.ConfigPath, "KindredCommands");

		private static readonly string AUDIT_PATH = Path.Combine(CONFIG_PATH, "audit-" + DateTime.Now.ToString("yyyy-MM-dd_HH-mm-ss") + ".csv");

		private Mutex mutex = new Mutex(initiallyOwned: false, $"KindredCommands.AuditService-{Process.GetCurrentProcess().Id}");

		public void LogChatMessage(User fromUser, User toUser, ChatMessageType type, CommandResult vcfResult, string message)
		{
			//IL_0044: Unknown result type (might be due to invalid IL or missing references)
			//IL_005d: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			//IL_007b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0094: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
			StringBuilder stringBuilder = new StringBuilder();
			stringBuilder.Append(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
			stringBuilder.Append(",");
			stringBuilder.Append("chat");
			stringBuilder.Append(",");
			stringBuilder.Append(fromUser.PlatformId);
			stringBuilder.Append(",");
			stringBuilder.Append(fromUser.CharacterName);
			stringBuilder.Append(",");
			stringBuilder.Append(type);
			stringBuilder.Append(",");
			stringBuilder.Append(vcfResult);
			stringBuilder.Append(",");
			stringBuilder.Append(toUser.PlatformId);
			stringBuilder.Append(",");
			stringBuilder.Append(toUser.CharacterName);
			stringBuilder.Append(",");
			stringBuilder.Append(message);
			stringBuilder.Append("\n");
			AddAuditString(stringBuilder);
		}

		public void LogMapTeleport(User user, TeleportTarget teleportTarget, float3 destination)
		{
			//IL_0044: Unknown result type (might be due to invalid IL or missing references)
			//IL_005d: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			//IL_007b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0094: Unknown result type (might be due to invalid IL or missing references)
			StringBuilder stringBuilder = new StringBuilder();
			stringBuilder.Append(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
			stringBuilder.Append(",");
			stringBuilder.Append("teleportMap");
			stringBuilder.Append(",");
			stringBuilder.Append(user.PlatformId);
			stringBuilder.Append(",");
			stringBuilder.Append(user.CharacterName);
			stringBuilder.Append(",");
			stringBuilder.Append(teleportTarget);
			stringBuilder.Append(",");
			stringBuilder.Append(destination);
			stringBuilder.Append("\n");
			AddAuditString(stringBuilder);
		}

		public void LogTeleport(User user, TeleportTarget teleportTarget, float3 mousePosition, TeleportLocation location, float3 locationPosition)
		{
			//IL_0044: Unknown result type (might be due to invalid IL or missing references)
			//IL_005d: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			//IL_007b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0094: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ad: 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)
			StringBuilder stringBuilder = new StringBuilder();
			stringBuilder.Append(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
			stringBuilder.Append(",");
			stringBuilder.Append("teleport");
			stringBuilder.Append(",");
			stringBuilder.Append(user.PlatformId);
			stringBuilder.Append(",");
			stringBuilder.Append(user.CharacterName);
			stringBuilder.Append(",");
			stringBuilder.Append(teleportTarget);
			stringBuilder.Append(",");
			stringBuilder.Append(mousePosition);
			stringBuilder.Append(",");
			stringBuilder.Append(location);
			stringBuilder.Append(",");
			stringBuilder.Append(locationPosition);
			stringBuilder.Append("\n");
			AddAuditString(stringBuilder);
		}

		public void LogDestroy(User user, string what, DestroyWhere where, PrefabGUID prefabGuid, float3 position, int amount)
		{
			//IL_0044: Unknown result type (might be due to invalid IL or missing references)
			//IL_005d: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			//IL_008f: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
			StringBuilder stringBuilder = new StringBuilder();
			stringBuilder.Append(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
			stringBuilder.Append(",");
			stringBuilder.Append("destroy");
			stringBuilder.Append(",");
			stringBuilder.Append(user.PlatformId);
			stringBuilder.Append(",");
			stringBuilder.Append(user.CharacterName);
			stringBuilder.Append(",");
			stringBuilder.Append(what);
			stringBuilder.Append(",");
			stringBuilder.Append(where);
			stringBuilder.Append(",");
			stringBuilder.Append(prefabGuid.LookupName());
			stringBuilder.Append(",");
			stringBuilder.Append(position);
			stringBuilder.Append(",");
			stringBuilder.Append(amount);
			stringBuilder.Append("\n");
			AddAuditString(stringBuilder);
		}

		public void LogGive(User user, PrefabGUID prefabGuid, int amount)
		{
			//IL_0044: Unknown result type (might be due to invalid IL or missing references)
			//IL_005d: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			//IL_007b: Unknown result type (might be due to invalid IL or missing references)
			StringBuilder stringBuilder = new StringBuilder();
			stringBuilder.Append(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
			stringBuilder.Append(",");
			stringBuilder.Append("give");
			stringBuilder.Append(",");
			stringBuilder.Append(user.PlatformId);
			stringBuilder.Append(",");
			stringBuilder.Append(user.CharacterName);
			stringBuilder.Append(",");
			stringBuilder.Append(prefabGuid.LookupName());
			stringBuilder.Append(",");
			stringBuilder.Append(amount);
			stringBuilder.Append("\n");
			AddAuditString(stri