Class MinecraftVersionService
- Namespace
- McServerLauncher.Services
- Assembly
- McServerLauncher.dll
Gets the list of Minecraft versions from Mojang's official manifest and downloads the server.jar of the chosen version.
public class MinecraftVersionService
- Inheritance
-
MinecraftVersionService
- Inherited Members
Methods
DownloadFileAsync(string, string, IProgress<string>?, string?, CancellationToken)
Downloads a file to disk. If expectedSha1 is given (Mojang returns one for
every server.jar), the download is verified against it; a mismatch deletes the file and throws.
public Task DownloadFileAsync(string url, string destPath, IProgress<string>? log, string? expectedSha1 = null, CancellationToken ct = default)
Parameters
Returns
GetServerJarUrlAsync(MinecraftVersion, CancellationToken)
Resolves the server.jar URL for a specific version.
public Task<string> GetServerJarUrlAsync(MinecraftVersion version, CancellationToken ct = default)
Parameters
versionMinecraftVersionctCancellationToken
Returns
GetVersionDetailsAsync(MinecraftVersion, CancellationToken)
Resolves the server download and the Java version that version needs.
public Task<MinecraftVersionService.VersionDetails> GetVersionDetailsAsync(MinecraftVersion version, CancellationToken ct = default)
Parameters
versionMinecraftVersionctCancellationToken
Returns
GetVersionsAsync(CancellationToken)
Downloads the manifest and returns (latest release version, list of versions).
public Task<(string LatestRelease, List<MinecraftVersion> Versions)> GetVersionsAsync(CancellationToken ct = default)