Decompiled source of no reset in town v1.0.0

hobo_camps/hobo_camps.dll

Decompiled 6 months ago
using System.Diagnostics;
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.Configuration;
using BepInEx.Logging;
using HarmonyLib;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("OutwardModTemplate")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("OutwardModTemplate")]
[assembly: AssemblyCopyright("Copyright ©  2021")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("c5450fe0-edcf-483f-b9ea-4b1ef9d36da7")]
[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 OutwardModTemplate;

[BepInPlugin("hobo_camps", "Hobo camps", "1.0.0")]
public class Plugin : BaseUnityPlugin
{
	[HarmonyPatch(typeof(AreaManager), "IsAreaExpired")]
	public class AreaManager_IsExpired
	{
		private static void Postfix(ref bool __result, string _areaName)
		{
			Log.LogMessage((object)("area " + _areaName));
			Area areaFromSceneName = AreaManager.Instance.GetAreaFromSceneName(_areaName);
			if (Extensions.Contains(AreaManager.TownsAndCities, areaFromSceneName.ID))
			{
				__result = false;
				Log.LogMessage((object)(_areaName + " protected =)"));
			}
		}
	}

	public const string GUID = "hobo_camps";

	public const string NAME = "Hobo camps";

	public const string VERSION = "1.0.0";

	private bool updated = false;

	internal static ManualLogSource Log;

	public static ConfigEntry<bool> ExampleConfig;

	internal void Awake()
	{
		//IL_0011: Unknown result type (might be due to invalid IL or missing references)
		Log = ((BaseUnityPlugin)this).Logger;
		new Harmony("hobo_camps").PatchAll();
	}
}