Decompiled source of LethalCheat v2.1.0

Lethal Cheat.dll

Decompiled 2 weeks ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using System.Threading.Tasks;
using BepInEx;
using BepInEx.Logging;
using Brigadier.NET;
using Brigadier.NET.ArgumentTypes;
using Brigadier.NET.Builder;
using Brigadier.NET.Context;
using Brigadier.NET.Tree;
using GameNetcodeStuff;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using Rumi.BrigadierForLethalCompany;
using Rumi.BrigadierForLethalCompany.API;
using Rumi.BrigadierForLethalCompany.API.ArgumentTypes;
using Rumi.BrigadierForLethalCompany.API.ArgumentTypes.Selectors;
using StaticNetcodeLib;
using Unity.Netcode;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: IgnoresAccessChecksTo("Assembly-CSharp")]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.0.0.0")]
[module: UnverifiableCode]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableAttribute : Attribute
	{
		public readonly byte[] NullableFlags;

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

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

		public NullableContextAttribute(byte P_0)
		{
			Flag = P_0;
		}
	}
}
namespace Rumi.LethalCheat
{
	internal static class Debug
	{
		public static void Log(object data)
		{
			ManualLogSource? logger = LCheatPlugin.logger;
			if (logger != null)
			{
				logger.LogInfo(data);
			}
		}

		public static void LogWarning(object data)
		{
			ManualLogSource? logger = LCheatPlugin.logger;
			if (logger != null)
			{
				logger.LogWarning(data);
			}
		}

		public static void LogError(object data)
		{
			ManualLogSource? logger = LCheatPlugin.logger;
			if (logger != null)
			{
				logger.LogError(data);
			}
		}
	}
	[BepInPlugin("Rumi.LethalCheat", "LethalCheat", "2.1.0")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	public sealed class LCheatPlugin : BaseUnityPlugin
	{
		public const string modGuid = "Rumi.LethalCheat";

		public const string modName = "LethalCheat";

		public const string modVersion = "2.1.0";

		internal static ManualLogSource? logger { get; private set; } = null;


		internal static Harmony harmony { get; } = new Harmony("Rumi.LethalCheat");


		private void Awake()
		{
			logger = ((BaseUnityPlugin)this).Logger;
			Debug.Log("Start loading plugin...");
			Debug.Log("Plugin LethalCheat is loaded!");
		}
	}
}
namespace Rumi.LethalCheat.API.Commands
{
	public sealed class CreditCommand : ServerCommand
	{
		public const string resultGetText = "The credit is {0}";

		public const string resultAddText = "Add the credit to {0}";

		public const string resultSetText = "Set the credit to {0}";

		private CreditCommand()
		{
		}

		public override void Register()
		{
			ServerCommand.dispatcher.Register((Func<IArgumentContext<ServerCommandSource>, LiteralArgumentBuilder<ServerCommandSource>>)((IArgumentContext<ServerCommandSource> x) => ((ArgumentBuilder<ServerCommandSource, LiteralArgumentBuilder<ServerCommandSource>, LiteralCommandNode<ServerCommandSource>>)(object)((ArgumentBuilder<ServerCommandSource, LiteralArgumentBuilder<ServerCommandSource>, LiteralCommandNode<ServerCommandSource>>)(object)((ArgumentBuilder<ServerCommandSource, LiteralArgumentBuilder<ServerCommandSource>, LiteralCommandNode<ServerCommandSource>>)(object)((ArgumentBuilder<ServerCommandSource, LiteralArgumentBuilder<ServerCommandSource>, LiteralCommandNode<ServerCommandSource>>)(object)LiteralArgumentBuilderExtensions.Literal<ServerCommandSource>(x, "credit")).Requires((Predicate<ServerCommandSource>)((ServerCommandSource x) => x.isOp))).Then<LiteralCommandNode<ServerCommandSource>>((Func<IArgumentContext<ServerCommandSource>, IArgumentBuilder<ServerCommandSource, LiteralCommandNode<ServerCommandSource>>>)((IArgumentContext<ServerCommandSource> x) => (IArgumentBuilder<ServerCommandSource, LiteralCommandNode<ServerCommandSource>>)(object)((ArgumentBuilder<ServerCommandSource, LiteralArgumentBuilder<ServerCommandSource>, LiteralCommandNode<ServerCommandSource>>)(object)LiteralArgumentBuilderExtensions.Literal<ServerCommandSource>(x, "get")).Executes((Command<ServerCommandSource>)delegate(CommandContext<ServerCommandSource> x)
			{
				int credit = GetCredit();
				x.Source.SendCommandResult($"The credit is {credit}", false);
				return credit;
			})))).Then<LiteralCommandNode<ServerCommandSource>>((Func<IArgumentContext<ServerCommandSource>, IArgumentBuilder<ServerCommandSource, LiteralCommandNode<ServerCommandSource>>>)((IArgumentContext<ServerCommandSource> x) => (IArgumentBuilder<ServerCommandSource, LiteralCommandNode<ServerCommandSource>>)(object)((ArgumentBuilder<ServerCommandSource, LiteralArgumentBuilder<ServerCommandSource>, LiteralCommandNode<ServerCommandSource>>)(object)LiteralArgumentBuilderExtensions.Literal<ServerCommandSource>(x, "add")).Then<ArgumentCommandNode<ServerCommandSource, int>>((Func<IArgumentContext<ServerCommandSource>, IArgumentBuilder<ServerCommandSource, ArgumentCommandNode<ServerCommandSource, int>>>)((IArgumentContext<ServerCommandSource> x) => (IArgumentBuilder<ServerCommandSource, ArgumentCommandNode<ServerCommandSource, int>>)(object)((ArgumentBuilder<ServerCommandSource, RequiredArgumentBuilder<ServerCommandSource, int>, ArgumentCommandNode<ServerCommandSource, int>>)(object)RequiredArgumentBuilderExtensions.Argument<ServerCommandSource, int>(x, "credit", (IArgumentType<int>)(object)Arguments.Integer(0, int.MaxValue))).Executes((Command<ServerCommandSource>)delegate(CommandContext<ServerCommandSource> x)
			{
				int integer2 = Arguments.GetInteger<ServerCommandSource>(x, "credit");
				SetCredit(GetCredit() + integer2);
				x.Source.SendCommandResult($"Add the credit to {integer2}", true);
				return integer2;
			})))))).Then<LiteralCommandNode<ServerCommandSource>>((Func<IArgumentContext<ServerCommandSource>, IArgumentBuilder<ServerCommandSource, LiteralCommandNode<ServerCommandSource>>>)((IArgumentContext<ServerCommandSource> x) => (IArgumentBuilder<ServerCommandSource, LiteralCommandNode<ServerCommandSource>>)(object)((ArgumentBuilder<ServerCommandSource, LiteralArgumentBuilder<ServerCommandSource>, LiteralCommandNode<ServerCommandSource>>)(object)LiteralArgumentBuilderExtensions.Literal<ServerCommandSource>(x, "set")).Then<ArgumentCommandNode<ServerCommandSource, int>>((Func<IArgumentContext<ServerCommandSource>, IArgumentBuilder<ServerCommandSource, ArgumentCommandNode<ServerCommandSource, int>>>)((IArgumentContext<ServerCommandSource> x) => (IArgumentBuilder<ServerCommandSource, ArgumentCommandNode<ServerCommandSource, int>>)(object)((ArgumentBuilder<ServerCommandSource, RequiredArgumentBuilder<ServerCommandSource, int>, ArgumentCommandNode<ServerCommandSource, int>>)(object)RequiredArgumentBuilderExtensions.Argument<ServerCommandSource, int>(x, "credit", (IArgumentType<int>)(object)Arguments.Integer(0, int.MaxValue))).Executes((Command<ServerCommandSource>)delegate(CommandContext<ServerCommandSource> x)
			{
				int integer = Arguments.GetInteger<ServerCommandSource>(x, "credit");
				SetCredit(integer);
				x.Source.SendCommandResult($"Set the credit to {integer}", true);
				return integer;
			})))))));
		}

		public static int GetCredit()
		{
			if ((Object)(object)NetworkManager.Singleton == (Object)null || !NetworkManager.Singleton.IsServer)
			{
				return 0;
			}
			return Object.FindAnyObjectByType<Terminal>().groupCredits;
		}

		public static void SetCredit(int credit)
		{
			if (!((Object)(object)NetworkManager.Singleton == (Object)null) && NetworkManager.Singleton.IsServer)
			{
				Terminal val = Object.FindAnyObjectByType<Terminal>();
				val.useCreditsCooldown = true;
				val.groupCredits = credit;
				val.SyncGroupCreditsServerRpc(val.groupCredits, val.numberOfItemsInDropship);
			}
		}
	}
	public sealed class DamageCommand : ServerCommand
	{
		public const string resultText = "Applied {0} damage to {1}";

		private DamageCommand()
		{
		}

		public override void Register()
		{
			ServerCommand.dispatcher.Register((Func<IArgumentContext<ServerCommandSource>, LiteralArgumentBuilder<ServerCommandSource>>)((IArgumentContext<ServerCommandSource> x) => ((ArgumentBuilder<ServerCommandSource, LiteralArgumentBuilder<ServerCommandSource>, LiteralCommandNode<ServerCommandSource>>)(object)((ArgumentBuilder<ServerCommandSource, LiteralArgumentBuilder<ServerCommandSource>, LiteralCommandNode<ServerCommandSource>>)(object)((ArgumentBuilder<ServerCommandSource, LiteralArgumentBuilder<ServerCommandSource>, LiteralCommandNode<ServerCommandSource>>)(object)LiteralArgumentBuilderExtensions.Literal<ServerCommandSource>(x, "damage")).Requires((Predicate<ServerCommandSource>)((ServerCommandSource x) => x.isOp))).Then<ArgumentCommandNode<ServerCommandSource, int>>((Func<IArgumentContext<ServerCommandSource>, IArgumentBuilder<ServerCommandSource, ArgumentCommandNode<ServerCommandSource, int>>>)((IArgumentContext<ServerCommandSource> x) => (IArgumentBuilder<ServerCommandSource, ArgumentCommandNode<ServerCommandSource, int>>)(object)((ArgumentBuilder<ServerCommandSource, RequiredArgumentBuilder<ServerCommandSource, int>, ArgumentCommandNode<ServerCommandSource, int>>)(object)RequiredArgumentBuilderExtensions.Argument<ServerCommandSource, int>(x, "amount", (IArgumentType<int>)(object)Arguments.Integer(int.MinValue, int.MaxValue))).Executes((Command<ServerCommandSource>)delegate(CommandContext<ServerCommandSource> x)
			{
				if ((Object)(object)x.Source.sender != (Object)null)
				{
					int integer2 = Arguments.GetInteger<ServerCommandSource>(x, "amount");
					DamageEntity(x.Source.sender, integer2);
					x.Source.SendCommandResult($"Applied {integer2} damage to {BFLCUtility.GetEntityName(x.Source.sender)}", true);
					return 1;
				}
				return 0;
			})))).Then<ArgumentCommandNode<ServerCommandSource, SelectorArgumentValue>>((Func<IArgumentContext<ServerCommandSource>, IArgumentBuilder<ServerCommandSource, ArgumentCommandNode<ServerCommandSource, SelectorArgumentValue>>>)((IArgumentContext<ServerCommandSource> x) => (IArgumentBuilder<ServerCommandSource, ArgumentCommandNode<ServerCommandSource, SelectorArgumentValue>>)(object)((ArgumentBuilder<ServerCommandSource, RequiredArgumentBuilder<ServerCommandSource, SelectorArgumentValue>, ArgumentCommandNode<ServerCommandSource, SelectorArgumentValue>>)(object)RequiredArgumentBuilderExtensions.Argument<ServerCommandSource, SelectorArgumentValue>(x, "targets", (IArgumentType<SelectorArgumentValue>)(object)LethalArguments.Selector(false, false))).Then<ArgumentCommandNode<ServerCommandSource, int>>((Func<IArgumentContext<ServerCommandSource>, IArgumentBuilder<ServerCommandSource, ArgumentCommandNode<ServerCommandSource, int>>>)((IArgumentContext<ServerCommandSource> x) => (IArgumentBuilder<ServerCommandSource, ArgumentCommandNode<ServerCommandSource, int>>)(object)((ArgumentBuilder<ServerCommandSource, RequiredArgumentBuilder<ServerCommandSource, int>, ArgumentCommandNode<ServerCommandSource, int>>)(object)RequiredArgumentBuilderExtensions.Argument<ServerCommandSource, int>(x, "amount", (IArgumentType<int>)(object)Arguments.Integer(int.MinValue, int.MaxValue))).Executes((Command<ServerCommandSource>)delegate(CommandContext<ServerCommandSource> x)
			{
				//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)
				SelectorArgumentValue selector = LethalArguments.GetSelector<ServerCommandSource>(x, "targets");
				IEnumerable<NetworkBehaviour> entitys = ((SelectorArgumentValue)(ref selector)).GetEntitys(x.Source);
				int integer = Arguments.GetInteger<ServerCommandSource>(x, "amount");
				int num = 0;
				foreach (NetworkBehaviour item in entitys)
				{
					if ((item is PlayerControllerB || item is EnemyAI) ? true : false)
					{
						try
						{
							DamageEntity(item, integer);
							num++;
						}
						catch (Exception data)
						{
							Debug.LogError(data);
						}
					}
				}
				x.Source.SendCommandResult($"Applied {integer} damage to {BFLCUtility.GetEntityName(entitys, num)}", true);
				return num;
			})))))));
		}

