Skip to content

Commit

Permalink
Update LocalAdmin.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
MichalPetryka authored Oct 13, 2024
1 parent 0176880 commit cc1e9a2
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions Core/LocalAdmin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -658,26 +658,25 @@ private static unsafe void VerifySystemVersion()
{
ConsoleUtil.WriteLine($"Unsupported Windows version! SCPSL servers require Windows 21H1+ (build 19043+) and your server has {windows}!", ConsoleColor.Red);
}
return;

[DllImport("ntdll", EntryPoint = "RtlGetVersion")]
static extern uint GetWindowsVersion(OSVERSIONINFO* lpVersionInformation);

[DllImport("ntdll", EntryPoint = "RtlNtStatusToDosError")]
static extern int NtStatusToErrorCode(uint status);
}
else
{
Version glibc = Version.Parse(Marshal.PtrToStringUTF8((nint) GetGlibcVersion()));

Version minimumGlibc = new(2, 35); // Ubuntu 22.04
if (glibc < minimumGlibc)
{
ConsoleUtil.WriteLine($"Unsupported Linux version! SCPSL servers require Ubuntu 22.04+ (glibc 2.35) while your distro is based on glibc {glibc}!)", ConsoleColor.Red);
}

Version glibc = Version.Parse(Marshal.PtrToStringUTF8((nint) GetGlibcVersion()));

[DllImport("libc", EntryPoint = "gnu_get_libc_version")]
static extern sbyte* GetGlibcVersion();
Version minimumGlibc = new(2, 35); // Ubuntu 22.04
if (glibc < minimumGlibc)
{
ConsoleUtil.WriteLine($"Unsupported Linux version! SCPSL servers require Ubuntu 22.04+ (glibc 2.35) while your distro is based on glibc {glibc}!)", ConsoleColor.Red);
}

[DllImport("libc", EntryPoint = "gnu_get_libc_version")]
static extern sbyte* GetGlibcVersion();
}
catch (Exception ex)
{
Expand Down

0 comments on commit cc1e9a2

Please sign in to comment.