Skip to main content
Version: 0.2.1

Interface IWukongSaveApi

Namespace: WukongMp.Api
Assembly: WukongMp.Api.dll

API for managing world and player saves in Wukong Multiplayer. Supports co-op style operations where each player has their own save file, and there's a shared world save file for all players.

public interface IWukongSaveApi

Methods​

DownloadPlayerSaveAsync(CancellationToken)​

Downloads the player's save file from the server. This operation is expected to return the most recent save file for the player, if any.

Task<FileInfo?> DownloadPlayerSaveAsync(CancellationToken ct = default)

Parameters​

ct CancellationToken

Cancellation token to cancel the download operation.

Returns​

Task<FileInfo?>

The content of the player's save file if the download was successful, null otherwise.

DownloadWorldSaveAsync(CancellationToken)​

Downloads the world save file from the server.

Task<FileInfo?> DownloadWorldSaveAsync(CancellationToken ct = default)

Parameters​

ct CancellationToken

Cancellation token to cancel the download operation.

Returns​

Task<FileInfo?>

The content of the world save file if the download was successful, null otherwise.

UploadPlayerSaveAsync(byte[], CancellationToken)​

Uploads the player's save file to the server. This operation always overwrites the existing save file on the server, if any. At this point, the server is expected to keep only the most recent save file for each player.

Task<bool> UploadPlayerSaveAsync(byte[] content, CancellationToken ct = default)

Parameters​

content byte[]

The content of the save file to upload.

ct CancellationToken

Cancellation token to cancel the upload operation.

Returns​

Task<bool>

true if the save was uploaded successfully, false otherwise.

UploadWorldSaveAsync(byte[], CancellationToken)​

Uploads the world save file to the server. This operation always overwrites the existing world save file on the server, if any. At this point, the server is expected to keep only the most recent world save file for all players.

Task<bool> UploadWorldSaveAsync(byte[] content, CancellationToken ct = default)

Parameters​

content byte[]

The content of the world save file to upload.

ct CancellationToken

Cancellation token to cancel the upload operation.

Returns​

Task<bool>

true if the save was uploaded successfully, false otherwise.

  • Methods
    • DownloadPlayerSaveAsync(CancellationToken)
    • DownloadWorldSaveAsync(CancellationToken)
    • UploadPlayerSaveAsync(byte[], CancellationToken)
    • UploadWorldSaveAsync(byte[], CancellationToken)