Decompiled source of Auto Activate v1.0.0

AutoActivate.dll

Decompiled 2 months ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Logging;
using Gameplay.Quests;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using Photon.Pun;
using VoidManager;
using VoidManager.MPModChecks;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyCompany("AutoActivate")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyDescription("When Host, it automatically activates the endless quest game mode (the only available quest rn) when entering the Hub.")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+d872e52cf8f9646a8c777f513cdeefe02e8839b9")]
[assembly: AssemblyProduct("AutoActivate")]
[assembly: AssemblyTitle("When Host, it automatically activates the endless quest game mode (the only available quest rn) when entering the Hub.")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace AutoActivate
{
	[BepInPlugin("Mest.AutoActivate", "AutoActivate", "1.0.0")]
	[BepInProcess("Void Crew.exe")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	public class BepinPlugin : BaseUnityPlugin
	{
		internal static ManualLogSource Log;

		private void Awake()
		{
			Log = ((BaseUnityPlugin)this).Logger;
			Harmony.CreateAndPatchAll(Assembly.GetExecutingAssembly(), (string)null);
			((BaseUnityPlugin)this).Logger.LogInfo((object)"Plugin Mest.AutoActivate is loaded!");
		}
	}
	public class MyPluginInfo
	{
		public const string PLUGIN_GUID = "Mest.AutoActivate";

		public const string PLUGIN_NAME = "AutoActivate";

		public const string USERS_PLUGIN_NAME = "Auto Activate";

		public const string PLUGIN_VERSION = "1.0.0";

		public const string PLUGIN_DESCRIPTION = "When Host, it automatically activates the endless quest game mode (the only available quest rn) when entering the Hub.";

		public const string PLUGIN_ORIGINAL_AUTHOR = "Mest";

		public const string PLUGIN_AUTHORS = "Mest";

		public const string PLUGIN_THUNDERSTORE_ID = "";
	}
	[HarmonyPatch(typeof(GalaxyMapUIController), "Setup")]
	internal class Patch
	{
		private static FieldInfo _endlessQuestinfo = AccessTools.Field(typeof(GalaxyMapUIController), "_endlessQuest");

		private static void Postfix(GalaxyMapUIController __instance)
		{
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Invalid comparison between Unknown and O
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			if (PhotonNetwork.IsMasterClient && (object)(EndlessQuest)_endlessQuestinfo.GetValue(__instance) != null)
			{
				HubQuestManager.Instance.SelectQuest(((Quest)(EndlessQuest)_endlessQuestinfo.GetValue(__instance)).QuestParameters);
			}
		}
	}
	public class VoidManagerPlugin : VoidPlugin
	{
		public override MultiplayerType MPType => (MultiplayerType)14;

		public override string Author => "Mest";

		public override string Description => "When Host, it automatically activates the endless quest game mode (the only available quest rn) when entering the Hub.";

		public override string ThunderstoreID => "";
	}
}