Decompiled source of RankFix v1.0.2

RankFix.dll

Decompiled 10 months ago
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Logging;
using HarmonyLib;
using Unity.Netcode;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyTitle("RankFix")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("RankFix")]
[assembly: AssemblyCopyright("Copyright ©  2023")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("ed4b0141-4dda-408b-935b-2970c6691c98")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace RankFix;

[BepInPlugin("LCMOD.RankFix", "RankFix", "1.0.1")]
public class RankFixBase : BaseUnityPlugin
{
	[HarmonyPatch(typeof(HUDManager))]
	private class HUDManagerPatches
	{
		[HarmonyPatch("SetSavedValues")]
		[HarmonyPostfix]
		private static void HUDSetSavedValues(HUDManager __instance)
		{
			if (NetworkManager.Singleton.IsHost)
			{
				GameNetworkManager.Instance.localPlayerController.playerLevelNumber = __instance.localPlayerLevel;
			}
		}
	}

	public const string MODGUID = "LCMOD.RankFix";

	public const string MODNAME = "RankFix";

	public const string MODVERSION = "1.0.1";

	private readonly Harmony harmony = new Harmony("LCMOD.RankFix");

	public static RankFixBase Instance;

	public static ManualLogSource logger;

	private void Awake()
	{
		if ((Object)(object)Instance == (Object)null)
		{
			Instance = this;
		}
		logger = ((BaseUnityPlugin)this).Logger;
		((BaseUnityPlugin)this).Logger.LogInfo((object)"Mod LCMOD.RankFix is loaded!");
		harmony.PatchAll(typeof(HUDManagerPatches));
	}
}