Decompiled source of QuickTeleport v1.0.3

plugins/QuickTeleport/QuickTeleport.dll

Decompiled 2 days ago
using System;
using System.Diagnostics;
using System.Globalization;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using System.Text;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using QuickTeleport.Teleport;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: IgnoresAccessChecksTo("assembly_valheim")]
[assembly: TargetFramework(".NETFramework,Version=v4.6.2", FrameworkDisplayName = ".NET Framework 4.6.2")]
[assembly: AssemblyCompany("Egor Fadeev")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyDescription("Faster portal and dungeon teleports for Valheim: end the teleport as soon as the screen is black and the destination is loaded, or run the vanilla timing N times faster.")]
[assembly: AssemblyFileVersion("1.0.3.0")]
[assembly: AssemblyInformationalVersion("1.0.3+ed2214cf60c419be181c54afffbd45cd8069ce47")]
[assembly: AssemblyProduct("Quick Teleport")]
[assembly: AssemblyTitle("QuickTeleport")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.3.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableAttribute : Attribute
	{
		public readonly byte[] NullableFlags;

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

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

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

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace QuickTeleport
{
	public sealed class ModConfig
	{
		private readonly ConfigFile _config;

		public ConfigEntry<bool> Enabled { get; }

		public ConfigEntry<bool> IsDebug { get; }

		public ConfigEntry<TeleportMode> Mode { get; }

		public ConfigEntry<float> SpeedMultiplier { get; }

		public ConfigEntry<float> FadeDuration { get; }

		public ConfigEntry<bool> WaitForAreaLoad { get; }

		public ConfigEntry<bool> WaitForObjects { get; }

		public ConfigEntry<float> SettleTime { get; }

		public ModConfig(ConfigFile config)
		{
			//IL_008b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0095: Expected O, but got Unknown
			//IL_00c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ce: Expected O, but got Unknown
			//IL_0135: Unknown result type (might be due to invalid IL or missing references)
			//IL_013f: Expected O, but got Unknown
			_config = config;
			Enabled = config.Bind<bool>("General", "Enabled", true, "Enable this mod. Off = vanilla teleports.");
			IsDebug = config.Bind<bool>("General", "IsDebug", false, "Log the timeline of every teleport (screen black, area loaded, settled, finished).");
			Mode = config.Bind<TeleportMode>("Teleport", "Mode", TeleportMode.Auto, "Auto: no fixed waits, the teleport ends as soon as the screen is black and the destination is loaded. Multiplier: everything vanilla does (the fade, the 2 s move delay, the 8 s portal minimum, the 15 s floor timeout) divided by SpeedMultiplier.");
			SpeedMultiplier = config.Bind<float>("Teleport", "SpeedMultiplier", 4f, new ConfigDescription("Multiplier mode only. 1 = vanilla timing, 4 = four times faster.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 100f), Array.Empty<object>()));
			FadeDuration = config.Bind<float>("Teleport", "FadeDuration", 0.1f, new ConfigDescription("Seconds for the screen to fade to black before the teleport and back afterwards (vanilla: 1, default: 0.1). The player is never moved before the screen is black, so this is the shortest possible teleport. In Multiplier mode it is divided by SpeedMultiplier too.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.05f, 5f), Array.Empty<object>()));
			WaitForAreaLoad = config.Bind<bool>("Loading", "WaitForAreaLoad", true, "Wait until the destination is loaded before ending the teleport (vanilla). false: end it right after the fade, like the old QuickTeleport 'Skip Loading Area'; you may float or fall until the world appears.");
			WaitForObjects = config.Bind<bool>("Loading", "WaitForObjects", true, "Also wait for the objects of the destination (buildings, trees) to spawn, not only for the terrain (vanilla). false: like the old QuickTeleport 'Skip Loading Objects'; you may end up under a building floor. Ignored when WaitForAreaLoad is false.");
			SettleTime = config.Bind<float>("Loading", "SettleTime", 0.5f, new ConfigDescription("Portals in Auto mode with WaitForObjects only. After the destination is loaded, wait this many seconds without new objects arriving from the server before ending the teleport. Never waits past the vanilla 8 s measured from the start of the teleport. 0 disables. Dungeon entrances never wait: their interior is loaded together with the entrance.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 5f), Array.Empty<object>()));
		}

		public void Reload()
		{
			_config.Reload();
		}

		public TeleportSettings ToSettings()
		{
			return new TeleportSettings
			{
				Mode = Mode.Value,
				SpeedMultiplier = SpeedMultiplier.Value,
				FadeDuration = FadeDuration.Value,
				WaitForAreaLoad = WaitForAreaLoad.Value,
				WaitForObjects = WaitForObjects.Value,
				SettleTime = SettleTime.Value
			};
		}

		public string Describe()
		{
			CultureInfo invariantCulture = CultureInfo.InvariantCulture;
			string text = ((Mode.Value == TeleportMode.Multiplier) ? ("Multiplier x" + SpeedMultiplier.Value.ToString("0.##", invariantCulture)) : ("Auto (settle " + SettleTime.Value.ToString("0.##", invariantCulture) + " s)"));
			string text2 = ((!WaitForAreaLoad.Value) ? "no wait for area load" : ((!WaitForObjects.Value) ? "wait for terrain only" : "wait for terrain and objects"));
			return (Enabled.Value ? "enabled" : "disabled") + ", " + text + ", fade " + FadeDuration.Value.ToString("0.##", invariantCulture) + " s, " + text2;
		}
	}
	[BepInPlugin("muindor.QuickTeleport", "Quick Teleport", "1.0.3")]
	public sealed class Plugin : BaseUnityPlugin
	{
		private Harmony? _harmony;

		public static ManualLogSource Log { get; private set; }

		public static ModConfig Settings { get; private set; }

		public static bool Enabled
		{
			get
			{
				if (Settings != null)
				{
					return Settings.Enabled.Value;
				}
				return false;
			}
		}

		private void Awake()
		{
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Expected O, but got Unknown
			Log = ((BaseUnityPlugin)this).Logger;
			Settings = new ModConfig(((BaseUnityPlugin)this).Config);
			_harmony = new Harmony("muindor.QuickTeleport");
			_harmony.PatchAll(typeof(Plugin).Assembly);
			Log.LogInfo((object)("Quick Teleport 1.0.3 loaded: " + Settings.Describe()));
		}

		private void OnDestroy()
		{
			Harmony? harmony = _harmony;
			if (harmony != null)
			{
				harmony.UnpatchSelf();
			}
		}

		public static void Debug(string message)
		{
			if (Settings != null && Settings.IsDebug.Value)
			{
				Log.LogInfo((object)message);
			}
		}

		public static void PatchFailed(string patch, Exception exception)
		{
			Log.LogError((object)$"{patch} failed, falling back to vanilla behaviour: {exception}");
		}
	}
	public static class MyPluginInfo
	{
		public const string PLUGIN_GUID = "muindor.QuickTeleport";

		public const string PLUGIN_NAME = "Quick Teleport";

		public const string PLUGIN_VERSION = "1.0.3";
	}
}
namespace QuickTeleport.Teleport
{
	public enum AreaCheck
	{
		Skip,
		TerrainOnly,
		Full
	}
	public enum TeleportMode
	{
		Auto,
		Multiplier
	}
	public sealed class TeleportPolicy
	{
		public const float VanillaMoveDelay = 2f;

		public const float VanillaDistantDelay = 8f;

		public const float VanillaFloorTimeout = 15f;

		private const float Epsilon = 0.001f;

		private int? _stableCount;

		private float _stableSince;

		public bool Distant { get; }

		public TeleportMode Mode { get; }

		public float SpeedMultiplier { get; }

		public float FadeDuration { get; }

		public float SettleTime { get; }

		public AreaCheck AreaCheck { get; }

		public float VanillaMinimum
		{
			get
			{
				if (!Distant)
				{
					return 2f;
				}
				return 8f;
			}
		}

		public float MoveFallback
		{
			get
			{
				if (Mode != TeleportMode.Multiplier)
				{
					return 2f;
				}
				return 2f / SpeedMultiplier;
			}
		}

		public float Elapsed { get; private set; }

		public float VirtualTimer { get; private set; }

		public bool ScreenBlack { get; private set; }

		public float? BlackAt { get; private set; }

		public float? MovedAt { get; private set; }

		public float? AreaReadyAt { get; private set; }

		public int? ObjectCount { get; private set; }

		public float? SettledAt { get; private set; }

		public float? FinishedAt { get; private set; }

		public bool Finished => FinishedAt.HasValue;

		public TeleportPolicy(TeleportSettings settings, bool distant)
		{
			if (settings == null)
			{
				throw new ArgumentNullException("settings");
			}
			Distant = distant;
			Mode = settings.Mode;
			SpeedMultiplier = Math.Max(1f, settings.SpeedMultiplier);
			SettleTime = Math.Max(0f, settings.SettleTime);
			float num = settings.FadeDuration;
			if (Mode == TeleportMode.Multiplier)
			{
				num /= SpeedMultiplier;
			}
			FadeDuration = Math.Max(0.05f, num);
			AreaCheck = (settings.WaitForAreaLoad ? ((!settings.WaitForObjects) ? AreaCheck.TerrainOnly : AreaCheck.Full) : AreaCheck.Skip);
		}

		public float Advance(float dt, bool hudBlack = true)
		{
			Elapsed += Math.Max(0f, dt);
			if (!ScreenBlack)
			{
				ScreenBlack = Elapsed >= FadeDuration && (hudBlack || Elapsed >= MoveFallback);
				if (!ScreenBlack)
				{
					VirtualTimer = 0f;
					return 0f;
				}
				BlackAt = Elapsed;
			}
			float num;
			if (Mode == TeleportMode.Multiplier)
			{
				num = Elapsed * SpeedMultiplier;
			}
			else
			{
				num = Math.Min(Elapsed + VanillaMinimum, 15f);
				if (Elapsed > 15f)
				{
					num = Elapsed;
				}
			}
			if (AreaCheck == AreaCheck.Skip)
			{
				num = Math.Max(num, 15.001f);
			}
			if (num > 2f && !MovedAt.HasValue)
			{
				MovedAt = Elapsed;
			}
			VirtualTimer = num;
			return num;
		}

		public bool ApplySettle(bool areaReady, int objectCount)
		{
			if (!areaReady)
			{
				_stableCount = null;
				return false;
			}
			if (!AreaReadyAt.HasValue)
			{
				AreaReadyAt = Elapsed;
			}
			ObjectCount = objectCount;
			bool flag;
			if (Mode != TeleportMode.Auto || AreaCheck != AreaCheck.Full || !Distant)
			{
				flag = true;
			}
			else
			{
				if (_stableCount != objectCount)
				{
					_stableCount = objectCount;
					_stableSince = Elapsed;
				}
				flag = SettleTime <= 0f || Elapsed - _stableSince >= SettleTime || Elapsed >= VanillaMinimum;
			}
			if (flag && !SettledAt.HasValue)
			{
				SettledAt = Elapsed;
			}
			return flag;
		}

		public void MarkFinished()
		{
			if (!FinishedAt.HasValue)
			{
				FinishedAt = Elapsed;
			}
		}

		public string Describe()
		{
			StringBuilder stringBuilder = new StringBuilder();
			stringBuilder.Append(Distant ? "Portal" : "Dungeon").Append(" teleport, ").Append(Mode);
			if (Mode == TeleportMode.Multiplier)
			{
				stringBuilder.Append(" x").Append(SpeedMultiplier.ToString("0.##", CultureInfo.InvariantCulture));
			}
			stringBuilder.Append(": screen black at ").Append(Seconds(BlackAt));
			stringBuilder.Append(", moved at ").Append(Seconds(MovedAt));
			switch (AreaCheck)
			{
			case AreaCheck.Skip:
				stringBuilder.Append(", area load skipped");
				break;
			case AreaCheck.TerrainOnly:
				stringBuilder.Append(", terrain loaded at ").Append(Seconds(AreaReadyAt));
				break;
			default:
				stringBuilder.Append(", area loaded at ").Append(Seconds(AreaReadyAt));
				if (ObjectCount.HasValue)
				{
					stringBuilder.Append(" (").Append(ObjectCount.Value).Append(" objects)");
				}
				if (Mode == TeleportMode.Auto && Distant)
				{
					stringBuilder.Append(", settled at ").Append(Seconds(SettledAt));
				}
				break;
			}
			stringBuilder.Append(", finished at ").Append(Seconds(FinishedAt));
			stringBuilder.Append("; vanilla waits at least ").Append(VanillaMinimum.ToString("0", CultureInfo.InvariantCulture)).Append(" s");
			return stringBuilder.ToString();
		}

		private static string Seconds(float? time)
		{
			if (!time.HasValue)
			{
				return "never";
			}
			return time.Value.ToString("0.00", CultureInfo.InvariantCulture) + " s";
		}
	}
	public sealed class TeleportSettings
	{
		public const float MinFadeDuration = 0.05f;

		public const float DefaultFadeDuration = 0.1f;

		public TeleportMode Mode { get; set; }

		public float SpeedMultiplier { get; set; } = 4f;

		public float FadeDuration { get; set; } = 0.1f;

		public bool WaitForAreaLoad { get; set; } = true;

		public bool WaitForObjects { get; set; } = true;

		public float SettleTime { get; set; } = 0.5f;
	}
}
namespace QuickTeleport.Patches
{
	[HarmonyPatch(typeof(ZNetScene), "IsAreaReady")]
	internal static class ZNetScene_IsAreaReady_Patch
	{
		private static bool Prefix(Vector3 point, ref bool __result)
		{
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			TeleportPolicy updating = ActiveTeleport.Updating;
			if (updating == null)
			{
				return true;
			}
			try
			{
				switch (updating.AreaCheck)
				{
				case AreaCheck.Skip:
					__result = true;
					return false;
				case AreaCheck.TerrainOnly:
					__result = ZoneSystem.instance.IsZoneLoaded(point);
					return false;
				default:
					return true;
				}
			}
			catch (Exception exception)
			{
				Plugin.PatchFailed("ZNetScene_IsAreaReady_Patch", exception);
				return true;
			}
		}

		private static void Postfix(ZNetScene __instance, ref bool __result)
		{
			TeleportPolicy updating = ActiveTeleport.Updating;
			if (updating == null)
			{
				return;
			}
			try
			{
				int objectCount = ((updating.AreaCheck == AreaCheck.Full) ? __instance.m_tempCurrentObjects.Count : 0);
				__result = updating.ApplySettle(__result, objectCount);
			}
			catch (Exception exception)
			{
				Plugin.PatchFailed("ZNetScene_IsAreaReady_Patch", exception);
			}
		}
	}
	[HarmonyPatch(typeof(Hud), "GetFadeDuration")]
	internal static class Hud_GetFadeDuration_Patch
	{
		private static void Postfix(Hud __instance, Player player, ref float __result)
		{
			if (!Plugin.Enabled || (Object)(object)player == (Object)null)
			{
				return;
			}
			try
			{
				if (((Character)player).IsDead() || player.IsSleeping())
				{
					ActiveTeleport.FadingFromTeleport = false;
				}
				else if (((Character)player).IsTeleporting())
				{
					TeleportPolicy teleportPolicy = ActiveTeleport.For(player);
					if (teleportPolicy != null)
					{
						__result = teleportPolicy.FadeDuration;
					}
				}
				else if (ActiveTeleport.FadingFromTeleport)
				{
					if ((Object)(object)ActiveTeleport.FadingPlayer != (Object)(object)player)
					{
						ActiveTeleport.FadingFromTeleport = false;
					}
					else if (__instance.m_loadingScreen.alpha > 0f)
					{
						__result = ActiveTeleport.LastFade;
					}
					else
					{
						ActiveTeleport.FadingFromTeleport = false;
					}
				}
			}
			catch (Exception exception)
			{
				Plugin.PatchFailed("Hud_GetFadeDuration_Patch", exception);
			}
		}
	}
	internal static class ActiveTeleport
	{
		public static Player? Player { get; private set; }

		public static TeleportPolicy? Policy { get; private set; }

		public static TeleportPolicy? Updating { get; set; }

		public static float LastFade { get; private set; } = 1f;

		public static bool FadingFromTeleport { get; set; }

		public static Player? FadingPlayer { get; private set; }

		public static bool PositionAnnounced { get; set; }

		public static TeleportPolicy Start(Player player, bool distant, float elapsed = 0f)
		{
			TeleportPolicy teleportPolicy = new TeleportPolicy(Plugin.Settings.ToSettings(), distant);
			if (elapsed > 0f)
			{
				teleportPolicy.Advance(elapsed);
			}
			Player = player;
			Policy = teleportPolicy;
			LastFade = teleportPolicy.FadeDuration;
			FadingFromTeleport = true;
			FadingPlayer = player;
			PositionAnnounced = false;
			return teleportPolicy;
		}

		public static bool HudBlack()
		{
			Hud instance = Hud.instance;
			if (!((Object)(object)instance == (Object)null) && !((Object)(object)instance.m_loadingScreen == (Object)null))
			{
				return instance.m_loadingScreen.alpha >= 1f;
			}
			return true;
		}

		public static TeleportPolicy? For(Player player)
		{
			if (!((Object)(object)Player == (Object)(object)player))
			{
				return null;
			}
			return Policy;
		}

		public static void Clear()
		{
			Player = null;
			Policy = null;
			Updating = null;
		}
	}
	[HarmonyPatch(typeof(Player), "TeleportTo")]
	internal static class Player_TeleportTo_Patch
	{
		private static void Postfix(Player __instance, Vector3 pos, bool distantTeleport, bool __result)
		{
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			if (!__result)
			{
				return;
			}
			ActiveTeleport.Clear();
			if (!Plugin.Enabled)
			{
				return;
			}
			try
			{
				TeleportPolicy teleportPolicy = ActiveTeleport.Start(__instance, distantTeleport);
				Plugin.Debug(string.Format("{0} teleport to {1} started: {2}, fade {3:0.00} s, area check {4}", distantTeleport ? "Portal" : "Dungeon", pos, teleportPolicy.Mode, teleportPolicy.FadeDuration, teleportPolicy.AreaCheck));
			}
			catch (Exception exception)
			{
				Plugin.PatchFailed("Player_TeleportTo_Patch", exception);
			}
		}
	}
	[HarmonyPatch(typeof(Player), "UpdateTeleport")]
	internal static class Player_UpdateTeleport_Patch
	{
		private static void Prefix(Player __instance, ref float dt)
		{
			if (!Plugin.Enabled || !__instance.m_teleporting)
			{
				return;
			}
			try
			{
				TeleportPolicy teleportPolicy = ActiveTeleport.For(__instance) ?? ActiveTeleport.Start(__instance, __instance.m_distantTeleport, __instance.m_teleportTimer);
				__instance.m_teleportTimer = teleportPolicy.Advance(dt, ActiveTeleport.HudBlack());
				dt = 0f;
				ActiveTeleport.Updating = teleportPolicy;
			}
			catch (Exception exception)
			{
				Plugin.PatchFailed("Player_UpdateTeleport_Patch", exception);
			}
		}

		private static void Postfix(Player __instance)
		{
			TeleportPolicy updating = ActiveTeleport.Updating;
			ActiveTeleport.Updating = null;
			if (updating != null)
			{
				if (updating.MovedAt.HasValue && !ActiveTeleport.PositionAnnounced)
				{
					AnnouncePosition(__instance);
				}
				if (!__instance.m_teleporting)
				{
					updating.MarkFinished();
					Plugin.Debug("Teleport finished: " + updating.Describe());
					ActiveTeleport.Clear();
				}
			}
		}

		private static void AnnouncePosition(Player player)
		{
			//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_0044: 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)
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			ActiveTeleport.PositionAnnounced = true;
			try
			{
				ZNet instance = ZNet.instance;
				ZDO val = (((Object)(object)((Character)player).m_nview != (Object)null) ? ((Character)player).m_nview.GetZDO() : null);
				if (!((Object)(object)instance == (Object)null) && val != null)
				{
					Vector3 position = ((Component)player).transform.position;
					val.SetPosition(position);
					instance.SetReferencePosition(position);
					instance.m_periodicSendTimer = 2f;
					Plugin.Debug($"Reported the new position {position} to the server");
				}
			}
			catch (Exception exception)
			{
				Plugin.PatchFailed("Player_UpdateTeleport_Patch", exception);
			}
		}

		private static Exception? Finalizer(Exception? __exception)
		{
			ActiveTeleport.Updating = null;
			return __exception;
		}
	}
	[HarmonyPatch(typeof(Terminal), "InitTerminal")]
	internal static class Terminal_InitTerminal_Patch
	{
		[CompilerGenerated]
		private static class <>O
		{
			public static ConsoleEvent <0>__Execute;
		}

		private const string Command = "quickteleport";

		private static void Postfix()
		{
			//IL_002f: 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_0025: Expected O, but got Unknown
			object obj = <>O.<0>__Execute;
			if (obj == null)
			{
				ConsoleEvent val = Execute;
				<>O.<0>__Execute = val;
				obj = (object)val;
			}
			new ConsoleCommand("quickteleport", "quickteleport [reload|status] - reload the Quick Teleport config or show the active settings", (ConsoleEvent)obj, false, false, false, false, false, false, (ConsoleOptionsFetcher)null, false, false, false);
		}

		private static void Execute(ConsoleEventArgs args)
		{
			Terminal context = args.Context;
			string text = ((args.Args.Length > 1) ? args.Args[1].ToLowerInvariant() : "status");
			if (!(text == "reload"))
			{
				if (text == "status")
				{
					context.AddString("Quick Teleport 1.0.3: " + Plugin.Settings.Describe());
				}
				else
				{
					context.AddString("Usage: quickteleport [reload|status]");
				}
			}
			else
			{
				Plugin.Settings.Reload();
				context.AddString("Quick Teleport: config reloaded, " + Plugin.Settings.Describe());
			}
		}
	}
}
namespace System.Runtime.CompilerServices
{
	[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
	internal sealed class IgnoresAccessChecksToAttribute : Attribute
	{
		public IgnoresAccessChecksToAttribute(string assemblyName)
		{
		}
	}
}