Workes.SaveSystem.MessagePack 1.0.0-preview.1

This is a prerelease version of Workes.SaveSystem.MessagePack.
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-preview.1
                    
NuGet\Install-Package Workes.SaveSystem.MessagePack -Version 1.0.0-preview.1
                    
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-preview.1" />
                    
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-preview.1" />
                    
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-preview.1
                    
#r "nuget: Workes.SaveSystem.MessagePack, 1.0.0-preview.1"
                    
#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-preview.1
                    
#: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-preview.1&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Workes.SaveSystem.MessagePack&version=1.0.0-preview.1&prerelease
                    
Install as a Cake Tool

Workes.SaveSystem.MessagePack

Optional MessagePack serializer package for Workes.SaveSystem.

Use this package when you want Workes.SaveSystem saves written as MessagePack instead of the core JSON serializer. The core Workes.SaveSystem package does not depend on MessagePack; this package is the opt-in integration.

Install

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

Or add the package reference directly:

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

This package depends on:

  • Workes.SaveSystem
  • 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 without MessagePack attributes:

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. Users do not need [MessagePackObject] or [Key] attributes because this package owns the compact mapping.

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.

Public API

public sealed class MessagePackSaveSerializer : ISaveSerializer
public sealed class MessagePackSaveSerializer : IContextualSaveSerializer
public sealed class MessagePackSaveSerializer : ISaveSerializerMetadataHandler
public sealed class MessagePackSaveSchematic<T> : SaveSchematic<T>

Schema Versions

Each provider payload is wrapped with a 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, and 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.

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 or metadata files are reported as invalid/corrupt by the core manager.

Migration

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 MessagePack attributes or 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(...).

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 105 8/11/2026
1.0.0 122 6/25/2026
1.0.0-preview.2 75 6/24/2026
1.0.0-preview.1 72 6/24/2026

Preview release aligned with Workes.SaveSystem 1.0.0-preview.3. Adds automatic field-map metadata, compact root-value provider payloads, root-value migrations, and nullable provider state support.