Workes.SaveSystem.MessagePack 1.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package Workes.SaveSystem.MessagePack --version 1.0.0
                    
NuGet\Install-Package Workes.SaveSystem.MessagePack -Version 1.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Workes.SaveSystem.MessagePack" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Workes.SaveSystem.MessagePack" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Workes.SaveSystem.MessagePack" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Workes.SaveSystem.MessagePack --version 1.0.0
                    
#r "nuget: Workes.SaveSystem.MessagePack, 1.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Workes.SaveSystem.MessagePack@1.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Workes.SaveSystem.MessagePack&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Workes.SaveSystem.MessagePack&version=1.0.0
                    
Install as a Cake Tool

Workes.SaveSystem.MessagePack

Optional MessagePack serializer package for Workes.SaveSystem 1.0.0.

Use this package when you want Workes.SaveSystem saves written as MessagePack instead of the core JSON serializer. The core package stays MessagePack-free; this companion package is the opt-in integration.

Install

dotnet add package Workes.SaveSystem.MessagePack --version 1.0.0

Or add the package reference directly:

<PackageReference Include="Workes.SaveSystem.MessagePack" Version="1.0.0" />

This package depends on:

  • Workes.SaveSystem 1.0.0
  • MessagePack

Usage

using Workes.SaveSystem;

var manager = new SaveManager<string>(
    SaveSystemOptions.Create(
        saveRootPath: saveRoot,
        serializer: new MessagePackSaveSerializer()));

MessagePack save files use the .msgpack extension. Provider payloads and save-system metadata are both written through the serializer, so a slot can contain files such as player.msgpack and metadata.msgpack.

Save-system metadata is serialized through the same MessagePack serializer. Menu or tooling code should read it through the core ReadSaveMetadata(...), ReadBackupSlotMetadata(...), or ValidateSave(...) APIs, which expose SaveMetadataInfo rather than serializer-owned implementation metadata.

State Types And Compact Maps

Plain POCO state types work directly:

public sealed class PlayerState
{
    public string Name { get; set; } = string.Empty;
    public int Level { get; set; }
    public bool HasKey { get; set; }
}

Provider payloads use serializer-owned compact field maps automatically. The serializer writes compact integer-keyed MessagePack provider data and stores the member-name map in save-system serializer metadata.

MessagePack supports the same documented non-polymorphic state model as the core JSON serializer. Provider state can be a plain object, a root list/array, a concrete root string-key dictionary, or a root scalar/simple value. Complex objects inside root collections and dictionaries are still compact mapped automatically. Generic string-key dictionary members, including read-only dictionary shapes, do not need to implement non-generic IDictionary.

Null provider state is supported for reference-type state and Nullable<T> state. Nil/null MessagePack provider data is rejected for non-nullable value-type state instead of being converted to a default value.

Capabilities

public sealed class MessagePackSaveSerializer :
    ISaveSerializer,
    IContextualSaveSerializer,
    ISaveSerializerMetadataHandler,
    ISaveApplicationMetadataSerializer

public sealed class MessagePackSaveSchematic<T> : SaveSchematic<T>

The serializer participates in core provider metadata validation, compact field-map serialization, provider migrations, and inline application metadata.

Schema Versions

Each provider payload is wrapped with a small MessagePack schema-version header. MessagePackSaveSerializer.ExtractSchemaVersion reads that header so the save manager can compare saved payload versions with registered provider versions.

Metadata

The companion serializer supports the core SaveMetadata payload contract used by Workes.SaveSystem for save-system metadata. Metadata files are written as metadata.msgpack, including core-owned provider manifest entries used by Workes.SaveSystem 1.0.0 to distinguish legacy saves from current saves with deleted or corrupt provider files. A null provider manifest remains the legacy-save signal. Corrupt or incompatible metadata is treated as invalid by the core manager.

Provider field maps are stored in SaveMetadata.SerializerMetadata. This metadata is serializer-owned implementation data used to decode compact provider payloads and migrate older saves. It is not application/menu metadata and does not contain core provider manifests.

Application metadata registered through the core ISaveMetadataProvider<T> APIs is stored inline in SaveMetadata.ApplicationMetadata.Data as MessagePack-native data, not as a separate provider file or a provider payload envelope. It uses the same automatic compact mapping as provider payloads through the synthetic serializer metadata key __workes_application_metadata, and it supports object roots, list/array roots, string-key dictionary roots, scalar roots, and null values for nullable metadata types.

Use ForceSaveToDisk(...) only when intentionally repairing or replacing a save whose existing metadata or serializer format cannot be trusted. Normal SaveToDisk(...) preserves readable core metadata, while force-save writes fresh metadata for the main save.

Validation

Use the core ValidateSave(...) API to check MessagePack saves without restoring provider state. Corrupt MessagePack provider payloads, inline application metadata, serializer metadata, or metadata files are reported as invalid by the core manager.

Migration

Provider migration is supported through the normal core ISaveMigratable and SaveMigrationStep APIs. The MessagePack serializer automatically translates compact integer-keyed payloads into named migration nodes using the saved field map, then writes migrated payloads back with the current field map.

The compact field-map metadata is automatic and invisible to save providers. Provider migrations can use member names such as SaveMigrationStep.AddIntDefault(1, "Level", 1) or SaveMigrationStep.Rename(1, "OldName", "Name"); users do not need manual compact-key handling to make those migrations work.

Migration steps operate on the provider state root directly. Object-root states expose named fields, root lists expose array nodes, root string-key dictionaries expose object nodes keyed by dictionary key, and root scalar states can be replaced through ISaveDataNode.ReplaceWith(...).

Application metadata migrations use the same ISaveMetadataMigratable and SaveMigrationStep APIs from the core package. The MessagePack companion maps inline application metadata through migration nodes without changing provider payload files.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.1 106 8/11/2026
1.0.0 125 6/25/2026
1.0.0-preview.2 77 6/24/2026
1.0.0-preview.1 74 6/24/2026

Stable release aligned with Workes.SaveSystem 1.0.0. Preserves core provider manifest metadata and supports inline application metadata in MessagePack metadata files while keeping provider payload format and serializer-owned field-map metadata stable.