Decompiled source of SafehouseStarterPacks v0.1.0

NGA.SafehouseStarterPacks.dll

Decompiled 7 months ago
using System;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using Microsoft.CodeAnalysis;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyCompany("NGA")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyDescription("Persistent player progression! Raid, stash loot, and deploy with seemless scene/loadout saving.")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("NGA.SafehouseStarterPacks")]
[assembly: AssemblyTitle("BepInEx Plugin Title")]
[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 BepInEx
{
	[AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)]
	[Conditional("CodeGeneration")]
	internal sealed class BepInAutoPluginAttribute : Attribute
	{
		public BepInAutoPluginAttribute(string id = null, string name = null, string version = null)
		{
		}
	}
}
namespace BepInEx.Preloader.Core.Patching
{
	[AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)]
	[Conditional("CodeGeneration")]
	internal sealed class PatcherAutoPluginAttribute : Attribute
	{
		public PatcherAutoPluginAttribute(string id = null, string name = null, string version = null)
		{
		}
	}
}
namespace NGA
{
	[BepInPlugin("NGA.SafehouseStarterPacks", "SafehouseStarterPacks", "1.0.0")]
	[BepInProcess("h3vr.exe")]
	public class SafehouseStarterPacks : BaseUnityPlugin
	{
		private void Awake()
		{
			((BaseUnityPlugin)this).Logger.LogInfo((object)"Plugin Safehouse Starter Packs is loaded!");
			string text = "\\My Games\\H3VR\\Vault\\SceneConfigs\\gp_hangar";
			string text2 = Paths.PluginPath + "\\NGA-SafehouseStarterPacks";
			string text3 = Environment.GetFolderPath(Environment.SpecialFolder.Personal) + text;
			((BaseUnityPlugin)this).Logger.LogInfo((object)text3);
			string[] files = Directory.GetFiles(text2, "*_gp_hangar_VFS.json");
			string[] array = files;
			foreach (string text4 in array)
			{
				string fileName = Path.GetFileName(text4);
				string text5 = text4;
				string text6 = Path.Combine(text3, fileName);
				((BaseUnityPlugin)this).Logger.LogInfo((object)(text2 + text5));
				if (Directory.Exists(text3))
				{
					File.Copy(text5, text6, overwrite: true);
					((BaseUnityPlugin)this).Logger.LogInfo((object)("Copied " + text6 + " to " + text5));
				}
				else
				{
					Directory.CreateDirectory(text3);
					((BaseUnityPlugin)this).Logger.LogInfo((object)("Created new dir " + text3));
				}
			}
			((BaseUnityPlugin)this).Logger.LogInfo((object)"All done!");
		}
	}
}