Decompiled source of Fast cypher v1.0.1

FastCypher/FastCypher.dll

Decompiled a year ago
using System;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Logging;
using CustomAppAPI;
using HarmonyLib;
using Reptile;
using Reptile.Phone;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("FastCypher")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("FastCypher")]
[assembly: AssemblyCopyright("Copyright ©  2023")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("79dc72cc-bd06-480d-a633-461d093f1e49")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
namespace FastCypher
{
	[BepInPlugin("com.Dragsun.FastCypher", "FastCypher", "1.0.0")]
	public class FastCypherPlugin : BaseUnityPlugin
	{
		private const string MyGUID = "com.Dragsun.FastCypher";

		private const string PluginName = "FastCypher";

		private const string VersionString = "1.0.0";

		private static readonly Harmony Harmony = new Harmony("com.Dragsun.FastCypher");

		public static ManualLogSource Log = new ManualLogSource("FastCypher");

		public static Player player;

		public static WorldHandler worldHandler;

		private static FastCypherPlugin _instance;

		public static FastCypherPlugin Instance => _instance;

		public string ModFolderPath => Path.GetDirectoryName(((BaseUnityPlugin)this).Info.Location);

		private void Awake()
		{
			((BaseUnityPlugin)this).Logger.LogInfo((object)"PluginName: FastCypher, VersionString: 1.0.0 is loading...");
			Harmony.PatchAll();
			((BaseUnityPlugin)this).Logger.LogInfo((object)"PluginName: FastCypher, VersionString: 1.0.0 is loaded.");
			_instance = this;
			Log = ((BaseUnityPlugin)this).Logger;
		}

		private void Update()
		{
		}

		private void ConfigSettingChanged(object sender, EventArgs e)
		{
		}
	}
	public class FastCypherApp : CustomApp
	{
		public static AppMusicPlayer FastCypher;

		public override string DisplayName => "crew swap";

		public override Texture2D Icon => CustomApp.LoadTexture(Path.Combine(FastCypherPlugin.Instance.ModFolderPath, "myAppIcon.png"));

		public override void OnAppEnable()
		{
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: Expected O, but got Unknown
			//IL_004a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: Expected O, but got Unknown
			((App)this).MyPhone.CloseCurrentApp();
			((App)this).MyPhone.TurnOff(false);
			FastCypherPlugin.Log.LogInfo((object)"If you see this... Hi :)");
			CharacterSelectSpot val = Object.FindObjectOfType<CharacterSelectSpot>(false);
			if ((Object)val == (Object)null)
			{
				val = Object.FindObjectOfType<CharacterSelectSpot>(true);
				if ((Object)val == (Object)null)
				{
					FastCypherPlugin.Log.LogWarning((object)"no cyphers found.");
					return;
				}
			}
			FastCypherPlugin.worldHandler.CreateCharacterSelect(FastCypherPlugin.player, val);
		}
	}
}
namespace FastCypher.Patches
{
	[HarmonyPatch(typeof(WorldHandler))]
	internal class WorldHandlerPatches
	{
		[HarmonyPatch("Awake")]
		[HarmonyPostfix]
		public static void Awake_Postfix(WorldHandler __instance)
		{
			if ((Object)(object)FastCypherPlugin.worldHandler == (Object)null)
			{
				FastCypherPlugin.worldHandler = __instance;
			}
		}
	}
	[HarmonyPatch(typeof(Player))]
	internal class PlayerPatches
	{
		[HarmonyPatch("Awake")]
		[HarmonyPostfix]
		public static void Awake_Postfix(Player __instance)
		{
			if ((Object)(object)FastCypherPlugin.player == (Object)null)
			{
				FastCypherPlugin.player = __instance;
			}
		}
	}
}
namespace FastCypher.MonoBehaviours
{
	internal class FastCypherComponent : MonoBehaviour
	{
		public void Awake()
		{
		}

		public void Start()
		{
		}

		public void Update()
		{
		}

		public void LateUpdate()
		{
		}
	}
}