Files
se-launcher/CringeLauncher/Patches/WhitelistPatch.cs
zznty aa979e9519
All checks were successful
Build / Compute Version (push) Successful in 4s
Build / Build Nuget package (CringeBootstrap.Abstractions) (push) Successful in 2m47s
Build / Build Nuget package (CringePlugins) (push) Successful in 5m31s
Build / Build Nuget package (NuGet) (push) Successful in 6m2s
Build / Build Nuget package (SharedCringe) (push) Successful in 7m25s
Build / Build Launcher (push) Successful in 9m11s
feature: first
2024-10-28 05:21:11 +07:00

46 lines
2.2 KiB
C#

using System.Collections.Concurrent;
using System.Collections.Immutable;
using System.ComponentModel;
using System.Text.RegularExpressions;
using HarmonyLib;
using VRage.FileSystem;
using VRage.Scripting;
namespace CringeLauncher.Patches;
[HarmonyPatch(typeof(MyScriptWhitelist), MethodType.Constructor, typeof(MyScriptCompiler))]
public static class WhitelistPatch
{
private static void Prefix(MyScriptCompiler scriptCompiler)
{
var baseDir = new FileInfo(typeof(Type).Assembly.Location).DirectoryName!;
scriptCompiler.AddReferencedAssemblies(
typeof(Type).Assembly.Location,
typeof(LinkedList<>).Assembly.Location,
typeof(Regex).Assembly.Location,
typeof(Enumerable).Assembly.Location,
typeof(ConcurrentBag<>).Assembly.Location,
typeof(ImmutableArray).Assembly.Location,
typeof(PropertyChangedEventArgs).Assembly.Location,
typeof(TypeConverter).Assembly.Location,
typeof(System.Diagnostics.TraceSource).Assembly.Location,
typeof(System.Security.Policy.Evidence).Assembly.Location,
Path.Combine(baseDir, "System.Xml.ReaderWriter.dll"),
Path.Combine(MyFileSystem.ExePath, "ProtoBuf.Net.dll"),
Path.Combine(MyFileSystem.ExePath, "ProtoBuf.Net.Core.dll"),
Path.Combine(baseDir, "netstandard.dll"),
Path.Combine(baseDir, "System.Runtime.dll"),
Path.Combine(MyFileSystem.ExePath, "Sandbox.Game.dll"),
Path.Combine(MyFileSystem.ExePath, "Sandbox.Common.dll"),
Path.Combine(MyFileSystem.ExePath, "Sandbox.Graphics.dll"),
Path.Combine(MyFileSystem.ExePath, "VRage.dll"),
Path.Combine(MyFileSystem.ExePath, "VRage.Library.dll"),
Path.Combine(MyFileSystem.ExePath, "VRage.Math.dll"),
Path.Combine(MyFileSystem.ExePath, "VRage.Game.dll"),
Path.Combine(MyFileSystem.ExePath, "VRage.Render.dll"),
Path.Combine(MyFileSystem.ExePath, "VRage.Input.dll"),
Path.Combine(MyFileSystem.ExePath, "SpaceEngineers.ObjectBuilders.dll"),
Path.Combine(MyFileSystem.ExePath, "SpaceEngineers.Game.dll"));
}
}