		public static void DamageEntity(NetworkBehaviour entity, int damage)
		{
			//IL_0034: Unknown result type (might be due to invalid IL or missing references)
			if (!((Object)(object)NetworkManager.Singleton == (Object)null) && NetworkManager.Singleton.IsServer && ((entity is PlayerControllerB || entity is EnemyAI) ? true : false))
			{
				InternalDamageEntityClientRpc(NetworkBehaviourReference.op_Implicit(entity), damage);
			}
		}

		[ClientRpc]
		private static void InternalDamageEntityClientRpc(NetworkBehaviourReference entityRef, int damage)
		{
			//IL_0020: 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)
			NetworkBehaviour val = default(NetworkBehaviour);
			if (!((NetworkBehaviourReference)(ref entityRef)).TryGet(ref val, (NetworkManager)null))
			{
				return;
			}
			PlayerControllerB val2 = (PlayerControllerB)(object)((val is PlayerControllerB) ? val : null);
			if (val2 != null)
			{
				val2.DamagePlayer(damage, true, true, (CauseOfDeath)0, 0, false, default(Vector3));
				return;
			}
			EnemyAI val3 = (EnemyAI)(object)((val is EnemyAI) ? val : null);
			if (val3 != null)
			{
				val3.HitEnemy(damage, (PlayerControllerB)null, true, -1);
			}
		}
	}
	public sealed class DestroyCommand : ServerCommand
	{
		public const string resultText = "Destroyed {0}";

		private DestroyCommand()
		{
		}

		public override void Register()
		{
			ServerCommand.dispatcher.Register((Func<IArgumentContext<ServerCommandSource>, LiteralArgumentBuilder<ServerCommandSource>>)((IArgumentContext<ServerCommandSource> x) => ((ArgumentBuilder<ServerCommandSource, LiteralArgumentBuilder<ServerCommandSource>, LiteralCommandNode<ServerCommandSource>>)(object)((ArgumentBuilder<ServerCommandSource, LiteralArgumentBuilder<ServerCommandSource>, LiteralCommandNode<ServerCommandSource>>)(object)((ArgumentBuilder<ServerCommandSource, LiteralArgumentBuilder<ServerCommandSource>, LiteralCommandNode<ServerCommandSource>>)(object)LiteralArgumentBuilderExtensions.Literal<ServerCommandSource>(x, "destroy")).Requires((Predicate<ServerCommandSource>)((ServerCommandSource x) => x.isOp))).Executes((Command<ServerCommandSource>)delegate(CommandContext<ServerCommandSource> x)
			{
				if ((Object)(object)x.Source.sender != (Object)null && (Object)(object)x.Source.player == (Object)null)
				{
					DestroyEntity(x.Source.sender);
					x.Source.SendCommandResult($"Destroyed {BFLCUtility.GetEntityName(x.Source.sender)}", true);
					return 1;
				}
				return 0;
			})).Then<ArgumentCommandNode<ServerCommandSource, SelectorArgumentValue>>((Func<IArgumentContext<ServerCommandSource>, IArgumentBuilder<ServerCommandSource, ArgumentCommandNode<ServerCommandSource, SelectorArgumentValue>>>)((IArgumentContext<ServerCommandSource> x) => (IArgumentBuilder<ServerCommandSource, ArgumentCommandNode<ServerCommandSource, SelectorArgumentValue>>)(object)((ArgumentBuilder<ServerCommandSource, RequiredArgumentBuilder<ServerCommandSource, SelectorArgumentValue>, ArgumentCommandNode<ServerCommandSource, SelectorArgumentValue>>)(object)RequiredArgumentBuilderExtensions.Argument<ServerCommandSource, SelectorArgumentValue>(x, "targets", (IArgumentType<SelectorArgumentValue>)(object)LethalArguments.Selector(false, false))).Executes((Command<ServerCommandSource>)delegate(CommandContext<ServerCommandSource> x)
			{
				//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)
				if ((Object)(object)x.Source.sender != (Object)null)
				{
					SelectorArgumentValue selector = LethalArguments.GetSelector<ServerCommandSource>(x, "targets");
					IEnumerable<NetworkBehaviour> entitys = ((SelectorArgumentValue)(ref selector)).GetEntitys(x.Source);
					int num = 0;
					foreach (NetworkBehaviour item in entitys)
					{
						if (!(item is PlayerControllerB))
						{
							try
							{
								DestroyEntity(item);
								num++;
							}
							catch (Exception data)
							{
								Debug.LogError(data);
							}
						}
					}
					x.Source.SendCommandResult($"Destroyed {BFLCUtility.GetEntityName(entitys, num)}", true);
					return num;
				}
				return 0;
			})))));
		}

		public static void DestroyEntity(NetworkBehaviour entity)
		{
			NetworkObject val = default(NetworkObject);
			if (!((Object)(object)NetworkManager.Singleton == (Object)null) && NetworkManager.Singleton.IsServer && !(entity is PlayerControllerB) && ((Component)entity).TryGetComponent<NetworkObject>(ref val))
			{
				val.Despawn(true);
			}
		}
	}
	public sealed class GameSpeedCommand : ServerCommand
	{
		public const string resultGetText = "The game speed is {0}";

		public const string resultSetText = "Set the game speed to {0}";

		private GameSpeedCommand()
		{
		}

		public override void Register()
		{
			ServerCommand.dispatcher.Register((Func<IArgumentContext<ServerCommandSource>, LiteralArgumentBuilder<ServerCommandSource>>)((IArgumentContext<ServerCommandSource> x) => ((ArgumentBuilder<ServerCommandSource, LiteralArgumentBuilder<ServerCommandSource>, LiteralCommandNode<ServerCommandSource>>)(object)((ArgumentBuilder<ServerCommandSource, LiteralArgumentBuilder<ServerCommandSource>, LiteralCommandNode<ServerCommandSource>>)(object)((ArgumentBuilder<ServerCommandSource, LiteralArgumentBuilder<ServerCommandSource>, LiteralCommandNode<ServerCommandSource>>)(object)LiteralArgumentBuilderExtensions.Literal<ServerCommandSource>(x, "gamespeed")).Requires((Predicate<ServerCommandSource>)((ServerCommandSource x) => x.isOp))).Then<LiteralCommandNode<ServerCommandSource>>((Func<IArgumentContext<ServerCommandSource>, IArgumentBuilder<ServerCommandSource, LiteralCommandNode<ServerCommandSource>>>)((IArgumentContext<ServerCommandSource> x) => (IArgumentBuilder<ServerCommandSource, LiteralCommandNode<ServerCommandSource>>)(object)((ArgumentBuilder<ServerCommandSource, LiteralArgumentBuilder<ServerCommandSource>, LiteralCommandNode<ServerCommandSource>>)(object)LiteralArgumentBuilderExtensions.Literal<ServerCommandSource>(x, "get")).Executes((Command<ServerCommandSource>)delegate(CommandContext<ServerCommandSource> x)
			{
				float gameSpeed = GetGameSpeed();
				x.Source.SendCommandResult($"The game speed is {gameSpeed}", false);
				return Mathf.RoundToInt(GetGameSpeed() * 100f);
			})))).Then<LiteralCommandNode<ServerCommandSource>>((Func<IArgumentContext<ServerCommandSource>, IArgumentBuilder<ServerCommandSource, LiteralCommandNode<ServerCommandSource>>>)((IArgumentContext<ServerCommandSource> x) => (IArgumentBuilder<ServerCommandSource, LiteralCommandNode<ServerCommandSource>>)(object)((ArgumentBuilder<ServerCommandSource, LiteralArgumentBuilder<ServerCommandSource>, LiteralCommandNode<ServerCommandSource>>)(object)LiteralArgumentBuilderExtensions.Literal<ServerCommandSource>(x, "set")).Then<ArgumentCommandNode<ServerCommandSource, float>>((Func<IArgumentContext<ServerCommandSource>, IArgumentBuilder<ServerCommandSource, ArgumentCommandNode<ServerCommandSource, float>>>)((IArgumentContext<ServerCommandSource> x) => (IArgumentBuilder<ServerCommandSource, ArgumentCommandNode<ServerCommandSource, float>>)(object)((ArgumentBuilder<ServerCommandSource, RequiredArgumentBuilder<ServerCommandSource, float>, ArgumentCommandNode<ServerCommandSource, float>>)(object)RequiredArgumentBuilderExtensions.Argument<ServerCommandSource, float>(x, "timescale", (IArgumentType<float>)(object)Arguments.Float(0f, 100f))).Executes((Command<ServerCommandSource>)delegate(CommandContext<ServerCommandSource> x)
			{
				float @float = Arguments.GetFloat<ServerCommandSource>(x, "timescale");
				SetGameSpeed(@float);
				x.Source.SendCommandResult($"Set the game speed to {@float}", true);
				return Mathf.RoundToInt(@float * 100f);
			})))))));
		}

		public static float GetGameSpeed()
		{
			if ((Object)(object)NetworkManager.Singleton == (Object)null || !NetworkManager.Singleton.IsServer)
			{
				return 0f;
			}
			return Time.timeScale;
		}

		public static void SetGameSpeed(float timeScale)
		{
			if (!((Object)(object)NetworkManager.Singleton == (Object)null) && NetworkManager.Singleton.IsServer)
			{
				InternalSetGameSpeedClientRpc(timeScale);
			}
		}

