mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-02-14 19:29:36 +01:00
Check if Zstd is installed
This commit is contained in:
@@ -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(
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
@@ -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<byte> into,
|
||||
ReadOnlySpan<byte> data,
|
||||
|
||||
Reference in New Issue
Block a user