diff --git a/Robust.Client/GameController/GameController.cs b/Robust.Client/GameController/GameController.cs index 10ff71071..5a11b7832 100644 --- a/Robust.Client/GameController/GameController.cs +++ b/Robust.Client/GameController/GameController.cs @@ -110,6 +110,13 @@ namespace Robust.Client { DebugTools.AssertNotNull(_resourceManifest); + + if (!ZStd.IsSupported()) + { + _logger.Fatal("A required dll was not found. You need to install {DllName}.", "ZStd"); + return false; + } + _clyde.InitializePostWindowing(); _clydeAudio.InitializePostWindowing(); _clyde.SetWindowTitle( diff --git a/Robust.Server/BaseServer.cs b/Robust.Server/BaseServer.cs index 070945569..9bc3125d9 100644 --- a/Robust.Server/BaseServer.cs +++ b/Robust.Server/BaseServer.cs @@ -265,6 +265,12 @@ namespace Robust.Server return true; } + if (!ZStd.IsSupported()) + { + _logger.Fatal("A required dll was not found. You need to install {DllName}.", "ZStd"); + return true; + } + // Has to be done early because this guy's in charge of the main thread Synchronization Context. _taskManager.Initialize(); diff --git a/Robust.Shared/Utility/ZStd.cs b/Robust.Shared/Utility/ZStd.cs index 3030dcc0f..591eff93b 100644 --- a/Robust.Shared/Utility/ZStd.cs +++ b/Robust.Shared/Utility/ZStd.cs @@ -19,6 +19,19 @@ public static class ZStd return (int)ZSTD_COMPRESSBOUND((nuint)length); } + public static bool IsSupported() + { + try + { + Marshal.PrelinkAll(typeof(Zstd)); + return true; + } + catch (DllNotFoundException) + { + return false; + } + } + public static unsafe int Compress( Span into, ReadOnlySpan data,