		[ClientRpc]
		private static void InternalSetGameSpeedClientRpc(float timeScale)
		{
			Time.timeScale = timeScale;
		}
	}
	[StaticNetcode]
	public sealed class InvincibilityCommand : ServerCommand
	{
		public const string resultGetText = "Value of invincibility for player {0} is {1}";

		public const string resultSetText = "Value for invincibility for player {0} set to {1}";

		private static Dictionary<PlayerControllerB, bool> invincibilityList = new Dictionary<PlayerControllerB, bool>();

		private InvincibilityCommand()
		{
		}

		public override void Register()
		{
			ServerCommand.dispatcher.Register((Func<IArgumentContext<ServerCommandSource>, LiteralArgumentBuilder<ServerCommandSource>>)((IArgumentContext<ServerCommandSource> x) => ((ArgumentBuilder<ServerCommandSource, LiteralArgumentBuilder<ServerCommandSource>, LiteralCommandNode<ServerCommandSource>>)(object)((ArgumentBuilder<ServerCommandSource, LiteralArgumentBuilder<ServerCommandSource>, LiteralCommandNode<ServerCommandSource>>)(object)((ArgumentBuilder<ServerCommandSource, LiteralArgumentBuilder<ServerCommandSource>, LiteralCommandNode<ServerCommandSource>>)(object)LiteralArgumentBuilderExtensions.Literal<ServerCommandSource>(x, "invincibility")).Requires((Predicate<ServerCommandSource>)((ServerCommandSource x) => x.isOp))).Executes((Command<ServerCommandSource>)delegate(CommandContext<ServerCommandSource> x)
			{
				NetworkBehaviour sender = x.Source.sender;
				PlayerControllerB val5 = (PlayerControllerB)(object)((sender is PlayerControllerB) ? sender : null);
				if (val5 != null)
				{
					SetInvincibility(val5, value: true);
					x.Source.SendCommandResult($"Value for invincibility for player {BFLCUtility.GetEntityName(x.Source.sender)} set to {true}", true);
					return 1;
				}
				return 0;
			})).Then<ArgumentCommandNode<ServerCommandSource, SelectorArgumentValue>>((Func<IArgumentContext<ServerCommandSource>, IArgumentBuilder<ServerCommandSource, ArgumentCommandNode<ServerCommandSource, SelectorArgumentValue>>>)((IArgumentContext<ServerCommandSource> x) => (IArgumentBuilder<ServerCommandSource, ArgumentCommandNode<ServerCommandSource, SelectorArgumentValue>>)(object)((ArgumentBuilder<ServerCommandSource, RequiredArgumentBuilder<ServerCommandSource, SelectorArgumentValue>, ArgumentCommandNode<ServerCommandSource, SelectorArgumentValue>>)(object)((ArgumentBuilder<ServerCommandSource, RequiredArgumentBuilder<ServerCommandSource, SelectorArgumentValue>, ArgumentCommandNode<ServerCommandSource, SelectorArgumentValue>>)(object)((ArgumentBuilder<ServerCommandSource, RequiredArgumentBuilder<ServerCommandSource, SelectorArgumentValue>, ArgumentCommandNode<ServerCommandSource, SelectorArgumentValue>>)(object)RequiredArgumentBuilderExtensions.Argument<ServerCommandSource, SelectorArgumentValue>(x, "target", (IArgumentType<SelectorArgumentValue>)(object)LethalArguments.Selector(true, true))).Executes((Command<ServerCommandSource>)delegate(CommandContext<ServerCommandSource> x)
			{
				//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)
				SelectorArgumentValue selector3 = LethalArguments.GetSelector<ServerCommandSource>(x, "target");
				NetworkBehaviour val3 = ((SelectorArgumentValue)(ref selector3)).GetEntitys(x.Source).First();
				PlayerControllerB val4 = (PlayerControllerB)(object)((val3 is PlayerControllerB) ? val3 : null);
				if (val4 != null)
				{
					SetInvincibility(val4, value: true);
					x.Source.SendCommandResult($"Value for invincibility for player {BFLCUtility.GetEntityName(val3)} set to {true}", true);
					return 1;
				}
				return 0;
			})).Then<LiteralCommandNode<ServerCommandSource>>((Func<IArgumentContext<ServerCommandSource>, IArgumentBuilder<ServerCommandSource, LiteralCommandNode<ServerCommandSource>>>)((IArgumentContext<ServerCommandSource> x) => (IArgumentBuilder<ServerCommandSource, LiteralCommandNode<ServerCommandSource>>)(object)((ArgumentBuilder<ServerCommandSource, LiteralArgumentBuilder<ServerCommandSource>, LiteralCommandNode<ServerCommandSource>>)(object)LiteralArgumentBuilderExtensions.Literal<ServerCommandSource>(x, "get")).Executes((Command<ServerCommandSource>)delegate(CommandContext<ServerCommandSource> x)
			{
				//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)
				CommandContext<ServerCommandSource> x2 = x;
				SelectorArgumentValue selector2 = LethalArguments.GetSelector<ServerCommandSource>(x2, "target");
				NetworkBehaviour target = ((SelectorArgumentValue)(ref selector2)).GetEntitys(x2.Source).First();
				PlayerControllerB player = default(PlayerControllerB);
				ref PlayerControllerB reference = ref player;
				NetworkBehaviour obj = target;
				reference = (PlayerControllerB)(object)((obj is PlayerControllerB) ? obj : null);
				if (player != null)
				{
					Async();
					return 1;
				}
				return 0;
				async void Async()
				{
					bool? flag = await GetInvincibility(player);
					x2.Source.SendCommandResult(string.Format("Value for invincibility for player {0} set to {1}", BFLCUtility.GetEntityName(target), flag?.ToString() ?? "timeout"), false);
				}
			})))).Then<LiteralCommandNode<ServerCommandSource>>((Func<IArgumentContext<ServerCommandSource>, IArgumentBuilder<ServerCommandSource, LiteralCommandNode<ServerCommandSource>>>)((IArgumentContext<ServerCommandSource> x) => (IArgumentBuilder<ServerCommandSource, LiteralCommandNode<ServerCommandSource>>)(object)((ArgumentBuilder<ServerCommandSource, LiteralArgumentBuilder<ServerCommandSource>, LiteralCommandNode<ServerCommandSource>>)(object)LiteralArgumentBuilderExtensions.Literal<ServerCommandSource>(x, "set")).Then<ArgumentCommandNode<ServerCommandSource, bool>>((Func<IArgumentContext<ServerCommandSource>, IArgumentBuilder<ServerCommandSource, ArgumentCommandNode<ServerCommandSource, bool>>>)((IArgumentContext<ServerCommandSource> x) => (IArgumentBuilder<ServerCommandSource, ArgumentCommandNode<ServerCommandSource, bool>>)(object)((ArgumentBuilder<ServerCommandSource, RequiredArgumentBuilder<ServerCommandSource, bool>, ArgumentCommandNode<ServerCommandSource, bool>>)(object)RequiredArgumentBuilderExtensions.Argument<ServerCommandSource, bool>(x, "value", (IArgumentType<bool>)(object)Arguments.Bool())).Executes((Command<ServerCommandSource>)delegate(CommandContext<ServerCommandSource> x)
			{
				//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)
				SelectorArgumentValue selector = LethalArguments.GetSelector<ServerCommandSource>(x, "target");
				NetworkBehaviour val = ((SelectorArgumentValue)(ref selector)).GetEntitys(x.Source).First();
				bool @bool = Arguments.GetBool<ServerCommandSource>(x, "value");
				PlayerControllerB val2 = (PlayerControllerB)(object)((val is PlayerControllerB) ? val : null);
				if (val2 != null)
				{
					SetInvincibility(val2, @bool);
					x.Source.SendCommandResult($"Value for invincibility for player {BFLCUtility.GetEntityName(val)} set to {@bool}", true);
					return 1;
				}
				return 0;
			})))))))));
		}

		public static async Task<bool?> GetInvincibility(PlayerControllerB player)
		{
			if ((Object)(object)NetworkManager.Singleton == (Object)null || !NetworkManager.Singleton.IsServer)
			{
				return false;
			}
			if (invincibilityList.ContainsKey(player))
			{
				invincibilityList.Remove(player);
			}
			InternalGetInvincibilityClientRpc(RPCParamsUtility.ToRpc(player));
			Stopwatch stopwatch = Stopwatch.StartNew();
			while (!invincibilityList.ContainsKey(player))
			{
				if (stopwatch.ElapsedMilliseconds >= 3000)
				{
					return null;
				}
				await Task.Delay(1);
			}
			bool value = invincibilityList[player];
			invincibilityList.Remove(player);
			return value;
		}

		[ClientRpc]
		private static void InternalGetInvincibilityClientRpc(ClientRpcParams rpcParams = default(ClientRpcParams))
		{
			//IL_000f: 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)
			InternalGetInvincibilityServerRpc(!StartOfRound.Instance.allowLocalPlayerDeath);
		}

		[ServerRpc]
		private static void InternalGetInvincibilityServerRpc(bool value, ServerRpcParams rpcParams = default(ServerRpcParams))
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			PlayerControllerB key = default(PlayerControllerB);
			if (RPCParamsUtility.TryGetPlayer(rpcParams, ref key))
			{
				invincibilityList[key] = value;
			}
		}

		public static void SetInvincibility(PlayerControllerB player, bool value)
		{
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			if (!((Object)(object)NetworkManager.Singleton == (Object)null) && NetworkManager.Singleton.IsServer)
			{
				InternalSetInvincibilityClientRpc(value, RPCParamsUtility.ToRpc(player));
			}
		}

		[ClientRpc]
		private static void InternalSetInvincibilityClientRpc(bool value, ClientRpcParams rpcParams = default(ClientRpcParams))
		{
			StartOfRound.Instance.allowLocalPlayerDeath = !value;
		}
	}
	public sealed class KillCommand : ServerCommand
	{
		public const string resultText = "Killed {0}";

		private KillCommand()
		{
		}

