BeyondImmersion.Bannou.AssetLoader.Client 2.0.0

There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package BeyondImmersion.Bannou.AssetLoader.Client --version 2.0.0
                    
NuGet\Install-Package BeyondImmersion.Bannou.AssetLoader.Client -Version 2.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="BeyondImmersion.Bannou.AssetLoader.Client" Version="2.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="BeyondImmersion.Bannou.AssetLoader.Client" Version="2.0.0" />
                    
Directory.Packages.props
<PackageReference Include="BeyondImmersion.Bannou.AssetLoader.Client" />
                    
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 BeyondImmersion.Bannou.AssetLoader.Client --version 2.0.0
                    
#r "nuget: BeyondImmersion.Bannou.AssetLoader.Client, 2.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 BeyondImmersion.Bannou.AssetLoader.Client@2.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=BeyondImmersion.Bannou.AssetLoader.Client&version=2.0.0
                    
Install as a Cake Addin
#tool nuget:?package=BeyondImmersion.Bannou.AssetLoader.Client&version=2.0.0
                    
Install as a Cake Tool

Bannou Asset Loader Client

WebSocket-based asset loading SDK for game clients connecting to Bannou.

Overview

This package provides the consumer-side SDK for loading assets from Bannou:

  • AssetManager - High-level facade for game client integration
  • BannouWebSocketAssetSource - Low-level IAssetSource for custom configurations

Installation

dotnet add package BeyondImmersion.Bannou.AssetLoader.Client

Quick Start

The AssetManager is the recommended entry point for game clients:

using BeyondImmersion.Bannou.AssetLoader.Client;

// Connect and configure
await using var manager = await AssetManager.ConnectAsync(
    "wss://bannou.example.com/connect",
    "player@example.com",
    "password",
    new AssetManagerOptions
    {
        CacheDirectory = "./asset-cache",
        Realm = Realm.Arcadia
    });

// Load assets (downloads bundles as needed)
var result = await manager.LoadAssetsAsync(new[]
{
    "synty/character/knight_male",
    "synty/props/barrel_01"
});

// Check availability
Console.WriteLine($"Loaded: {result.AvailableCount}/{result.RequestedAssetIds.Count}");

// Get raw asset bytes
byte[]? data = await manager.GetAssetBytesAsync("synty/character/knight_male");

AssetManager API

Connection Methods

// Email/password authentication
var manager = await AssetManager.ConnectAsync(serverUrl, email, password, options);

// Service token authentication
var manager = await AssetManager.ConnectWithTokenAsync(serverUrl, token, options);

// Use existing BannouClient connection
var manager = AssetManager.FromClient(existingClient, options);

Configuration Options

var options = new AssetManagerOptions
{
    CacheDirectory = "./asset-cache",     // Disk cache location
    Realm = Realm.Arcadia,                // Default realm for resolution
    MaxConcurrentDownloads = 4,           // Parallel download limit
    ValidateBundles = true,               // SHA256 integrity checks
    PreferCache = true,                   // Offline-first behavior
    MaxCacheSizeBytes = 1024L * 1024 * 1024, // 1GB max cache
    EnableCache = true                    // Enable disk caching
};

Loading Assets

// Load multiple assets with progress reporting
var progress = new Progress<AssetLoadProgress>(p =>
{
    Console.WriteLine($"Phase: {p.Phase}, Progress: {p.Progress:P0}");
});

var result = await manager.LoadAssetsAsync(assetIds, progress);

// Check results
if (result.AllAvailable)
{
    Console.WriteLine($"Loaded {result.DownloadedBundleIds.Count} bundles");
}
else
{
    Console.WriteLine($"Missing: {string.Join(", ", result.UnresolvedAssetIds)}");
}

Type Loaders (Engine Integration)

Register type loaders for engine-specific deserialization:

// Register a Stride model loader
manager.RegisterTypeLoader(new StrideModelLoader());

// Load typed asset
var result = await manager.GetAssetAsync<Model>("synty/character/knight_male");
if (result.Success)
{
    var model = result.Asset;
    // Use the model
}

Memory Management

// Unload specific bundle
manager.UnloadBundle("synty-characters-v1");

// Unload all bundles
manager.UnloadAllBundles();

// Clear disk cache
await manager.ClearCacheAsync();

// Get cache statistics
var stats = manager.CacheStats;
Console.WriteLine($"Cache: {stats.BundleCount} bundles, {stats.TotalBytes / 1024 / 1024}MB");

Querying State

// Check if asset/bundle is loaded
bool hasAsset = manager.HasAsset("synty/character/knight_male");
bool hasBundle = manager.HasBundle("synty-characters-v1");

// Get counts
Console.WriteLine($"Bundles: {manager.LoadedBundleCount}, Assets: {manager.LoadedAssetCount}");

// Check connection
if (!manager.IsConnected)
{
    // Handle disconnection
}

Low-Level Usage

For custom configurations, use BannouWebSocketAssetSource directly:

using BeyondImmersion.Bannou.AssetLoader;
using BeyondImmersion.Bannou.AssetLoader.Client;
using BeyondImmersion.Bannou.AssetLoader.Cache;

// Connect and create asset source
var source = await BannouWebSocketAssetSource.ConnectAsync(
    "wss://bannou.example.com/connect",
    "user@example.com",
    "password",
    defaultRealm: Realm.Arcadia);

// Create loader with custom options
var cache = new FileAssetCache("./cache", maxSizeBytes: 512 * 1024 * 1024);
var loader = new AssetLoader(source, cache, new AssetLoaderOptions
{
    MaxConcurrentDownloads = 2,
    ValidateBundles = false  // Skip validation for trusted sources
});

// Load assets
var result = await loader.EnsureAssetsAvailableAsync(assetIds);

Using Existing BannouClient

// If you already have a BannouClient for other purposes
var client = new BannouClient();
await client.ConnectAsync(serverUrl, email, password);

// Create source from existing client (doesn't take ownership)
var source = new BannouWebSocketAssetSource(client);
var loader = new AssetLoader(source);

Features

Feature Description
Server-side resolution Optimal bundle selection via /bundles/resolve
Metabundle support Automatically prefers metabundles when available
Pre-signed URLs Downloads bypass WebSocket for large files
LRU disk cache Persists across application restarts
Progress reporting Real-time download progress callbacks
Type-safe loading Generic GetAssetAsync<T>() with registered loaders
Thread-safe Concurrent bundle loading with semaphore

When to Use This vs Server SDK

Scenario SDK
Game clients Asset Loader Client (this package)
Developer tools Asset Loader Client (this package)
Game servers Asset Loader Server
Backend services Asset Loader Server or direct API

Further Reading

License

MIT

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  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. 
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
2.0.1-preview.manual... 44 1/17/2026
2.0.1-preview.11 39 1/29/2026
2.0.1-preview.10 38 1/22/2026
2.0.1-preview.9 39 1/19/2026
2.0.0 89 1/17/2026
1.0.0 86 1/16/2026
0.1.0-preview.manual... 43 1/16/2026