Decompiled source of KindredCommands v1.8.0

KindredCommands.dll

Decompiled 2 weeks ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
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 BepInEx;
using BepInEx.Core.Logging.Interpolation;
using BepInEx.Logging;
using BepInEx.Unity.IL2CPP;
using BepInEx.Unity.IL2CPP.Utils.Collections;
using Bloodstone.API;
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.Network;
using ProjectM.Physics;
using ProjectM.Scripting;
using ProjectM.Shared;
using ProjectM.Terrain;
using Stunlock.Core;
using Stunlock.Network;
using UnitKiller;
using Unity.Collections;
using Unity.Entities;
using Unity.Mathematics;
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("1.8.0.0")]
[assembly: AssemblyInformationalVersion("1.8.0+91cff81cdd70bdc8b12f0b158af39e94b66a361e")]
[assembly: AssemblyProduct("KindredCommands")]
[assembly: AssemblyTitle("KindredCommands")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.8.0.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_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_017a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0181: Expected O, but got Unknown
		//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_0025: 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_002b: 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_002f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0034: Unknown result type (might be due to invalid IL or missing references)
		//IL_0039: 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_0041: 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_0065: 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_0116: Unknown result type (might be due to invalid IL or missing references)
		//IL_0118: Unknown result type (might be due to invalid IL or missing references)
		//IL_0125: Unknown result type (might be due to invalid IL or missing references)
		//IL_0127: Unknown result type (might be due to invalid IL or missing references)
		//IL_0139: Unknown result type (might be due to invalid IL or missing references)
		//IL_013b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0148: Unknown result type (might be due to invalid IL or missing references)
		//IL_0155: Unknown result type (might be due to invalid IL or missing references)
		//IL_015f: Expected O, but got Unknown
		//IL_015a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0161: Expected O, but got Unknown
		//IL_0165: Unknown result type (might be due to invalid IL or missing references)
		//IL_016a: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a6: 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_00ad: Unknown result type (might be due to invalid IL or missing references)
		//IL_0240: Unknown result type (might be due to invalid IL or missing references)
		//IL_0243: Invalid comparison between Unknown and I4
		//IL_0288: Unknown result type (might be due to invalid IL or missing references)
		//IL_028f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0292: Unknown result type (might be due to invalid IL or missing references)
		//IL_02ac: Expected I4, but got Unknown
		//IL_0267: Unknown result type (might be due to invalid IL or missing references)
		//IL_026c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0272: 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_027b: 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_03d4: Unknown result type (might be due to invalid IL or missing references)
		//IL_03d6: Unknown result type (might be due to invalid IL or missing references)
		//IL_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_03ea: Unknown result type (might be due to invalid IL or missing references)
		//IL_03ec: 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_0384: Unknown result type (might be due to invalid IL or missing references)
		//IL_038b: Expected O, but got Unknown
		//IL_03be: Unknown result type (might be due to invalid IL or missing references)
		//IL_03c3: Unknown result type (might be due to invalid IL or missing references)
		//IL_03c7: Unknown result type (might be due to invalid IL or missing references)
		//IL_0343: Unknown result type (might be due to invalid IL or missing references)
		//IL_034a: Expected O, but got Unknown
		//IL_02bb: Unknown result type (might be due to invalid IL or missing references)
		//IL_02c2: Expected O, but got Unknown
		//IL_02ff: Unknown result type (might be due to invalid IL or missing references)
		//IL_0306: Expected O, but got Unknown
		EntityQuery _ChatMessageJob_entityQuery = __instance.__ChatMessageJob_entityQuery;
		NativeArray<Entity> val = ((EntityQuery)(ref _ChatMessageJob_entityQuery)).ToEntityArray((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)(FixedString512)(ref val4.MessageText)).ToString();
			bool flag = val3.IsAdmin;
			bool flag2 = Core.StealthAdminService.IsStealthAdmin(val2.User);
			if (!flag && flag2 && ((object)(FixedString512)(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 = FixedString512.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 = VWorld.Server.EntityManager;
				((EntityManager)(ref entityManager)).DestroyEntity(current);
			}
			if (flag && flag2)
			{
				val3 = val2.User.Read<User>();
				val3.IsAdmin = false;
				val2.User.Write<User>(val3);
			}
		}
		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 UnitKiller
{
	internal static class MobUtility
	{
		private static NativeArray<Entity> GetMobs()
		{
			//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_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Expected O, but got Unknown
			//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_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_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_0054: Unknown result type (might be due to invalid IL or missing references)
			//IL_0059: 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_0073: Unknown result type (might be due to invalid IL or missing references)
			EntityManager entityManager = Core.EntityManager;
			EntityQueryDesc[] array = new EntityQueryDesc[1];
			EntityQueryDesc val = new EntityQueryDesc();
			val.All = Il2CppStructArray<ComponentType>.op_Implicit((ComponentType[])(object)new ComponentType[2]
			{
				ComponentType.ReadOnly<LocalToWorld>(),
				ComponentType.ReadOnly<Team>()
			});
			val.None = Il2CppStructArray<ComponentType>.op_Implicit((ComponentType[])(object)new ComponentType[2]
			{
				ComponentType.ReadOnly<Dead>(),
				ComponentType.ReadOnly<DestroyTag>()
			});
			array[0] = val;
			EntityQuery val2 = ((EntityManager)(ref entityManager)).CreateEntityQuery((EntityQueryDesc[])(object)array);
			return ((EntityQuery)(ref val2)).ToEntityArray((Allocator)2);
		}

		internal static List<Entity> ClosestMobs(ChatCommandContext ctx, float radius, PrefabGUID? mobGUID = null)
		{
			//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_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_0018: 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_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_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_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_004c: 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_0053: 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_005c: 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_0063: 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_006c: 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_006f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0074: Unknown result type (might be due to invalid IL or missing references)
			//IL_0076: Unknown result type (might be due to invalid IL or missing references)
			//IL_0082: Unknown result type (might be due to invalid IL or missing references)
			//IL_0087: 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_0091: 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_00b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a2: 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_00ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_00db: Unknown result type (might be due to invalid IL or missing references)
			try
			{
				Entity senderCharacterEntity = ctx.Event.SenderCharacterEntity;
				NativeArray<Entity> mobs = GetMobs();
				List<Entity> list = new List<Entity>();
				EntityManager entityManager = Core.EntityManager;
				LocalToWorld componentData = ((EntityManager)(ref entityManager)).GetComponentData<LocalToWorld>(senderCharacterEntity);
				float3 position = ((LocalToWorld)(ref componentData)).Position;
				VWorld.Server.GetExistingSystem<PrefabCollectionSystem>();
				Enumerator<Entity> enumerator = mobs.GetEnumerator();
				while (enumerator.MoveNext())
				{
					Entity current = enumerator.Current;
					entityManager = Core.EntityManager;
					componentData = ((EntityManager)(ref entityManager)).GetComponentData<LocalToWorld>(current);
					float3 position2 = ((LocalToWorld)(ref componentData)).Position;
					float num = Vector3.Distance(float3.op_Implicit(position), float3.op_Implicit(position2));
					EntityManager entityManager2 = Core.EntityManager;
					ComponentDataFromEntity<PrefabGUID> componentDataFromEntity = ((EntityManager)(ref entityManager2)).GetComponentDataFromEntity<PrefabGUID>(false);
					if (!mobGUID.HasValue && num < radius)
					{
						list.Add(current);
					}
					else if (num < radius)
					{
						PrefabGUID val = componentDataFromEntity[current];
						PrefabGUID? val2 = mobGUID;
						if (val2.HasValue && val == val2.GetValueOrDefault())
						{
							list.Add(current);
						}
					}
				}
				return list;
			}
			catch (Exception)
			{
				return null;
			}
		}
	}
}
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_0052: Unknown result type (might be due to invalid IL or missing references)
			//IL_0053: 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_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_0071: Unknown result type (might be due to invalid IL or missing references)
			//IL_007f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0079: Unknown result type (might be due to invalid IL or missing references)
			//IL_0087: 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_0097: 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_009f: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ff: 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_00ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_012b: 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_0108: Unknown result type (might be due to invalid IL or missing references)
			//IL_010d: 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_0123: Unknown result type (might be due to invalid IL or missing references)
			//IL_0124: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e1: 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_00f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c8: 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_00d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0139: Unknown result type (might be due to invalid IL or missing references)
			//IL_0133: Unknown result type (might be due to invalid IL or missing references)
			//IL_0141: Unknown result type (might be due to invalid IL or missing references)
			DebugEventsSystem existingSystem = Core.Server.GetExistingSystem<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(VWorld.Server.EntityManager, Character, buffPrefab, ref entity))
			{
				existingSystem.ApplyBuff(val4, val2);
				if (BuffUtility.TryGetBuff(VWorld.Server.EntityManager, Character, 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.Duration = -1f;
							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_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)
			Entity val = default(Entity);
			if (BuffUtility.TryGetBuff(Core.EntityManager, Character, buffPrefab, ref val))
			{
				DestroyUtility.Destroy(Core.EntityManager, val, (DestroyDebugReason)13, (string)null, 0);
			}
		}
	}
	internal static class Core
	{
		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.GetExistingSystem<GameDataSystem>();


		public static CastleBuffsTickSystem CastleBuffsTickSystem { get; } = Server.GetExistingSystem<CastleBuffsTickSystem>();


		public static ServerGameManager ServerGameManager { get; internal set; }

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


		public static AnnouncementsService AnnouncementsService { get; internal 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 GearService GearService { get; internal set; }

		public static PlayerService Players { get; internal set; }

		public static PrefabService Prefabs { get; internal set; }

		public static RegionService Regions { get; internal set; }

		public static StealthAdminService StealthAdminService { 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_0012: 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_00a0: Expected O, but got Unknown
			if (!_hasInitialized)
			{
				ServerGameManager = Server.GetExistingSystem<ServerScriptMapper>().GetServerGameManager();
				Players = new PlayerService();
				Prefabs = new PrefabService();
				ConfigSettings = new ConfigSettingsService();
				AnnouncementsService = new AnnouncementsService();
				BoostedPlayerService = new BoostedPlayerService();
				Boss = new BossService();
				CastleTerritory = new CastleTerritoryService();
				GearService = new GearService();
				Regions = new RegionService();
				StealthAdminService = new StealthAdminService();
				UnitSpawner = new UnitSpawnerService();
				_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 class ECSExtensions
	{
		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)
			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 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)
			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_000e: Unknown result type (might be due to invalid IL or missing references)
			EntityManager entityManager = VWorld.Server.EntityManager;
			return ((EntityManager)(ref entityManager)).GetBuffer<T>(entity);
		}

		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_0011: 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_0031: 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)
			PrefabCollectionSystem existingSystem = VWorld.Server.GetExistingSystem<PrefabCollectionSystem>();
			object obj;
			if (!((PrefabCollectionSystem_Base)existingSystem).PrefabGuidToNameDictionary.ContainsKey(prefabGuid))
			{
				obj = "GUID Not Found";
			}
			else
			{
				string text = ((PrefabCollectionSystem_Base)existingSystem).PrefabGuidToNameDictionary[prefabGuid];
				PrefabGUID val = prefabGuid;
				obj = text + " " + ((object)(PrefabGUID)(ref val)).ToString();
			}
			return obj.ToString();
		}

		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
	{
		public static AdminAuthSystem adminAuthSystem = VWorld.Server.GetExistingSystem<AdminAuthSystem>();

		public static ClanSystem_Server clanSystem = VWorld.Server.GetExistingSystem<ClanSystem_Server>();

		public static EntityCommandBufferSystem entityCommandBufferSystem = VWorld.Server.GetExistingSystem<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
			{
				componentData.GuidHash = 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_000b: 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_0019: 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_0022: 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_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)
			//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_003b: 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_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_0060: 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_005e: Unknown result type (might be due to invalid IL or missing references)
			try
			{
				GameDataSystem existingSystem = Core.Server.GetExistingSystem<GameDataSystem>();
				return InventoryUtilitiesServer.TryAddItem(AddItemSettings.Create(Core.EntityManager, existingSystem.ItemHashLookupMap, false, default(Entity), default(Nullable_Unboxed<int>), false, false, false, default(Nullable_Unboxed<int>)), 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_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_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)
			//IL_0010: 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_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)
			//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_001e: 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_002e: Expected O, but got Unknown
			//IL_003d: 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_0052: Unknown result type (might be due to invalid IL or missing references)
			//IL_005a: 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_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0072: Unknown result type (might be due to invalid IL or missing references)
			//IL_0076: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_0027: Unknown result type (might be due to invalid IL or missing references)
			EntityQueryOptions val = (EntityQueryOptions)0;
			if (includeAll)
			{
				val = (EntityQueryOptions)(val | 0x1B);
			}
			if (includeDisabled)
			{
				val = (EntityQueryOptions)(val | 2);
			}
			if (includeSpawn)
			{
				val = (EntityQueryOptions)(val | 8);
			}
			if (includePrefab)
			{
				val = (EntityQueryOptions)(val | 1);
			}
			if (includeDestroyed)
			{
				val = (EntityQueryOptions)(val | 0x10);
			}
			EntityQueryDesc val2 = new EntityQueryDesc();
			val2.All = Il2CppStructArray<ComponentType>.op_Implicit((ComponentType[])(object)new ComponentType[1]
			{
				new ComponentType(Il2CppType.Of<T1>(), (AccessMode)0)
			});
			val2.Options = val;
			EntityQueryDesc val3 = val2;
			EntityManager entityManager = Core.EntityManager;
			EntityQuery val4 = ((EntityManager)(ref entityManager)).CreateEntityQuery((EntityQueryDesc[])(object)new EntityQueryDesc[1] { val3 });
			return ((EntityQuery)(ref val4)).ToEntityArray((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_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_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)
			//IL_0010: 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_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)
			//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_001e: 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_002e: Expected O, but got Unknown
			//IL_003d: 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_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_0064: 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_0071: Unknown result type (might be due to invalid IL or missing references)
			//IL_007f: 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_0088: 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_0027: Unknown result type (might be due to invalid IL or missing references)
			EntityQueryOptions val = (EntityQueryOptions)0;
			if (includeAll)
			{
				val = (EntityQueryOptions)(val | 0x1B);
			}
			if (includeDisabled)
			{
				val = (EntityQueryOptions)(val | 2);
			}
			if (includeSpawn)
			{
				val = (EntityQueryOptions)(val | 8);
			}
			if (includePrefab)
			{
				val = (EntityQueryOptions)(val | 1);
			}
			if (includeDestroyed)
			{
				val = (EntityQueryOptions)(val | 0x10);
			}
			EntityQueryDesc val2 = new EntityQueryDesc();
			val2.All = Il2CppStructArray<ComponentType>.op_Implicit((ComponentType[])(object)new ComponentType[2]
			{
				new ComponentType(Il2CppType.Of<T1>(), (AccessMode)0),
				new ComponentType(Il2CppType.Of<T2>(), (AccessMode)0)
			});
			val2.Options = val;
			EntityQueryDesc val3 = val2;
			EntityManager entityManager = Core.EntityManager;
			EntityQuery val4 = ((EntityManager)(ref entityManager)).CreateEntityQuery((EntityQueryDesc[])(object)new EntityQueryDesc[1] { val3 });
			return ((EntityQuery)(ref val4)).ToEntityArray((Allocator)2);
		}

		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)
			NativeArray<Entity> entities = GetEntitiesByComponentType<T>(includeAll: false, includeDisabled: true, includeSpawn: true);
			Enumerator<Entity> enumerator = entities.GetEnumerator();
			while (enumerator.MoveNext())
			{
				Entity current = enumerator.Current;
				if (current.Has<Translation>())
				{
					float3 value = current.Read<Translation>().Value;
					if (math.distance(center, ((float3)(ref value)).xz) <= radius)
					{
						yield return current;
					}
				}
			}
			entities.Dispose();
		}

		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_0011: 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_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_0031: 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_0037: 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_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_0058: Unknown result type (might be due to invalid IL or missing references)
			//IL_0059: 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_0088: Unknown result type (might be due to invalid IL or missing references)
			//IL_008d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0092: 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_009d: Unknown result type (might be due to invalid IL or missing references)
			//IL_009f: 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_00ab: 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_00c7: 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((Allocator)2);
			((Equipment)(ref val)).GetAllEquipmentEntities(val2);
			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(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_007f: 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_003c: 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_0099: 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_00a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a7: 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_00b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c0: 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_00c7: 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_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_0078: Unknown result type (might be due to invalid IL or missing references)
			//IL_0079: 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_00ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ff: 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_0102: Unknown result type (might be due to invalid IL or missing references)
			//IL_0103: Unknown result type (might be due to invalid IL or missing references)
			//IL_0106: Unknown result type (might be due to invalid IL or missing references)
			//IL_010c: Unknown result type (might be due to invalid IL or missing references)
			//IL_010f: Unknown result type (might be due to invalid IL or missing references)
			Health val = Character.Read<Health>();
			if (ctx != null)
			{
				ctx.Reply("TryGetbuff");
			}
			Entity val2 = default(Entity);
			if (BuffUtility.TryGetBuff(Core.EntityManager, Character, 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;
				val4.has_value = NativeBoolean.op_Implicit(true);
				Nullable_Unboxed<float3> val5 = val4;
				if (ctx != null)
				{
					ctx.Reply("Respawn2");
				}
				ServerBootstrapSystem existingSystem = VWorld.Server.GetExistingSystem<ServerBootstrapSystem>();
				EntityCommandBuffer val6 = VWorld.Server.GetExistingSystem<EntityCommandBufferSystem>().CreateCommandBuffer();
				if (ctx != null)
				{
					ctx.Reply("Respawn3");
				}
				existingSystem.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_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_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_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_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_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_0037: 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_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_004c: 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_0060: 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)
			EntityManager entityManager = Core.EntityManager;
			Enumerator<UserMapZoneElement> enumerator = ((EntityManager)(ref entityManager)).GetBuffer<UserMapZoneElement>(userEntity).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);
				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", "1.8.0")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[Reloadable]
	public class Plugin : BasePlugin, IRunOnInitialized
	{
		internal static Harmony Harmony;

		internal static ManualLogSource PluginLog;

		public static ManualLogSource LogInstance { get; private set; }

		public override void Load()
		{
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Expected O, but got Unknown
			//IL_0071: Unknown result type (might be due to invalid IL or missing references)
			//IL_007b: Expected O, but got Unknown
			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>("1.8.0");
				((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 existingSystem = Core.Server.GetExistingSystem<PrefabCollectionSystem>();
			if (existingSystem == null)
			{
				return false;
			}
			return ((PrefabCollectionSystem_Base)existingSystem).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 = "1.8.0";
	}
}
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 (((FixedString64)(ref val.CharacterName)).IsEmpty)
				{
					Helper.RevealMapForPlayer(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; }
		}

		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>();

		private GameObject announcementSvcGameObject;

		private IgnorePhysicsDebugSystem announcementMonoBehaviour;

		public AnnouncementsService()
		{
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: Expected O, but got Unknown
			announcementSvcGameObject = new GameObject("AnnouncementService");
			announcementMonoBehaviour = announcementSvcGameObject.AddComponent<IgnorePhysicsDebugSystem>();
			LoadAnnoucements();
		}

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

		private IEnumerator MessageCoroutine(Announcement announcement)
		{
			if (!DateTime.TryParse(announcement.Time, out var announcementTime))
			{
				ManualLogSource log = Core.Log;
				bool flag = default(bool);
				BepInExErrorLogInterpolatedStringHandler val = new BepInExErrorLogInterpolatedStringHandler(64, 3, ref flag);
				if (flag)
				{
					((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Failed to parse time for announcement ");
					((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>(announcement.Name);
					((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" with time ");
					((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>(announcement.Time);
					((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" and message \"");
					((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>(announcement.Message);
					((BepInExLogInterpolatedStringHandler)val).AppendLiteral("\"");
				}
				log.LogError(val);
			}
			else
			{
				if (!announcement.OneTime && announcementTime < DateTime.Now)
				{
					announcementTime = announcementTime.AddDays(1.0);
				}
				do
				{
					yield return (object)new WaitForSecondsRealtime((float)(announcementTime - DateTime.Now).TotalSeconds);
					ServerChatUtils.SendSystemMessageToAllClients(Core.EntityManager, announcement.Message);
					announcementTime = announcementTime.AddDays(1.0);
					SortAnnouncements();
				}
				while (!announcement.OneTime);
				announcements.Remove(announcement);
				announcementCoroutines.Remove(announcement.Name);
				SaveAnnoucements();
			}
		}

		public bool AddAnnouncement(string name, string message, string 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;
			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;
			}
			((MonoBehaviour)announcementMonoBehaviour).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)
				{
					((MonoBehaviour)announcementMonoBehaviour).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 BoostedPlayerService
	{
		private readonly HashSet<Entity> boostedPlayers = new HashSet<Entity>();

		private readonly Dictionary<Entity, float> playerAttackSpeed = new Dictionary<Entity, float>();

		private readonly Dictionary<Entity, float> playerDamage = new Dictionary<Entity, float>();

		private readonly Dictionary<Entity, int> playerHps = new Dictionary<Entity, int>();

		private readonly Dictionary<Entity, float> playerProjectileSpeeds = new Dictionary<Entity, float>();

		private readonly Dictionary<Entity, float> playerProjectileRanges = new Dictionary<Entity, float>();

		private readonly Dictionary<Entity, float> playerSpeeds = new Dictionary<Entity, float>();

		private readonly Dictionary<Entity, float> playerYield = new Dictionary<Entity, float>();

		private readonly HashSet<Entity> flyingPlayers = new HashSet<Entity>();

		private readonly HashSet<Entity> noAggroPlayers = new HashSet<Entity>();

		private readonly HashSet<Entity> noBlooddrainPlayers = new HashSet<Entity>();

		private readonly HashSet<Entity> noDurabilityPlayers = new HashSet<Entity>();

		private readonly HashSet<Entity> noCooldownPlayers = new HashSet<Entity>();

		private readonly HashSet<Entity> immaterialPlayers = new HashSet<Entity>();

		private readonly HashSet<Entity> invinciblePlayers = new HashSet<Entity>();

		private readonly HashSet<Entity> shroudedPlayers = new HashSet<Entity>();

		private GameObject boostedPlayerSvcGameObject;

		private IgnorePhysicsDebugSystem boostedPlayerMonoBehaviour;

		private static ModifyUnitStatBuff_DOTS Cooldown = new ModifyUnitStatBuff_DOTS
		{
			StatType = (UnitStatType)7,
			Value = 0f,
			ModificationType = (ModificationType)0,
			Id = ModificationId.NewId(0)
		};

		private static ModifyUnitStatBuff_DOTS SunCharge = new ModifyUnitStatBuff_DOTS
		{
			StatType = (UnitStatType)12,
			Value = 50000f,
			ModificationType = (ModificationType)3,
			Id = ModificationId.NewId(0)
		};

		private static ModifyUnitStatBuff_DOTS Hazard = new ModifyUnitStatBuff_DOTS
		{
			StatType = (UnitStatType)60,
			Value = 1f,
			ModificationType = (ModificationType)3,
			Id = ModificationId.NewId(0)
		};

		private static ModifyUnitStatBuff_DOTS SunResist = new ModifyUnitStatBuff_DOTS
		{
			StatType = (UnitStatType)19,
			Value = 10000f,
			ModificationType = (ModificationType)3,
			Id = ModificationId.NewId(0)
		};

		private static ModifyUnitStatBuff_DOTS Speed = new ModifyUnitStatBuff_DOTS
		{
			StatType = (UnitStatType)5,
			Value = 15f,
			ModificationType = (ModificationType)0,
			Id = ModificationId.NewId(4)
		};

		private static ModifyUnitStatBuff_DOTS PResist = new ModifyUnitStatBuff_DOTS
		{
			StatType = (UnitStatType)8,
			Value = 10000f,
			ModificationType = (ModificationType)3,
			Id = ModificationId.NewId(0)
		};

		private static ModifyUnitStatBuff_DOTS FResist = new ModifyUnitStatBuff_DOTS
		{
			StatType = (UnitStatType)9,
			Value = 10000f,
			ModificationType = (ModificationType)3,
			Id = ModificationId.NewId(0)
		};

		private static ModifyUnitStatBuff_DOTS HResist = new ModifyUnitStatBuff_DOTS
		{
			StatType = (UnitStatType)10,
			Value = 10000f,
			ModificationType = (ModificationType)3,
			Id = ModificationId.NewId(0)
		};

		private static ModifyUnitStatBuff_DOTS SResist = new ModifyUnitStatBuff_DOTS
		{
			StatType = (UnitStatType)11,
			Value = 10000f,
			ModificationType = (ModificationType)3,
			Id = ModificationId.NewId(0)
		};

		private static ModifyUnitStatBuff_DOTS GResist = new ModifyUnitStatBuff_DOTS
		{
			StatType = (UnitStatType)20,
			Value = 10000f,
			ModificationType = (ModificationType)3,
			Id = ModificationId.NewId(0)
		};

		private static ModifyUnitStatBuff_DOTS SPResist = new ModifyUnitStatBuff_DOTS
		{
			StatType = (UnitStatType)23,
			Value = 10000f,
			ModificationType = (ModificationType)3,
			Id = ModificationId.NewId(0)
		};

		private static ModifyUnitStatBuff_DOTS PPower = new ModifyUnitStatBuff_DOTS
		{
			StatType = (UnitStatType)0,
			Value = 10000f,
			ModificationType = (ModificationType)3,
			Id = ModificationId.NewId(0)
		};

		private static ModifyUnitStatBuff_DOTS SiegePower = new ModifyUnitStatBuff_DOTS
		{
			StatType = (UnitStatType)2,
			Value = 10000f,
			ModificationType = (ModificationType)3,
			Id = ModificationId.NewId(0)
		};

		private static ModifyUnitStatBuff_DOTS RPower = new ModifyUnitStatBuff_DOTS
		{
			StatType = (UnitStatType)1,
			Value = 10000f,
			ModificationType = (ModificationType)3,
			Id = ModificationId.NewId(0)
		};

		private static ModifyUnitStatBuff_DOTS SPPower = new ModifyUnitStatBuff_DOTS
		{
			StatType = (UnitStatType)25,
			Value = 10000f,
			ModificationType = (ModificationType)3,
			Id = ModificationId.NewId(0)
		};

		private static ModifyUnitStatBuff_DOTS PHRegen = new ModifyUnitStatBuff_DOTS
		{
			StatType = (UnitStatType)26,
			Value = 100000f,
			ModificationType = (ModificationType)3,
			Id = ModificationId.NewId(0)
		};

		private static ModifyUnitStatBuff_DOTS HRecovery = new ModifyUnitStatBuff_DOTS
		{
			StatType = (UnitStatType)62,
			Value = 100000f,
			ModificationType = (ModificationType)3,
			Id = ModificationId.NewId(0)
		};

		private static ModifyUnitStatBuff_DOTS MaxHP = new ModifyUnitStatBuff_DOTS
		{
			StatType = (UnitStatType)4,
			Value = 100000f,
			ModificationType = (ModificationType)0,
			Id = ModificationId.NewId(5)
		};

		private static ModifyUnitStatBuff_DOTS MaxYield = new ModifyUnitStatBuff_DOTS
		{
			StatType = (UnitStatType)3,
			Value = 10f,
			ModificationType = (ModificationType)4,
			Id = ModificationId.NewId(0)
		};

		private static ModifyUnitStatBuff_DOTS DurabilityLoss = new ModifyUnitStatBuff_DOTS
		{
			StatType = (UnitStatType)58,
			Value = -10000f,
			ModificationType = (ModificationType)3,
			Id = ModificationId.NewId(0)
		};

		private static ModifyUnitStatBuff_DOTS AttackSpeed = new ModifyUnitStatBuff_DOTS
		{
			StatType = (UnitStatType)33,
			Value = 5f,
			ModificationType = (ModificationType)4,
			Id = ModificationId.NewId(0)
		};

		public static readonly List<ModifyUnitStatBuff_DOTS> invincibleBuffs = new List<ModifyUnitStatBuff_DOTS>(11)
		{
			PResist, FResist, HResist, SResist, SunResist, GResist, SPResist, Hazard, SunCharge, HRecovery,
			PHRegen
		};

		public static readonly List<ModifyUnitStatBuff_DOTS> damageBuffs = new List<ModifyUnitStatBuff_DOTS>(4) { PPower, RPower, SPPower, SiegePower };

		public BoostedPlayerService()
		{
			//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c6: Expected O, but got Unknown
			boostedPlayerSvcGameObject = new GameObject("BoostedPlayerService");
			boostedPlayerMonoBehaviour = boostedPlayerSvcGameObject.AddComponent<IgnorePhysicsDebugSystem>();
		}

		public bool IsBoostedPlayer(Entity charEntity)
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			return boostedPlayers.Contains(charEntity);
		}

		public void UpdateBoostedPlayer(Entity charEntity)
		{
			//IL_0006: 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_000e: 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_0018: 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_006a: 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_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)
			//IL_0031: 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_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_0053: Unknown result type (might be due to invalid IL or missing references)
			//IL_0059: Unknown result type (might be due to invalid IL or missing references)
			//IL_005a: 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_0072: 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_0074: Unknown result type (might be due to invalid IL or missing references)
			//IL_0081: Unknown result type (might be due to invalid IL or missing references)
			//IL_0086: Unknown result type (might be due to invalid IL or missing references)
			//IL_0087: 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_00d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00be: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_0095: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: 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_00a8: 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)
			boostedPlayers.Add(charEntity);
			Entity userEntity = charEntity.Read<PlayerCharacter>().UserEntity;
			if (invinciblePlayers.Contains(charEntity))
			{
				Health val = charEntity.Read<Health>();
				val.Value = ModifiableFloat.op_Implicit(val.MaxHealth);
				val.MaxRecoveryHealth = ModifiableFloat.op_Implicit(val.MaxHealth);
				charEntity.Write<Health>(val);
				Buffs.RemoveBuff(charEntity, Prefabs.Buff_InCombat_PvPVampire);
			}
			if (immaterialPlayers.Contains(charEntity))
			{
				Buffs.AddBuff(userEntity, charEntity, Prefabs.AB_Blood_BloodRite_Immaterial, -1);
				Entity entity = default(Entity);
				if (BuffUtility.TryGetBuff(Core.EntityManager, charEntity, Prefabs.AB_Blood_BloodRite_Immaterial, ref entity))
				{
					ModifyMovementSpeedBuff componentData = entity.Read<ModifyMovementSpeedBuff>();
					componentData.MoveSpeed = 1f;
					entity.Write<ModifyMovementSpeedBuff>(componentData);
				}
			}
			if (shroudedPlayers.Contains(charEntity))
			{
				Buffs.AddBuff(userEntity, charEntity, Prefabs.EquipBuff_ShroudOfTheForest, -1);
			}
			((MonoBehaviour)boostedPlayerMonoBehaviour).StartCoroutine(CollectionExtensions.WrapToIl2Cpp(RemoveAndAddCustomBuff(userEntity, charEntity)));
		}

		private IEnumerator RemoveAndAddCustomBuff(Entity userEntity, Entity charEntity)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_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)
			Buffs.RemoveBuff(charEntity, Prefabs.BoostedBuff1);
			Buffs.RemoveBuff(charEntity, Prefabs.BoostedBuff2);
			while (BuffUtility.HasBuff(Core.EntityManager, charEntity, Prefabs.BoostedBuff1))
			{
				yield return null;
			}
			while (BuffUtility.HasBuff(Core.EntityManager, charEntity, Prefabs.BoostedBuff2))
			{
				yield return null;
			}
			Buffs.AddBuff(userEntity, charEntity, Prefabs.BoostedBuff1, -1);
			Buffs.AddBuff(userEntity, charEntity, Prefabs.BoostedBuff2, -1);
		}

		public void RemoveBoostedPlayer(Entity charEntity)
		{
			//IL_0006: 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_0020: 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_003a: 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_0054: 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_006e: 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_0088: Unknown result type (might be due to invalid IL or missing references)
			//IL_0095: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a2: 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_00bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c9: 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)
			boostedPlayers.Remove(charEntity);
			playerAttackSpeed.Remove(charEntity);
			playerDamage.Remove(charEntity);
			playerHps.Remove(charEntity);
			playerProjectileSpeeds.Remove(charEntity);
			playerProjectileRanges.Remove(charEntity);
			playerSpeeds.Remove(charEntity);
			playerYield.Remove(charEntity);
			flyingPlayers.Remove(charEntity);
			noAggroPlayers.Remove(charEntity);
			noBlooddrainPlayers.Remove(charEntity);
			noCooldownPlayers.Remove(charEntity);
			noDurabilityPlayers.Remove(charEntity);
			immaterialPlayers.Remove(charEntity);
			invinciblePlayers.Remove(charEntity);
			shroudedPlayers.Remove(charEntity);
			ClearExtraBuffs(charEntity);
		}

		public void SetAttackSpeedMultiplier(Entity charEntity, float attackSpeed)
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			playerAttackSpeed[charEntity] = attackSpeed;
		}

		public void SetDamageBoost(Entity charEntity, float damage)
		{
			//IL_0006: 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)
			boostedPlayers.Add(charEntity);
			playerDamage[charEntity] = damage;
		}

		public void SetHealthBoost(Entity charEntity, int hp)
		{
			//IL_0006: 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)
			boostedPlayers.Add(charEntity);
			playerHps[charEntity] = hp;
		}

		public void SetProjectileSpeedMultiplier(Entity charEntity, float speed)
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			playerProjectileSpeeds[charEntity] = speed;
		}

		public bool GetProjectileSpeedMultiplier(Entity charEntity, out float speed)
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			return playerProjectileSpeeds.TryGetValue(charEntity, out speed);
		}

		public void SetProjectileRangeMultiplier(Entity charEntity, float range)
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			playerProjectileRanges[charEntity] = range;
		}

		public bool GetProjectileRangeMultiplier(Entity charEntity, out float range)
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			return playerProjectileRanges.TryGetValue(charEntity, out range);
		}

		public void SetSpeedBoost(Entity charEntity, float speed)
		{
			//IL_0006: 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)
			boostedPlayers.Add(charEntity);
			playerSpeeds[charEntity] = speed;
		}

		public void SetYieldMultiplier(Entity charEntity, float yield)
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			playerYield[charEntity] = yield;
		}

		public bool ToggleFlying(Entity charEntity)
		{
			//IL_0006: 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_0014: Unknown result type (might be due to invalid IL or missing references)
			if (flyingPlayers.Contains(charEntity))
			{
				flyingPlayers.Remove(charEntity);
				return false;
			}
			flyingPlayers.Add(charEntity);
			return true;
		}

		public void AddNoAggro(Entity charEntity)
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			noAggroPlayers.Add(charEntity);
		}

		public void AddNoBlooddrain(Entity charEntity)
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			noBlooddrainPlayers.Add(charEntity);
		}

		public void AddNoCooldown(Entity charEntity)
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			noCooldownPlayers.Add(charEntity);
		}

		public void AddNoDurability(Entity charEntity)
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			noDurabilityPlayers.Add(charEntity);
		}

		public void AddPlayerImmaterial(Entity charEntity)
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			immaterialPlayers.Add(charEntity);
		}

		public void AddPlayerInvincible(Entity charEntity)
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			invinciblePlayers.Add(charEntity);
		}

		public bool IsPlayerInvincible(Entity charEntity)
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			return invinciblePlayers.Contains(charEntity);
		}

		public void AddPlayerShrouded(Entity charEntity)
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			shroudedPlayers.Add(charEntity);
		}

		public void UpdateBoostedBuff1(Entity buffEntity)
		{
			//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_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_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_0029: 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_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_0044: 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_00cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d9: 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_00eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0123: Unknown result type (might be due to invalid IL or missing references)
			//IL_0103: Unknown result type (might be due to invalid IL or missing references)
			//IL_0108: 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_006c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: Unknown result type (might be due to invalid IL or missing references)
			//IL_007d: 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_012d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0148: Unknown result type (might be due to invalid IL or missing references)
			Entity owner = buffEntity.Read<EntityOwner>().Owner;
			EntityManager entityManager = Core.EntityManager;
			DynamicBuffer<ModifyUnitStatBuff_DOTS> val = ((EntityManager)(ref entityManager)).AddBuffer<ModifyUnitStatBuff_DOTS>(buffEntity);
			val.Clear();
			if (playerAttackSpeed.TryGetValue(owner, out var value))
			{
				ModifyUnitStatBuff_DOTS attackSpeed = AttackSpeed;
				attackSpeed.Value = value;
				val.Add(attackSpeed);
			}
			if (playerDamage.TryGetValue(owner, out var value2))
			{
				foreach (ModifyUnitStatBuff_DOTS damageBuff in damageBuffs)
				{
					ModifyUnitStatBuff_DOTS current = damageBuff;
					current.Value = value2;
					val.Add(current);
				}
			}
			if (playerHps.TryGetValue(owner, out var value3))
			{
				ModifyUnitStatBuff_DOTS maxHP = MaxHP;
				maxHP.Value = value3;
				val.Add(maxHP);
			}
			if (playerSpeeds.TryGetValue(owner, out var value4))
			{
				ModifyUnitStatBuff_DOTS speed = Speed;
				speed.Value = value4;
				val.Add(speed);
			}
			if (playerYield.TryGetValue(owner, out var value5))
			{
				ModifyUnitStatBuff_DOTS maxYield = MaxYield;
				maxYield.Value = value5;
				val.Add(maxYield);
			}
			if (noCooldownPlayers.Contains(owner))
			{
				val.Add(Cooldown);
			}
			if (noDurabilityPlayers.Contains(owner))
			{
				val.Add(DurabilityLoss);
			}
		}

		public void UpdateBoostedBuff2(Entity buffEntity)
		{
			//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_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//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_0028: 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_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)
			//IL_0039: 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