		public override void Register()
		{
			ServerCommand.dispatcher.Register((Func<IArgumentContext<ServerCommandSource>, LiteralArgumentBuilder<ServerCommandSource>>)((IArgumentContext<ServerCommandSource> x) => ((ArgumentBuilder<ServerCommandSource, LiteralArgumentBuilder<ServerCommandSource>, LiteralCommandNode<ServerCommandSource>>)(object)((ArgumentBuilder<ServerCommandSource, LiteralArgumentBuilder<ServerCommandSource>, LiteralCommandNode<ServerCommandSource>>)(object)((ArgumentBuilder<ServerCommandSource, LiteralArgumentBuilder<ServerCommandSource>, LiteralCommandNode<ServerCommandSource>>)(object)LiteralArgumentBuilderExtensions.Literal<ServerCommandSource>(x, "kill")).Requires((Predicate<ServerCommandSource>)((ServerCommandSource x) => x.isOp))).Executes((Command<ServerCommandSource>)delegate(CommandContext<ServerCommandSource> x)
			{
				if ((Object)(object)x.Source.sender != (Object)null)
				{
					KillEntity(x.Source.sender);
					x.Source.SendCommandResult($"Killed {BFLCUtility.GetEntityName(x.Source.sender)}", true);
					return 1;
				}
				return 0;
			})).Then<ArgumentCommandNode<ServerCommandSource, SelectorArgumentValue>>((Func<IArgumentContext<ServerCommandSource>, IArgumentBuilder<ServerCommandSource, ArgumentCommandNode<ServerCommandSource, SelectorArgumentValue>>>)((IArgumentContext<ServerCommandSource> x) => (IArgumentBuilder<ServerCommandSource, ArgumentCommandNode<ServerCommandSource, SelectorArgumentValue>>)(object)((ArgumentBuilder<ServerCommandSource, RequiredArgumentBuilder<ServerCommandSource, SelectorArgumentValue>, ArgumentCommandNode<ServerCommandSource, SelectorArgumentValue>>)(object)RequiredArgumentBuilderExtensions.Argument<ServerCommandSource, SelectorArgumentValue>(x, "targets", (IArgumentType<SelectorArgumentValue>)(object)LethalArguments.Selector(false, false))).Executes((Command<ServerCommandSource>)delegate(CommandContext<ServerCommandSource> x)
			{
				//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)
				SelectorArgumentValue selector = LethalArguments.GetSelector<ServerCommandSource>(x, "targets");
				IEnumerable<NetworkBehaviour> entitys = ((SelectorArgumentValue)(ref selector)).GetEntitys(x.Source);
				int num = 0;
				foreach (NetworkBehaviour item in entitys)
				{
					if ((item is PlayerControllerB || item is EnemyAI) ? true : false)
					{
						try
						{
							KillEntity(item);
							num++;
						}
						catch (Exception data)
						{
							Debug.LogError(data);
						}
					}
				}
				x.Source.SendCommandResult($"Killed {BFLCUtility.GetEntityName(entitys, num)}", true);
				return num;
			})))));
		}

		public static void KillEntity(NetworkBehaviour entity)
		{
			//IL_0034: Unknown result type (might be due to invalid IL or missing references)
			if (!((Object)(object)NetworkManager.Singleton == (Object)null) && NetworkManager.Singleton.IsServer && ((entity is PlayerControllerB || entity is EnemyAI) ? true : false))
			{
				InternalKillEntityClientRpc(NetworkBehaviourReference.op_Implicit(entity));
			}
		}

		[ClientRpc]
		private static void InternalKillEntityClientRpc(NetworkBehaviourReference entityRef)
		{
			//IL_0018: 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_002c: 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)
			NetworkBehaviour val = default(NetworkBehaviour);
			if (!((NetworkBehaviourReference)(ref entityRef)).TryGet(ref val, (NetworkManager)null))
			{
				return;
			}
			PlayerControllerB val2 = (PlayerControllerB)(object)((val is PlayerControllerB) ? val : null);
			if (val2 != null)
			{
				val2.KillPlayer(Vector3.up * 5f, true, (CauseOfDeath)0, 0, default(Vector3), false);
				return;
			}
			EnemyAI val3 = (EnemyAI)(object)((val is EnemyAI) ? val : null);
			if (val3 != null)
			{
				val3.KillEnemy(false);
			}
		}
	}
	[StaticNetcode]
	public sealed class ReviveCommand : ServerCommand
	{
		public const string resultText = "Revived {0}";

		private ReviveCommand()
		{
		}

		public override void Register()
		{
			ServerCommand.dispatcher.Register((Func<IArgumentContext<ServerCommandSource>, LiteralArgumentBuilder<ServerCommandSource>>)((IArgumentContext<ServerCommandSource> x) => ((ArgumentBuilder<ServerCommandSource, LiteralArgumentBuilder<ServerCommandSource>, LiteralCommandNode<ServerCommandSource>>)(object)((ArgumentBuilder<ServerCommandSource, LiteralArgumentBuilder<ServerCommandSource>, LiteralCommandNode<ServerCommandSource>>)(object)((ArgumentBuilder<ServerCommandSource, LiteralArgumentBuilder<ServerCommandSource>, LiteralCommandNode<ServerCommandSource>>)(object)LiteralArgumentBuilderExtensions.Literal<ServerCommandSource>(x, "revive")).Requires((Predicate<ServerCommandSource>)((ServerCommandSource x) => x.isOp))).Executes((Command<ServerCommandSource>)delegate(CommandContext<ServerCommandSource> x)
			{
				NetworkBehaviour sender = x.Source.sender;
				PlayerControllerB val2 = (PlayerControllerB)(object)((sender is PlayerControllerB) ? sender : null);
				if (val2 != null)
				{
					RevivePlayer(val2);
					x.Source.SendCommandResult($"Revived {BFLCUtility.GetEntityName(x.Source.sender)}", true);
					return 1;
				}
				return 0;
			})).Then<ArgumentCommandNode<ServerCommandSource, SelectorArgumentValue>>((Func<IArgumentContext<ServerCommandSource>, IArgumentBuilder<ServerCommandSource, ArgumentCommandNode<ServerCommandSource, SelectorArgumentValue>>>)((IArgumentContext<ServerCommandSource> x) => (IArgumentBuilder<ServerCommandSource, ArgumentCommandNode<ServerCommandSource, SelectorArgumentValue>>)(object)((ArgumentBuilder<ServerCommandSource, RequiredArgumentBuilder<ServerCommandSource, SelectorArgumentValue>, ArgumentCommandNode<ServerCommandSource, SelectorArgumentValue>>)(object)RequiredArgumentBuilderExtensions.Argument<ServerCommandSource, SelectorArgumentValue>(x, "targets", (IArgumentType<SelectorArgumentValue>)(object)LethalArguments.Selector(true, false))).Executes((Command<ServerCommandSource>)delegate(CommandContext<ServerCommandSource> x)
			{
				//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)
				SelectorArgumentValue selector = LethalArguments.GetSelector<ServerCommandSource>(x, "targets");
				IEnumerable<NetworkBehaviour> entitys = ((SelectorArgumentValue)(ref selector)).GetEntitys(x.Source);
				int num = 0;
				foreach (NetworkBehaviour item in entitys)
				{
					PlayerControllerB val = (PlayerControllerB)(object)((item is PlayerControllerB) ? item : null);
					if (val != null)
					{
						try
						{
							RevivePlayer(val);
							num++;
						}
						catch (Exception data)
						{
							Debug.LogError(data);
						}
					}
				}
				x.Source.SendCommandResult($"Revived {BFLCUtility.GetEntityName(entitys, num)}", true);
				return num;
			})))));
		}

		public static void RevivePlayer(PlayerControllerB player)
		{
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			if (!((Object)(object)NetworkManager.Singleton == (Object)null) && NetworkManager.Singleton.IsServer)
			{
				InternalRevivePlayerClientRpc(NetworkBehaviourReference.op_Implicit((NetworkBehaviour)(object)player));
			}
		}

		[ClientRpc]
		private static void InternalRevivePlayerClientRpc(NetworkBehaviourReference entityRef)
		{
			//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0186: Unknown result type (might be due to invalid IL or missing references)
			//IL_028e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0293: Unknown result type (might be due to invalid IL or missing references)
			PlayerControllerB val = default(PlayerControllerB);
			if (!((NetworkBehaviourReference)(ref entityRef)).TryGet<PlayerControllerB>(ref val, (NetworkManager)null) || !val.isPlayerDead)
			{
				return;
			}
			StartOfRound.Instance.allPlayersDead = false;
			for (int i = 0; i < StartOfRound.Instance.allPlayerScripts.Length; i++)
			{
				if ((Object)(object)val != (Object)(object)StartOfRound.Instance.allPlayerScripts[i])
				{
					continue;
				}
				Debug.Log("Reviving players A");
				val.ResetPlayerBloodObjects(val.isPlayerDead);
				if (!val.isPlayerDead && !val.isPlayerControlled)
				{
					continue;
				}
				val.isClimbingLadder = false;
				if (!val.inSpecialInteractAnimation || (Object)(object)val.currentTriggerInAnimationWith == (Object)null || !Object.op_Implicit((Object)(object)((Component)val.currentTriggerInAnimationWith).GetComponentInChildren<MoveToExitSpecialAnimation>()))
				{
					val.clampLooking = false;
					((Component)val.gameplayCamera).transform.localEulerAngles = new Vector3(((Component)val.gameplayCamera).transform.localEulerAngles.x, 0f, ((Component)val.gameplayCamera).transform.localEulerAngles.z);
					val.inVehicleAnimation = false;
				}
				val.overridePoisonValue = false;
				val.disableMoveInput = false;
				val.ResetZAndXRotation();
				((Collider)val.thisController).enabled = true;
				val.health = 100;
				val.hasBeenCriticallyInjured = false;
				val.disableLookInput = false;
				val.disableInteract = false;
				((Behaviour)val.nightVisionRadar).enabled = false;
				Debug.Log("Reviving players B");
				val.isPlayerDead = false;
				val.enemyWaitingForBodyRagdoll = null;
				val.isPlayerControlled = true;
				val.isInElevator = true;
				val.isInHangarShipRoom = true;
				val.isInsideFactory = false;
				val.parentedToElevatorLastFrame = false;
				val.overrideGameOverSpectatePivot = null;
				StartOfRound.Instance.SetPlayerObjectExtrapolate(false);
				val.TeleportPlayer(StartOfRound.Instance.GetPlayerSpawnPosition(i, false), false, 0f, false, true);
				val.setPositionOfDeadPlayer = false;
				val.DisablePlayerModel(((Component)val).gameObject, true, true);
				((Behaviour)val.helmetLight).enabled = false;
				Debug.Log("Reviving players C");
				val.Crouch(false);
				val.criticallyInjured = false;
				if ((Object)(object)val.playerBodyAnimator != (Object)null)
				{
					val.playerBodyAnimator.SetBool("Limp", false);
				}
				val.bleedingHeavily = false;
				val.activatingItem = false;
				val.twoHanded = false;
				val.inShockingMinigame = false;
				val.inSpecialInteractAnimation = false;
				val.freeRotationInInteractAnimation = false;
				val.disableSyncInAnimation = false;
				val.inAnimationWithEnemy = null;
				val.holdingWalkieTalkie = false;
				val.speakingToWalkieTalkie = false;
				Debug.Log("Reviving players D");
				val.isSinking = false;
				val.isUnderwater = false;
				val.sinkingValue = 0f;
				val.statusEffectAudio.Stop();
				val.DisableJetpackControlsLocally();
				val.health = 100;
				Debug.Log("Reviving players E");
				val.mapRadarDotAnimator.SetBool("dead", false);
				val.externalForceAutoFade = Vector3.zero;
				val.carryWeight = 1f;
				if (((NetworkBehaviour)val).IsOwner)
				{
					HUDManager.Instance.SetCracksOnVisor(100f);
					HUDManager.Instance.gasHelmetAnimator.SetBool("gasEmitting", false);
					val.hasBegunSpectating = false;
					HUDManager.Instance.RemoveSpectateUI();
					HUDManager.Instance.gameOverAnimator.SetTrigger("revive");
					val.hinderedMultiplier = 1f;
					val.isMovementHindered = 0;
					val.sourcesCausingSinking = 0;
					StartOfRound.Instance.SendChangedWeightEvent();
					Debug.Log("Reviving players E2");
					val.reverbPreset = StartOfRound.Instance.shipReverb;
				}
				Debug.Log("Reviving players F");
				HUDManager.Instance.spitOnCameraAlpha = 1f;
				SoundManager.Instance.earsRingingTimer = 0f;
				SoundManager.Instance.alternateEarsRinging = false;
				HUDManager.Instance.cadaverFilter = 0f;
				val.voiceMuffledByEnemy = false;
				SoundManager.Instance.playerVoicePitchTargets[i] = 1f;
				SoundManager.Instance.SetPlayerPitch(1f, i);
				if ((Object)(object)val.currentVoiceChatIngameSettings == (Object)null)
				{
					StartOfRound.Instance.RefreshPlayerVoicePlaybackObjects();
				}
				if ((Object)(object)val.currentVoiceChatIngameSettings != (Object)null)
				{
					if ((Object)(object)val.currentVoiceChatIngameSettings.voiceAudio == (Object)null)
					{
						val.currentVoiceChatIngameSettings.InitializeComponents();
					}
					if ((Object)(object)val.currentVoiceChatIngameSettings.voiceAudio == (Object)null)
					{
						return;
					}
					((Component)val.currentVoiceChatIngameSettings.voiceAudio).GetComponent<OccludeAudio>().overridingLowPass = false;
				}
				Debug.Log("Reviving players G");
			}
			if ((Object)(object)val == (Object)(object)GameNetworkManager.Instance.localPlayerController)
			{
				val.bleedingHeavily = false;
				val.criticallyInjured = false;
				if ((Object)(object)val.playerBodyAnimator != (Object)null)
				{
					val.playerBodyAnimator.SetBool("Limp", false);
				}
				val.health = 100;
				HUDManager.Instance.UpdateHealthUI(100, false);
				val.spectatedPlayerScript = null;
				((Behaviour)HUDManager.Instance.audioListenerLowPass).enabled = false;
				Debug.Log("Reviving players H");
				StartOfRound.Instance.SetSpectateCameraToGameOverMode(false, val);
				StartOfRound.Instance.UpdatePlayerVoiceEffects();
				StartOfRound.Instance.ResetMiscValues();
				HUDManager.Instance.HideHUD(false);
			}
			StartOfRound instance = StartOfRound.Instance;
			instance.livingPlayers++;
		}
	}
	public sealed class SummonCommand : ServerCommand
	{
		[CompilerGenerated]
		private sealed class <SummonEntityCoroutine>d__5 : IEnumerator<object>, IEnumerator, IDisposable
		{
			private int <>1__state;

