Decompiled source of FasterRocket v1.0.1

FasterRocket.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.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("FasterRocket")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("FasterRocket")]
[assembly: AssemblyCopyright("Copyright ©  2023")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("44695796-1ed8-4ca1-9737-c964acbcc81a")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace FasterRocket
{
	[BepInPlugin("zoomstv.FasterRocket", "FasterRocket", "1.0.0.0")]
	public class PluginBase : BaseUnityPlugin
	{
		private const string modGUID = "zoomstv.FasterRocket";

		private const string modName = "FasterRocket";

		private const string modVersion = "1.0.0.0";

		private readonly Harmony harmony = new Harmony("zoomstv.FasterRocket");

		private static PluginBase Instance;

		internal static ManualLogSource mls;

		private void Awake()
		{
			if ((Object)(object)Instance == (Object)null)
			{
				Instance = this;
			}
			mls = Logger.CreateLogSource("zoomstv.FasterRocket");
			mls.LogInfo((object)"FasterRocket loaded");
			harmony.PatchAll();
		}
	}
}
namespace FasterRocket.Patches
{
	[HarmonyPatch(typeof(ItemDropship))]
	internal class ItemDropshipPatch
	{
		public static ItemDropshipPatch Instance;

		private void Awake()
		{
			if (Instance == null)
			{
				Instance = this;
			}
		}

		[HarmonyPatch("Update")]
		[HarmonyPostfix]
		private static void UpdateShipTimer(ref float ___shipTimer, ref bool ___deliveringOrder, ItemDropship __instance, ref StartOfRound ___playersManager, ref Terminal ___terminalScript)
		{
			float num = 10f;
			if (((NetworkBehaviour)__instance).IsServer && !___deliveringOrder && ___terminalScript.orderedItemsFromTerminal.Count > 0 && ___playersManager.shipHasLanded && ___shipTimer > num && ___shipTimer < 40f)
			{
				___shipTimer = 41f;
			}
		}

		[HarmonyPatch("ShipLeave")]
		[HarmonyPrefix]
		private static void ResetShipTimer(ref float ___shipTimer)
		{
			___shipTimer = 0f;
		}
	}
}