hack around steamworks being an override load so skipping game context unmanaged resolver
This commit is contained in:
@@ -1,5 +1,7 @@
|
|||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Runtime.CompilerServices;
|
using System.Runtime.CompilerServices;
|
||||||
|
using System.Runtime.InteropServices;
|
||||||
|
using System.Runtime.Loader;
|
||||||
using CringeBootstrap.Abstractions;
|
using CringeBootstrap.Abstractions;
|
||||||
using CringeLauncher.Utils;
|
using CringeLauncher.Utils;
|
||||||
using CringePlugins.Loader;
|
using CringePlugins.Loader;
|
||||||
@@ -7,7 +9,6 @@ using CringePlugins.Render;
|
|||||||
using CringePlugins.Splash;
|
using CringePlugins.Splash;
|
||||||
using HarmonyLib;
|
using HarmonyLib;
|
||||||
using NLog;
|
using NLog;
|
||||||
using ParallelTasks;
|
|
||||||
using Sandbox;
|
using Sandbox;
|
||||||
using Sandbox.Engine.Networking;
|
using Sandbox.Engine.Networking;
|
||||||
using Sandbox.Engine.Platform.VideoMode;
|
using Sandbox.Engine.Platform.VideoMode;
|
||||||
@@ -70,6 +71,10 @@ public class Launcher : ICorePlugin
|
|||||||
CheckUpdates(args).GetAwaiter().GetResult();
|
CheckUpdates(args).GetAwaiter().GetResult();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// hook up steam as we ship it inside base context as an override
|
||||||
|
if (AssemblyLoadContext.GetLoadContext(typeof(Launcher).Assembly) is ICoreLoadContext coreLoadContext)
|
||||||
|
NativeLibrary.SetDllImportResolver(typeof(Steamworks.Constants).Assembly, (name, _, _) => coreLoadContext.ResolveUnmanagedDll(name));
|
||||||
|
|
||||||
_harmony.PatchAll(typeof(Launcher).Assembly);
|
_harmony.PatchAll(typeof(Launcher).Assembly);
|
||||||
|
|
||||||
var splash = new Splash();
|
var splash = new Splash();
|
||||||
|
Reference in New Issue
Block a user