			private object <>2__current;

			public EnemyAI enemyAI;

			public bool isOutside;

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

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

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

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

			private bool MoveNext()
			{
				switch (<>1__state)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					<>2__current = null;
					<>1__state = 1;
					return true;
				case 1:
					<>1__state = -1;
					enemyAI.SetEnemyOutside(isOutside);
					return false;
				}
			}

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

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

		public const string resultText = "Summoned new {0}";

		private SummonCommand()
		{
		}

		public override void Register()
		{
			ServerCommand.dispatcher.Register((Func<IArgumentContext<ServerCommandSource>, LiteralArgumentBuilder<ServerCommandSource>>)((IArgumentContext<ServerCommandSource> x) => ((ArgumentBuilder<ServerCommandSource, LiteralArgumentBuilder<ServerCommandSource>, LiteralCommandNode<ServerCommandSource>>)(object)((ArgumentBuilder<ServerCommandSource, LiteralArgumentBuilder<ServerCommandSource>, LiteralCommandNode<ServerCommandSource>>)(object)((ArgumentBuilder<ServerCommandSource, LiteralArgumentBuilder<ServerCommandSource>, LiteralCommandNode<ServerCommandSource>>)(object)((ArgumentBuilder<ServerCommandSource, LiteralArgumentBuilder<ServerCommandSource>, LiteralCommandNode<ServerCommandSource>>)(object)LiteralArgumentBuilderExtensions.Literal<ServerCommandSource>(x, "summon")).Requires((Predicate<ServerCommandSource>)((ServerCommandSource x) => x.isOp))).Then<LiteralCommandNode<ServerCommandSource>>((Func<IArgumentContext<ServerCommandSource>, IArgumentBuilder<ServerCommandSource, LiteralCommandNode<ServerCommandSource>>>)((IArgumentContext<ServerCommandSource> x) => (IArgumentBuilder<ServerCommandSource, LiteralCommandNode<ServerCommandSource>>)(object)((ArgumentBuilder<ServerCommandSource, LiteralArgumentBuilder<ServerCommandSource>, LiteralCommandNode<ServerCommandSource>>)(object)LiteralArgumentBuilderExtensions.Literal<ServerCommandSource>(x, "enemy")).Then<ArgumentCommandNode<ServerCommandSource, EnemyType>>((Func<IArgumentContext<ServerCommandSource>, IArgumentBuilder<ServerCommandSource, ArgumentCommandNode<ServerCommandSource, EnemyType>>>)((IArgumentContext<ServerCommandSource> x) => (IArgumentBuilder<ServerCommandSource, ArgumentCommandNode<ServerCommandSource, EnemyType>>)(object)((ArgumentBuilder<ServerCommandSource, RequiredArgumentBuilder<ServerCommandSource, EnemyType>, ArgumentCommandNode<ServerCommandSource, EnemyType>>)(object)((ArgumentBuilder<ServerCommandSource, RequiredArgumentBuilder<ServerCommandSource, EnemyType>, ArgumentCommandNode<ServerCommandSource, EnemyType>>)(object)RequiredArgumentBuilderExtensions.Argument<ServerCommandSource, EnemyType>(x, "entity", (IArgumentType<EnemyType>)(object)LethalArguments.EnemyType())).Executes((Command<ServerCommandSource>)delegate(CommandContext<ServerCommandSource> x)
			{
				//IL_0013: Unknown result type (might be due to invalid IL or missing references)
				EnemyType enemyType2 = LethalArguments.GetEnemyType<ServerCommandSource>(x, "entity");
				SummonEntity(enemyType2, x.Source.position);
				x.Source.SendCommandResult($"Summoned new {enemyType2.enemyName}", true);
				return 1;
			})).Then<ArgumentCommandNode<ServerCommandSource, CoordinatesArgumentValue<float>[]>>((Func<IArgumentContext<ServerCommandSource>, IArgumentBuilder<ServerCommandSource, ArgumentCommandNode<ServerCommandSource, CoordinatesArgumentValue<float>[]>>>)((IArgumentContext<ServerCommandSource> x) => (IArgumentBuilder<ServerCommandSource, ArgumentCommandNode<ServerCommandSource, CoordinatesArgumentValue<float>[]>>)(object)((ArgumentBuilder<ServerCommandSource, RequiredArgumentBuilder<ServerCommandSource, CoordinatesArgumentValue<float>[]>, ArgumentCommandNode<ServerCommandSource, CoordinatesArgumentValue<float>[]>>)(object)RequiredArgumentBuilderExtensions.Argument<ServerCommandSource, CoordinatesArgumentValue<float>[]>(x, "location", (IArgumentType<CoordinatesArgumentValue<float>[]>)(object)LethalArguments.Vector3((float?)null, (float?)null, true))).Executes((Command<ServerCommandSource>)delegate(CommandContext<ServerCommandSource> x)
			{
				//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_0019: Unknown result type (might be due to invalid IL or missing references)
				EnemyType enemyType = LethalArguments.GetEnemyType<ServerCommandSource>(x, "entity");
				Vector3 vector4 = LethalArguments.GetVector3<ServerCommandSource>(x, "location");
				SummonEntity(enemyType, vector4);
				x.Source.SendCommandResult($"Summoned new {enemyType.enemyName}", true);
				return 1;
			})))))))).Then<LiteralCommandNode<ServerCommandSource>>((Func<IArgumentContext<ServerCommandSource>, IArgumentBuilder<ServerCommandSource, LiteralCommandNode<ServerCommandSource>>>)((IArgumentContext<ServerCommandSource> x) => (IArgumentBuilder<ServerCommandSource, LiteralCommandNode<ServerCommandSource>>)(object)((ArgumentBuilder<ServerCommandSource, LiteralArgumentBuilder<ServerCommandSource>, LiteralCommandNode<ServerCommandSource>>)(object)LiteralArgumentBuilderExtensions.Literal<ServerCommandSource>(x, "anomaly")).Then<ArgumentCommandNode<ServerCommandSource, AnomalyType>>((Func<IArgumentContext<ServerCommandSource>, IArgumentBuilder<ServerCommandSource, ArgumentCommandNode<ServerCommandSource, AnomalyType>>>)((IArgumentContext<ServerCommandSource> x) => (IArgumentBuilder<ServerCommandSource, ArgumentCommandNode<ServerCommandSource, AnomalyType>>)(object)((ArgumentBuilder<ServerCommandSource, RequiredArgumentBuilder<ServerCommandSource, AnomalyType>, ArgumentCommandNode<ServerCommandSource, AnomalyType>>)(object)((ArgumentBuilder<ServerCommandSource, RequiredArgumentBuilder<ServerCommandSource, AnomalyType>, ArgumentCommandNode<ServerCommandSource, AnomalyType>>)(object)RequiredArgumentBuilderExtensions.Argument<ServerCommandSource, AnomalyType>(x, "entity", (IArgumentType<AnomalyType>)(object)LethalArguments.AnomalyType())).Executes((Command<ServerCommandSource>)delegate(CommandContext<ServerCommandSource> x)
			{
				//IL_0013: Unknown result type (might be due to invalid IL or missing references)
				AnomalyType anomalyType2 = LethalArguments.GetAnomalyType<ServerCommandSource>(x, "entity");
				SummonEntity(anomalyType2, x.Source.position);
				x.Source.SendCommandResult($"Summoned new {anomalyType2.anomalyName}", true);
				return 1;
			})).Then<ArgumentCommandNode<ServerCommandSource, CoordinatesArgumentValue<float>[]>>((Func<IArgumentContext<ServerCommandSource>, IArgumentBuilder<ServerCommandSource, ArgumentCommandNode<ServerCommandSource, CoordinatesArgumentValue<float>[]>>>)((IArgumentContext<ServerCommandSource> x) => (IArgumentBuilder<ServerCommandSource, ArgumentCommandNode<ServerCommandSource, CoordinatesArgumentValue<float>[]>>)(object)((ArgumentBuilder<ServerCommandSource, RequiredArgumentBuilder<ServerCommandSource, CoordinatesArgumentValue<float>[]>, ArgumentCommandNode<ServerCommandSource, CoordinatesArgumentValue<float>[]>>)(object)RequiredArgumentBuilderExtensions.Argument<ServerCommandSource, CoordinatesArgumentValue<float>[]>(x, "location", (IArgumentType<CoordinatesArgumentValue<float>[]>)(object)LethalArguments.Vector3((float?)null, (float?)null, true))).Executes((Command<ServerCommandSource>)delegate(CommandContext<ServerCommandSource> x)
			{
				//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_0019: Unknown result type (might be due to invalid IL or missing references)
				AnomalyType anomalyType = LethalArguments.GetAnomalyType<ServerCommandSource>(x, "entity");
				Vector3 vector3 = LethalArguments.GetVector3<ServerCommandSource>(x, "location");
				SummonEntity(anomalyType, vector3);
				x.Source.SendCommandResult($"Summoned new {anomalyType.anomalyName}", true);
				return 1;
			})))))))).Then<LiteralCommandNode<ServerCommandSource>>((Func<IArgumentContext<ServerCommandSource>, IArgumentBuilder<ServerCommandSource, LiteralCommandNode<ServerCommandSource>>>)((IArgumentContext<ServerCommandSource> x) => (IArgumentBuilder<ServerCommandSource, LiteralCommandNode<ServerCommandSource>>)(object)((ArgumentBuilder<ServerCommandSource, LiteralArgumentBuilder<ServerCommandSource>, LiteralCommandNode<ServerCommandSource>>)(object)LiteralArgumentBuilderExtensions.Literal<ServerCommandSource>(x, "item")).Then<ArgumentCommandNode<ServerCommandSource, Item>>((Func<IArgumentContext<ServerCommandSource>, IArgumentBuilder<ServerCommandSource, ArgumentCommandNode<ServerCommandSource, Item>>>)((IArgumentContext<ServerCommandSource> x) => (IArgumentBuilder<ServerCommandSource, ArgumentCommandNode<ServerCommandSource, Item>>)(object)((ArgumentBuilder<ServerCommandSource, RequiredArgumentBuilder<ServerCommandSource, Item>, ArgumentCommandNode<ServerCommandSource, Item>>)(object)((ArgumentBuilder<ServerCommandSource, RequiredArgumentBuilder<ServerCommandSource, Item>, ArgumentCommandNode<ServerCommandSource, Item>>)(object)((ArgumentBuilder<ServerCommandSource, RequiredArgumentBuilder<ServerCommandSource, Item>, ArgumentCommandNode<ServerCommandSource, Item>>)(object)RequiredArgumentBuilderExtensions.Argument<ServerCommandSource, Item>(x, "item", (IArgumentType<Item>)(object)LethalArguments.ItemType())).Executes((Command<ServerCommandSource>)delegate(CommandContext<ServerCommandSource> x)
			{
				//IL_0013: Unknown result type (might be due to invalid IL or missing references)
				Item itemType4 = LethalArguments.GetItemType<ServerCommandSource>(x, "item");
				SummonEntity(itemType4, x.Source.position);
				x.Source.SendCommandResult($"Summoned new {itemType4.itemName}", true);
				return 1;
			})).Then<ArgumentCommandNode<ServerCommandSource, int>>((IArgumentBuilder<ServerCommandSource, ArgumentCommandNode<ServerCommandSource, int>>)(object)((ArgumentBuilder<ServerCommandSource, RequiredArgumentBuilder<ServerCommandSource, int>, ArgumentCommandNode<ServerCommandSource, int>>)(object)RequiredArgumentBuilderExtensions.Argument<ServerCommandSource, int>(x, "price", (IArgumentType<int>)(object)Arguments.Integer(int.MinValue, int.MaxValue))).Executes((Command<ServerCommandSource>)delegate(CommandContext<ServerCommandSource> x)
			{
				//IL_001f: Unknown result type (might be due to invalid IL or missing references)
				Item itemType3 = LethalArguments.GetItemType<ServerCommandSource>(x, "item");
				int integer2 = Arguments.GetInteger<ServerCommandSource>(x, "price");
				SummonEntity(itemType3, x.Source.position, integer2);
				x.Source.SendCommandResult($"Summoned new {itemType3.itemName}", true);
				return 1;
			}))).Then<ArgumentCommandNode<ServerCommandSource, CoordinatesArgumentValue<float>[]>>((Func<IArgumentContext<ServerCommandSource>, IArgumentBuilder<ServerCommandSource, ArgumentCommandNode<ServerCommandSource, CoordinatesArgumentValue<float>[]>>>)((IArgumentContext<ServerCommandSource> x) => (IArgumentBuilder<ServerCommandSource, ArgumentCommandNode<ServerCommandSource, CoordinatesArgumentValue<float>[]>>)(object)((ArgumentBuilder<ServerCommandSource, RequiredArgumentBuilder<ServerCommandSource, CoordinatesArgumentValue<float>[]>, ArgumentCommandNode<ServerCommandSource, CoordinatesArgumentValue<float>[]>>)(object)((ArgumentBuilder<ServerCommandSource, RequiredArgumentBuilder<ServerCommandSource, CoordinatesArgumentValue<float>[]>, ArgumentCommandNode<ServerCommandSource, CoordinatesArgumentValue<float>[]>>)(object)RequiredArgumentBuilderExtensions.Argument<ServerCommandSource, CoordinatesArgumentValue<float>[]>(x, "location", (IArgumentType<CoordinatesArgumentValue<float>[]>)(object)LethalArguments.Vector3((float?)null, (float?)null, true))).Executes((Command<ServerCommandSource>)delegate(CommandContext<ServerCommandSource> x)
			{
				//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_0019: Unknown result type (might be due to invalid IL or missing references)
				Item itemType2 = LethalArguments.GetItemType<ServerCommandSource>(x, "item");
				Vector3 vector2 = LethalArguments.GetVector3<ServerCommandSource>(x, "location");
				SummonEntity(itemType2, vector2);
				x.Source.SendCommandResult($"Summoned new {itemType2.itemName}", true);
				return 1;
			})).Then<ArgumentCommandNode<ServerCommandSource, int>>((IArgumentBuilder<ServerCommandSource, ArgumentCommandNode<ServerCommandSource, int>>)(object)((ArgumentBuilder<ServerCommandSource, RequiredArgumentBuilder<ServerCommandSource, int>, ArgumentCommandNode<ServerCommandSource, int>>)(object)RequiredArgumentBuilderExtensions.Argument<ServerCommandSource, int>(x, "price", (IArgumentType<int>)(object)Arguments.Integer(int.MinValue, int.MaxValue))).Executes((Command<ServerCommandSource>)delegate(CommandContext<ServerCommandSource> x)
			{
				//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_0025: Unknown result type (might be due to invalid IL or missing references)
				Item itemType = LethalArguments.GetItemType<ServerCommandSource>(x, "item");
				Vector3 vector = LethalArguments.GetVector3<ServerCommandSource>(x, "location");
				int integer = Arguments.GetInteger<ServerCommandSource>(x, "price");
				SummonEntity(itemType, vector, integer);
				x.Source.SendCommandResult($"Summoned new {itemType.itemName}", true);
				return 1;
			}))))))))));
		}

