Decompiled source of Coordinate Check v1.0.0

Coordinate check.dll

Decompiled 5 days ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Core.Logging.Interpolation;
using BepInEx.Logging;
using BepInEx.Unity.IL2CPP;
using Il2CppInterop.Runtime.Injection;
using Microsoft.CodeAnalysis;
using Player;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")]
[assembly: AssemblyCompany("WhereAmI")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("WhereAmI")]
[assembly: AssemblyTitle("WhereAmI")]
[assembly: AssemblyVersion("1.0.0.0")]
[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.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace WhereAmI
{
	[BepInPlugin("WhereAmI", "WhereAmI", "1.0.0")]
	public class Plugin : BasePlugin
	{
		internal static ManualLogSource L;

		public override void Load()
		{
			L = ((BasePlugin)this).Log;
			if (!ClassInjector.IsTypeRegisteredInIl2Cpp<PositionLogger>())
			{
				ClassInjector.RegisterTypeInIl2Cpp<PositionLogger>();
			}
			((BasePlugin)this).AddComponent<PositionLogger>();
			((BasePlugin)this).Log.LogInfo((object)"WhereAmI loaded. Press F8 in a level.");
		}
	}
	public class PositionLogger : MonoBehaviour
	{
		public PositionLogger(IntPtr ptr)
			: base(ptr)
		{
		}

		private void Update()
		{
			//IL_0046: 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_0077: Unknown result type (might be due to invalid IL or missing references)
			//IL_0060: Unknown result type (might be due to invalid IL or missing references)
			//IL_008e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0095: Expected O, but got Unknown
			//IL_00a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e8: Unknown result type (might be due to invalid IL or missing references)
			if (!Input.GetKeyDown((KeyCode)289))
			{
				return;
			}
			PlayerAgent localPlayerAgent = PlayerManager.GetLocalPlayerAgent();
			if ((Object)(object)localPlayerAgent == (Object)null)
			{
				Plugin.L.LogWarning((object)"[WhereAmI] Not in a level.");
				return;
			}
			Vector3 position = ((Component)localPlayerAgent).transform.position;
			float num = (((Object)(object)localPlayerAgent.FPSCamera != (Object)null) ? ((Component)localPlayerAgent.FPSCamera).transform.eulerAngles.y : ((Component)localPlayerAgent).transform.eulerAngles.y);
			ManualLogSource l = Plugin.L;
			bool flag = default(bool);
			BepInExMessageLogInterpolatedStringHandler val = new BepInExMessageLogInterpolatedStringHandler(30, 4, ref flag);
			if (flag)
			{
				((BepInExLogInterpolatedStringHandler)val).AppendLiteral("[WhereAmI] POS x=");
				((BepInExLogInterpolatedStringHandler)val).AppendFormatted<float>(position.x, "F2");
				((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" y=");
				((BepInExLogInterpolatedStringHandler)val).AppendFormatted<float>(position.y, "F2");
				((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" z=");
				((BepInExLogInterpolatedStringHandler)val).AppendFormatted<float>(position.z, "F2");
				((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" | YAW=");
				((BepInExLogInterpolatedStringHandler)val).AppendFormatted<float>(num, "F1");
			}
			l.LogMessage(val);
		}
	}
}