Decompiled source of IslandReset v1.0.0

IslandReset.dll

Decompiled a month 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.Core.Logging.Interpolation;
using BepInEx.Logging;
using BepInEx.Unity.IL2CPP;
using Il2CppInterop.Runtime.InteropTypes;
using Il2CppSystem.Collections.Generic;
using Microsoft.CodeAnalysis;
using UnityEngine;
using WildSkies.IslandExport;
using WildSkies.Service;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")]
[assembly: AssemblyCompany("IslandReset")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyCopyright("Nines (Natives)")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("IslandReset")]
[assembly: AssemblyTitle("IslandReset")]
[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 IslandReset
{
	[BepInPlugin("IslandReset", "IslandReset", "1.0.0")]
	public class Plugin : BasePlugin
	{
		private class IslandResetSimpleChatCommands
		{
			public static string Chests()
			{
				PlayersService val = SceneContextInstaller.ResolveObject<PlayersService>();
				if (val == null)
				{
					return "Unable to get PlayersService";
				}
				if (!val.LocalPlayer.PlayerNetwork.IsHost)
				{
					return "Only the host can reset chests.";
				}
				Enumerator<SerializableIslandObject> enumerator = val.LocalPlayer.ActiveIslandSwitcher.CurrentIslandController.SerializableIslandObjects.GetEnumerator();
				while (enumerator.MoveNext())
				{
					PersistentChest obj = ((Il2CppObjectBase)enumerator.Current).TryCast<PersistentChest>();
					if (obj != null)
					{
						((SerializableIslandObject)obj).Reset();
					}
				}
				return "Chests reset.";
			}

			public static string Puzzles()
			{
				PlayersService val = SceneContextInstaller.ResolveObject<PlayersService>();
				if (val == null)
				{
					return "Unable to get PlayersService";
				}
				if (!val.LocalPlayer.PlayerNetwork.IsHost)
				{
					return "Only the host can reset puzzles.";
				}
				Enumerator<SerializableIslandObject> enumerator = val.LocalPlayer.ActiveIslandSwitcher.CurrentIslandController.SerializableIslandObjects.GetEnumerator();
				while (enumerator.MoveNext())
				{
					SerializableIslandObject current = enumerator.Current;
					if (!Object.op_Implicit((Object)(object)((Il2CppObjectBase)current).TryCast<PersistentChest>()))
					{
						current.Reset();
					}
				}
				return "Puzzles reset.";
			}
		}

		internal static ManualLogSource Log;

		public override void Load()
		{
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Expected O, but got Unknown
			Log = ((BasePlugin)this).Log;
			ManualLogSource log = Log;
			bool flag = default(bool);
			BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(18, 1, ref flag);
			if (flag)
			{
				((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Plugin ");
				((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>("IslandReset");
				((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" is loaded!");
			}
			log.LogInfo(val);
		}
	}
	public static class MyPluginInfo
	{
		public const string PLUGIN_GUID = "IslandReset";

		public const string PLUGIN_NAME = "IslandReset";

		public const string PLUGIN_VERSION = "1.0.0";
	}
}