		public static void SummonEntity(EnemyType entityType, Vector3 position)
		{
			//IL_001f: 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_0055: Unknown result type (might be due to invalid IL or missing references)
			//IL_007e: Unknown result type (might be due to invalid IL or missing references)
			if (!((Object)(object)NetworkManager.Singleton == (Object)null) && NetworkManager.Singleton.IsServer)
			{
				NetworkObjectReference val = RoundManager.Instance.SpawnEnemyGameObject(position, 0f, 0, entityType);
				NetworkObject val2 = default(NetworkObject);
				if (((NetworkObjectReference)(ref val)).TryGet(ref val2, (NetworkManager)null))
				{
					entityType.numberSpawned++;
					entityType.hasSpawnedAtLeastOne = true;
					bool isOutside = ((Component)val2).transform.position.y >= -100f;
					EnemyAI component = ((Component)val2).GetComponent<EnemyAI>();
					((MonoBehaviour)component).StartCoroutine(SummonEntityCoroutine(component, isOutside));
					InternalSummonEnemyClientRpc(NetworkBehaviourReference.op_Implicit((NetworkBehaviour)(object)component), isOutside);
				}
			}
		}

		[ClientRpc]
		private static void InternalSummonEnemyClientRpc(NetworkBehaviourReference entityRef, bool isOutside)
		{
			EnemyAI val = default(EnemyAI);
			if (((NetworkBehaviourReference)(ref entityRef)).TryGet<EnemyAI>(ref val, (NetworkManager)null))
			{
				((MonoBehaviour)val).StartCoroutine(SummonEntityCoroutine(val, isOutside));
			}
		}

		[IteratorStateMachine(typeof(<SummonEntityCoroutine>d__5))]
		private static IEnumerator SummonEntityCoroutine(EnemyAI enemyAI, bool isOutside)
		{
			//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
			return new <SummonEntityCoroutine>d__5(0)
			{
				enemyAI = enemyAI,
				isOutside = isOutside
			};
		}

		public static void SummonEntity(AnomalyType entityType, Vector3 position)
		{
			//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)
			if (!((Object)(object)NetworkManager.Singleton == (Object)null) && NetworkManager.Singleton.IsServer)
			{
				GameObject obj = Object.Instantiate<GameObject>(entityType.anomalyPrefab, position, Quaternion.identity);
				obj.GetComponentInChildren<NetworkObject>().Spawn(true);
				Anomaly component = obj.GetComponent<Anomaly>();
				RoundManager.Instance.SpawnedAnomalies.Add(component);
			}
		}

		public static void SummonEntity(Item entityType, Vector3 position, int price = 0)
		{
			//IL_0020: 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_003d: Unknown result type (might be due to invalid IL or missing references)
			if (!((Object)(object)NetworkManager.Singleton == (Object)null) && NetworkManager.Singleton.IsServer)
			{
				NetworkObject component = Object.Instantiate<GameObject>(entityType.spawnPrefab, position, Quaternion.Euler(entityType.restingRotation)).GetComponent<NetworkObject>();
				component.Spawn(true);
				InternalSummonItemClientRpc(NetworkObjectReference.op_Implicit(component), price);
			}
		}

		[ClientRpc]
		private static void InternalSummonItemClientRpc(NetworkObjectReference entityRef, int price)
		{
			NetworkObject val = default(NetworkObject);
			if (((NetworkObjectReference)(ref entityRef)).TryGet(ref val, (NetworkManager)null))
			{
				GrabbableObject component = ((Component)val).gameObject.GetComponent<GrabbableObject>();
				if ((Object)(object)((Component)component).GetComponentInChildren<ScanNodeProperties>() != (Object)null)
				{
					component.SetScrapValue(price);
				}
			}
		}
	}
	[StaticNetcode]
	public sealed class TeleportCommand : ServerCommand
	{
		public const string resultEntityText = "Teleported {0} to {1}";

		public const string resultLocationText = "Teleported {0} to {1}, {2}, {3}";

		private TeleportCommand()
		{
		}

		public override void Register()
		{
			LiteralCommandNode<ServerCommandSource> node = ServerCommand.dispatcher.Register((Func<IArgumentContext<ServerCommandSource>, LiteralArgumentBuilder<ServerCommandSource>>)((IArgumentContext<ServerCommandSource> x) => ((ArgumentBuilder<ServerCommandSource, LiteralArgumentBuilder<ServerCommandSource>, LiteralCommandNode<ServerCommandSource>>)(object)((ArgumentBuilder<ServerCommandSource, LiteralArgumentBuilder<ServerCommandSource>, LiteralCommandNode<ServerCommandSource>>)(object)((ArgumentBuilder<ServerCommandSource, LiteralArgumentBuilder<ServerCommandSource>, LiteralCommandNode<ServerCommandSource>>)(object)((ArgumentBuilder<ServerCommandSource, LiteralArgumentBuilder<ServerCommandSource>, LiteralCommandNode<ServerCommandSource>>)(object)LiteralArgumentBuilderExtensions.Literal<ServerCommandSource>(x, "teleport")).Requires((Predicate<ServerCommandSource>)((ServerCommandSource x) => x.isOp))).Then<ArgumentCommandNode<ServerCommandSource, CoordinatesArgumentValue<float>[]>>((Func<IArgumentContext<ServerCommandSource>, IArgumentBuilder<ServerCommandSource, ArgumentCommandNode<ServerCommandSource, CoordinatesArgumentValue<float>[]>>>)((IArgumentContext<ServerCommandSource> x) => (IArgumentBuilder<ServerCommandSource, ArgumentCommandNode<ServerCommandSource, CoordinatesArgumentValue<float>[]>>)(object)((ArgumentBuilder<ServerCommandSource, RequiredArgumentBuilder<ServerCommandSource, CoordinatesArgumentValue<float>[]>, ArgumentCommandNode<ServerCommandSource, CoordinatesArgumentValue<float>[]>>)(object)RequiredArgumentBuilderExtensions.Argument<ServerCommandSource, CoordinatesArgumentValue<float>[]>(x, "location", (IArgumentType<CoordinatesArgumentValue<float>[]>)(object)LethalArguments.Vector3((float?)null, (float?)null, true))).Executes((Command<ServerCommandSource>)delegate(CommandContext<ServerCommandSource> x)
			{
				//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_002a: 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_0064: 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)
				if ((Object)(object)x.Source.sender != (Object)null)
				{
					Vector3 vector2 = LethalArguments.GetVector3<ServerCommandSource>(x, "location");
					TeleportEntity(x.Source.sender, vector2);
					x.Source.SendCommandResult($"Teleported {BFLCUtility.GetEntityName(x.Source.sender)} to {vector2.x}, {vector2.y}, {vector2.z}", true);
					return 1;
				}
				return 0;
			})))).Then<ArgumentCommandNode<ServerCommandSource, SelectorArgumentValue>>((Func<IArgumentContext<ServerCommandSource>, IArgumentBuilder<ServerCommandSource, ArgumentCommandNode<ServerCommandSource, SelectorArgumentValue>>>)((IArgumentContext<ServerCommandSource> x) => (IArgumentBuilder<ServerCommandSource, ArgumentCommandNode<ServerCommandSource, SelectorArgumentValue>>)(object)((ArgumentBuilder<ServerCommandSource, RequiredArgumentBuilder<ServerCommandSource, SelectorArgumentValue>, ArgumentCommandNode<ServerCommandSource, SelectorArgumentValue>>)(object)RequiredArgumentBuilderExtensions.Argument<ServerCommandSource, SelectorArgumentValue>(x, "destination", (IArgumentType<SelectorArgumentValue>)(object)LethalArguments.Selector(false, true))).Executes((Command<ServerCommandSource>)delegate(CommandContext<ServerCommandSource> x)
			{
				//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_004b: Unknown result type (might be due to invalid IL or missing references)
				if ((Object)(object)x.Source.sender != (Object)null)
				{
					SelectorArgumentValue selector3 = LethalArguments.GetSelector<ServerCommandSource>(x, "destination");
					IEnumerable<NetworkBehaviour> entitys4 = ((SelectorArgumentValue)(ref selector3)).GetEntitys(x.Source);
					if (LinqExtras.CountIsOne<NetworkBehaviour>(entitys4))
					{
						TeleportEntity(x.Source.sender, ((Component)entitys4.First()).transform.position);
						x.Source.SendCommandResult($"Teleported {BFLCUtility.GetEntityName(x.Source.sender)} to {BFLCUtility.GetEntityName(entitys4, -1)}", true);
						return 1;
					}
				}
				return 0;
			})))).Then<ArgumentCommandNode<ServerCommandSource, SelectorArgumentValue>>((Func<IArgumentContext<ServerCommandSource>, IArgumentBuilder<ServerCommandSource, ArgumentCommandNode<ServerCommandSource, SelectorArgumentValue>>>)((IArgumentContext<ServerCommandSource> x) => (IArgumentBuilder<ServerCommandSource, ArgumentCommandNode<ServerCommandSource, SelectorArgumentValue>>)(object)((ArgumentBuilder<ServerCommandSource, RequiredArgumentBuilder<ServerCommandSource, SelectorArgumentValue>, ArgumentCommandNode<ServerCommandSource, SelectorArgumentValue>>)(object)((ArgumentBuilder<ServerCommandSource, RequiredArgumentBuilder<ServerCommandSource, SelectorArgumentValue>, ArgumentCommandNode<ServerCommandSource, SelectorArgumentValue>>)(object)RequiredArgumentBuilderExtensions.Argument<ServerCommandSource, SelectorArgumentValue>(x, "targets", (IArgumentType<SelectorArgumentValue>)(object)LethalArguments.Selector(false, false))).Then<ArgumentCommandNode<ServerCommandSource, CoordinatesArgumentValue<float>[]>>((Func<IArgumentContext<ServerCommandSource>, IArgumentBuilder<ServerCommandSource, ArgumentCommandNode<ServerCommandSource, CoordinatesArgumentValue<float>[]>>>)((IArgumentContext<ServerCommandSource> x) => (IArgumentBuilder<ServerCommandSource, ArgumentCommandNode<ServerCommandSource, CoordinatesArgumentValue<float>[]>>)(object)((ArgumentBuilder<ServerCommandSource, RequiredArgumentBuilder<ServerCommandSource, CoordinatesArgumentValue<float>[]>, ArgumentCommandNode<ServerCommandSource, CoordinatesArgumentValue<float>[]>>)(object)RequiredArgumentBuilderExtensions.Argument<ServerCommandSource, CoordinatesArgumentValue<float>[]>(x, "location", (IArgumentType<CoordinatesArgumentValue<float>[]>)(object)LethalArguments.Vector3((float?)null, (float?)null, true))).Executes((Command<ServerCommandSource>)delegate(CommandContext<ServerCommandSource> x)
			{
				//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_0020: 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_0039: Unknown result type (might be due to invalid IL or missing references)
				//IL_0077: Unknown result type (might be due to invalid IL or missing references)
				//IL_0085: Unknown result type (might be due to invalid IL or missing references)
				//IL_0093: Unknown result type (might be due to invalid IL or missing references)
				SelectorArgumentValue selector2 = LethalArguments.GetSelector<ServerCommandSource>(x, "targets");
				IEnumerable<NetworkBehaviour> entitys3 = ((SelectorArgumentValue)(ref selector2)).GetEntitys(x.Source);
				Vector3 vector = LethalArguments.GetVector3<ServerCommandSource>(x, "location");
				int num2 = 0;
				foreach (NetworkBehaviour item in entitys3)
				{
					TeleportEntity(item, vector);
					num2++;
				}
				x.Source.SendCommandResult($"Teleported {BFLCUtility.GetEntityName(entitys3, num2)} to {vector.x}, {vector.y}, {vector.z}", true);
				return num2;
			})))).Then<ArgumentCommandNode<ServerCommandSource, SelectorArgumentValue>>((Func<IArgumentContext<ServerCommandSource>, IArgumentBuilder<ServerCommandSource, ArgumentCommandNode<ServerCommandSource, SelectorArgumentValue>>>)((IArgumentContext<ServerCommandSource> x) => (IArgumentBuilder<ServerCommandSource, ArgumentCommandNode<ServerCommandSource, SelectorArgumentValue>>)(object)((ArgumentBuilder<ServerCommandSource, RequiredArgumentBuilder<ServerCommandSource, SelectorArgumentValue>, ArgumentCommandNode<ServerCommandSource, SelectorArgumentValue>>)(object)RequiredArgumentBuilderExtensions.Argument<ServerCommandSource, SelectorArgumentValue>(x, "destination", (IArgumentType<SelectorArgumentValue>)(object)LethalArguments.Selector(false, true))).Executes((Command<ServerCommandSource>)delegate(CommandContext<ServerCommandSource> x)
			{
				//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_0020: 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_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)
				//IL_0061: Unknown result type (might be due to invalid IL or missing references)
				SelectorArgumentValue selector = LethalArguments.GetSelector<ServerCommandSource>(x, "targets");
				IEnumerable<NetworkBehaviour> entitys = ((SelectorArgumentValue)(ref selector)).GetEntitys(x.Source);
				selector = LethalArguments.GetSelector<ServerCommandSource>(x, "destination");
				IEnumerable<NetworkBehaviour> entitys2 = ((SelectorArgumentValue)(ref selector)).GetEntitys(x.Source);
				if (LinqExtras.CountIsOne<NetworkBehaviour>(entitys2))
				{
					Vector3 position = ((Component)entitys2.First()).transform.position;
					int num = 0;
					foreach (NetworkBehaviour item2 in entitys)
					{
						TeleportEntity(item2, position);
						num++;
					}
					x.Source.SendCommandResult($"Teleported {BFLCUtility.GetEntityName(entitys, -1)} to {BFLCUtility.GetEntityName(entitys2, -1)}", true);
					return num;
				}
				return 0;
			})))))));
			ServerCommand.dispatcher.Register((Func<IArgumentContext<ServerCommandSource>, LiteralArgumentBuilder<ServerCommandSource>>)((IArgumentContext<ServerCommandSource> x) => ((ArgumentBuilder<ServerCommandSource, LiteralArgumentBuilder<ServerCommandSource>, LiteralCommandNode<ServerCommandSource>>)(object)((ArgumentBuilder<ServerCommandSource, LiteralArgumentBuilder<ServerCommandSource>, LiteralCommandNode<ServerCommandSource>>)(object)LiteralArgumentBuilderExtensions.Literal<ServerCommandSource>(x, "tp")).Requires((Predicate<ServerCommandSource>)((ServerCommandSource x) => x.isOp))).Redirect((CommandNode<ServerCommandSource>)(object)node)));
		}

		public static void TeleportEntity(NetworkBehaviour entity, Vector3 position)
		{
			//IL_002b: 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_006c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0073: Unknown result type (might be due to invalid IL or missing references)
			//IL_0078: Unknown result type (might be due to invalid IL or missing references)
			//IL_0060: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)NetworkManager.Singleton == (Object)null || !NetworkManager.Singleton.IsServer)
			{
				return;
			}
			EnemyAI val = (EnemyAI)(object)((entity is EnemyAI) ? entity : null);
			if (val != null)
			{
				val.SetEnemyOutside(((Component)val).transform.position.y >= -100f);
				val.agent.Warp(position);
			}
			else
			{
				GrabbableObject val2 = (GrabbableObject)(object)((entity is GrabbableObject) ? entity : null);
				if (val2 != null)
				{
					val2.FallToGround(false, false, position);
				}
			}
			((Component)entity).transform.position = position;
			InternalTeleportEntityClientRpc(NetworkBehaviourReference.op_Implicit(entity), position);
		}

		[ClientRpc]
		private static void InternalTeleportEntityClientRpc(NetworkBehaviourReference entityRef, Vector3 position)
		{
			//IL_001d: 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_005e: 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)
			NetworkBehaviour val = default(NetworkBehaviour);
			if (!((NetworkBehaviourReference)(ref entityRef)).TryGet(ref val, (NetworkManager)null))
			{
				return;
			}
			EnemyAI val2 = (EnemyAI)(object)((val is EnemyAI) ? val : null);
			if (val2 != null)
			{
				val2.SetEnemyOutside(((Component)val2).transform.position.y >= -100f);
				val2.agent.Warp(position);
			}
			else
			{
				GrabbableObject val3 = (GrabbableObject)(object)((val is GrabbableObject) ? val : null);
				if (val3 != null)
				{
					val3.FallToGround(false, false, position);
				}
			}
			((Component)val).transform.position = position;
		}
	}
	public sealed class TellrawCommand : ServerCommand
	{
		private TellrawCommand()
		{
		}

		public override void Register()
		{
			ServerCommand.dispatcher.Register((Func<IArgumentContext<ServerCommandSource>, LiteralArgumentBuilder<ServerCommandSource>>)((IArgumentContext<ServerCommandSource> x) => ((ArgumentBuilder<ServerCommandSource, LiteralArgumentBuilder<ServerCommandSource>, LiteralCommandNode<ServerCommandSource>>)(object)((ArgumentBuilder<ServerCommandSource, LiteralArgumentBuilder<ServerCommandSource>, LiteralCommandNode<ServerCommandSource>>)(object)LiteralArgumentBuilderExtensions.Literal<ServerCommandSource>(x, "tellraw")).Requires((Predicate<ServerCommandSource>)((ServerCommandSource x) => x.isOp))).Then<ArgumentCommandNode<ServerCommandSource, SelectorArgumentValue>>((Func<IArgumentContext<ServerCommandSource>, IArgumentBuilder<ServerCommandSource, ArgumentCommandNode<ServerCommandSource, SelectorArgumentValue>>>)((IArgumentContext<ServerCommandSource> x) => (IArgumentBuilder<ServerCommandSource, ArgumentCommandNode<ServerCommandSource, SelectorArgumentValue>>)(object)((ArgumentBuilder<ServerCommandSource, RequiredArgumentBuilder<ServerCommandSource, SelectorArgumentValue>, ArgumentCommandNode<ServerCommandSource, SelectorArgumentValue>>)(object)RequiredArgumentBuilderExtensions.Argument<ServerCommandSource, SelectorArgumentValue>(x, "targets", (IArgumentType<SelectorArgumentValue>)(object)LethalArguments.Selector(true, false))).Then<ArgumentCommandNode<ServerCommandSource, string>>((Func<IArgumentContext<ServerCommandSource>, IArgumentBuilder<ServerCommandSource, ArgumentCommandNode<ServerCommandSource, string>>>)((IArgumentContext<ServerCommandSource> x) => (IArgumentBuilder<ServerCommandSource, ArgumentCommandNode<ServerCommandSource, string>>)(object)((ArgumentBuilder<ServerCommandSource, RequiredArgumentBuilder<ServerCommandSource, string>, ArgumentCommandNode<ServerCommandSource, string>>)(object)RequiredArgumentBuilderExtensions.Argument<ServerCommandSource, string>(x, "message", (IArgumentType<string>)(object)Arguments.GreedyString())).Executes((Command<ServerCommandSource>)delegate(CommandContext<ServerCommandSource> x)
			{
				//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)
				SelectorArgumentValue selector = LethalArguments.GetSelector<ServerCommandSource>(x, "targets");
				IEnumerable<NetworkBehaviour> entitys = ((SelectorArgumentValue)(ref selector)).GetEntitys(x.Source);
				string @string = Arguments.GetString<ServerCommandSource>(x, "message");
				int result = 0;
				foreach (NetworkBehaviour item in entitys)
				{
					PlayerControllerB val = (PlayerControllerB)(object)((item is PlayerControllerB) ? item : null);
					if (val != null)
					{
						BFLCUtility.SendChat(@string, val);
					}
				}
				return result;
			})))))));
		}
	}
	public sealed class TimeCommand : ServerCommand
	{
		public const string resultGetText = "The time is {0}:{1:00} ({2})";

		public const string resultSetText = "Set the time to {0}:{1:00} ({2})";

		public const string resultSpeedGetText = "The time speed is {0}";

		public const string resultSpeedSetText = "Set the time speed to {0}";

		private TimeCommand()
		{
		}

		public override void Register()
		{
			ServerCommand.dispatcher.Register((Func<IArgumentContext<ServerCommandSource>, LiteralArgumentBuilder<ServerCommandSource>>)((IArgumentContext<ServerCommandSource> x) => ((ArgumentBuilder<ServerCommandSource, LiteralArgumentBuilder<ServerCommandSource>, LiteralCommandNode<ServerCommandSource>>)(object)((ArgumentBuilder<ServerCommandSource, LiteralArgumentBuilder<ServerCommandSource>, LiteralCommandNode<ServerCommandSource>>)(object)((ArgumentBuilder<ServerCommandSource, LiteralArgumentBuilder<ServerCommandSource>, LiteralCommandNode<ServerCommandSource>>)(object)((ArgumentBuilder<ServerCommandSource, LiteralArgumentBuilder<ServerCommandSource>, LiteralCommandNode<ServerCommandSource>>)(object)LiteralArgumentBuilderExtensions.Literal<ServerCommandSource>(x, "time")).Requires((Predicate<ServerCommandSource>)((ServerCommandSource x) => x.isOp))).Then<LiteralCommandNode<ServerCommandSource>>((Func<IArgumentContext<ServerCommandSource>, IArgumentBuilder<ServerCommandSource, LiteralCommandNode<ServerCommandSource>>>)((IArgumentContext<ServerCommandSource> x) => (IArgumentBuilder<ServerCommandSource, LiteralCommandNode<ServerCommandSource>>)(object)((ArgumentBuilder<ServerCommandSource, LiteralArgumentBuilder<ServerCommandSource>, LiteralCommandNode<ServerCommandSource>>)(object)LiteralArgumentBuilderExtensions.Literal<ServerCommandSource>(x, "get")).Executes((Command<ServerCommandSource>)delegate(CommandContext<ServerCommandSource> x)
			{
				float timeHour = GetTimeHour();
				int num3 = Mathf.FloorToInt(timeHour);
				int num4 = (int)((timeHour - (float)num3) * 60f);
				x.Source.SendCommandResult($"The time is {num3}:{num4:00} ({timeHour})", false);
				return num3;
			})))).Then<LiteralCommandNode<ServerCommandSource>>((Func<IArgumentContext<ServerCommandSource>, IArgumentBuilder<ServerCommandSource, LiteralCommandNode<ServerCommandSource>>>)((IArgumentContext<ServerCommandSource> x) => (IArgumentBuilder<ServerCommandSource, LiteralCommandNode<ServerCommandSource>>)(object)((ArgumentBuilder<ServerCommandSource, LiteralArgumentBuilder<ServerCommandSource>, LiteralCommandNode<ServerCommandSource>>)(object)LiteralArgumentBuilderExtensions.Literal<ServerCommandSource>(x, "set")).Then<ArgumentCommandNode<ServerCommandSource, float>>((Func<IArgumentContext<ServerCommandSource>, IArgumentBuilder<ServerCommandSource, ArgumentCommandNode<ServerCommandSource, float>>>)((IArgumentContext<ServerCommandSource> x) => (IArgumentBuilder<ServerCommandSource, ArgumentCommandNode<ServerCommandSource, float>>)(object)((ArgumentBuilder<ServerCommandSource, RequiredArgumentBuilder<ServerCommandSource, float>, ArgumentCommandNode<ServerCommandSource, float>>)(object)RequiredArgumentBuilderExtensions.Argument<ServerCommandSource, float>(x, "time", (IArgumentType<float>)(object)Arguments.Float(6f, 24f))).Executes((Command<ServerCommandSource>)delegate(CommandContext<ServerCommandSource> x)
			{
				float float2 = Arguments.GetFloat<ServerCommandSource>(x, "time");
				SetTimeHour(float2);
				int num = Mathf.FloorToInt(float2);
				int num2 = (int)((float2 - (float)num) * 60f);
				x.Source.SendCommandResult($"Set the time to {num}:{num2:00} ({float2})", true);
				return num;
			})))))).Then<LiteralCommandNode<ServerCommandSource>>((Func<IArgumentContext<ServerCommandSource>, IArgumentBuilder<ServerCommandSource, LiteralCommandNode<ServerCommandSource>>>)((IArgumentContext<ServerCommandSource> x) => (IArgumentBuilder<ServerCommandSource, LiteralCommandNode<ServerCommandSource>>)(object)((ArgumentBuilder<ServerCommandSource, LiteralArgumentBuilder<ServerCommandSource>, LiteralCommandNode<ServerCommandSource>>)(object)((ArgumentBuilder<ServerCommandSource, LiteralArgumentBuilder<ServerCommandSource>, LiteralCommandNode<ServerCommandSource>>)(object)LiteralArgumentBuilderExtensions.Literal<ServerCommandSource>(x, "speed")).Executes((Command<ServerCommandSource>)delegate(CommandContext<ServerCommandSource> x)
			{
				float timeSpeed = GetTimeSpeed();
				x.Source.SendCommandResult($"The time speed is {timeSpeed}", false);
				return Mathf.FloorToInt(timeSpeed);
			})).Then<ArgumentCommandNode<ServerCommandSource, float>>((Func<IArgumentContext<ServerCommandSource>, IArgumentBuilder<ServerCommandSource, ArgumentCommandNode<ServerCommandSource, float>>>)((IArgumentContext<ServerCommandSource> x) => (IArgumentBuilder<ServerCommandSource, ArgumentCommandNode<ServerCommandSource, float>>)(object)((ArgumentBuilder<ServerCommandSource, RequiredArgumentBuilder<ServerCommandSource, float>, ArgumentCommandNode<ServerCommandSource, float>>)(object)RequiredArgumentBuilderExtensions.Argument<ServerCommandSource, float>(x, "speed", (IArgumentType<float>)(object)Arguments.Float(float.MinValue, float.MaxValue))).Executes((Command<ServerCommandSource>)delegate(CommandContext<ServerCommandSource> x)
			{
				float @float = Arguments.GetFloat<ServerCommandSource>(x, "speed");
				SetTimeSpeed(@float);
				x.Source.SendCommandResult($"Set the time speed to {@float.ToString()}", true);
				return Mathf.FloorToInt(@float);
			})))))));
		}

		public static float GetTimeHour()
		{
			if ((Object)(object)NetworkManager.Singleton == (Object)null || !NetworkManager.Singleton.IsServer)
			{
				return 0f;
			}
			TimeOfDay instance = TimeOfDay.Instance;
			SelectableLevel currentLevel = instance.currentLevel;
			return instance.globalTime * currentLevel.DaySpeedMultiplier / instance.lengthOfHours + 6f;
		}

		public static void SetTimeHour(float time)
		{
			if (!((Object)(object)NetworkManager.Singleton == (Object)null) && NetworkManager.Singleton.IsServer)
			{
				InternalSetTimeHourClientRpc(time);
			}
		}

		[ClientRpc]
		private static void InternalSetTimeHourClientRpc(float time)
		{
			TimeOfDay instance = TimeOfDay.Instance;
			SelectableLevel currentLevel = instance.currentLevel;
			float num = (instance.globalTime = (time - 6f) / currentLevel.DaySpeedMultiplier * instance.lengthOfHours);
			instance.currentDayTime = instance.CalculatePlanetTime(currentLevel);
			instance.hour = (int)(instance.currentDayTime / instance.lengthOfHours);
			instance.previousHour = instance.hour;
			instance.globalTimeAtEndOfDay = num + (instance.totalTime - instance.currentDayTime) / currentLevel.DaySpeedMultiplier;
			instance.normalizedTimeOfDay = instance.currentDayTime / instance.totalTime;
			instance.RefreshClockUI();
		}

		public static float GetTimeSpeed()
		{
			return TimeOfDay.Instance.globalTimeSpeedMultiplier;
		}

		public static void SetTimeSpeed(float speed)
		{
			if (!((Object)(object)NetworkManager.Singleton == (Object)null) && NetworkManager.Singleton.IsServer)
			{
				InternalSetTimeSpeedClientRpc(speed);
			}
		}

		[ClientRpc]
		private static void InternalSetTimeSpeedClientRpc(float speed)
		{
			TimeOfDay.Instance.globalTimeSpeedMultiplier = speed;
		}
	}
}
namespace System.Runtime.CompilerServices
{
	[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
	internal sealed class IgnoresAccessChecksToAttribute : Attribute
	{
		public IgnoresAccessChecksToAttribute(string assemblyName)
		{
		}
	}
}