Lakona.Game.Server.Hotfix.Abstractions 0.2.10

dotnet add package Lakona.Game.Server.Hotfix.Abstractions --version 0.2.10
                    
NuGet\Install-Package Lakona.Game.Server.Hotfix.Abstractions -Version 0.2.10
                    
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="Lakona.Game.Server.Hotfix.Abstractions" Version="0.2.10" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Lakona.Game.Server.Hotfix.Abstractions" Version="0.2.10" />
                    
Directory.Packages.props
<PackageReference Include="Lakona.Game.Server.Hotfix.Abstractions" />
                    
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 Lakona.Game.Server.Hotfix.Abstractions --version 0.2.10
                    
#r "nuget: Lakona.Game.Server.Hotfix.Abstractions, 0.2.10"
                    
#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 Lakona.Game.Server.Hotfix.Abstractions@0.2.10
                    
#: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=Lakona.Game.Server.Hotfix.Abstractions&version=0.2.10
                    
Install as a Cake Addin
#tool nuget:?package=Lakona.Game.Server.Hotfix.Abstractions&version=0.2.10
                    
Install as a Cake Tool

Lakona.Game.Server.Hotfix.Abstractions

Stable attributes, lifecycle calls, and result DTOs for Lakona.Game server Hotfix behaviors.

This package is intentionally small so stable model projects, hotfix projects, runtime packages, and source generators can share the same metadata without depending on Lakona.Game server hosting internals.

Metadata

  • [HotfixState] marks stable partial actor types that can receive generated friend accessors.
  • [HotfixBehaviorOf] binds a static partial Hotfix behavior class to the stable actor type it extends.
  • [FriendOf] declares that a Hotfix behavior is intended to use generated friend accessors for a stable actor type.
  • [HotfixService] marks the single hotfix implementation for a generated RPC service contract.
  • [HotfixFeature], HotfixGameFeature, HotfixFeatureContext, HotfixFeatureStartCall, HotfixFeatureStopCall, and HotfixFeatureState define the supported hotfix feature descriptor lifecycle.
  • HotfixMethodKey, HotfixSnapshot, and HotfixReloadResult describe loaded method identity and reload outcomes.
  • IHotfixRequiredServiceContracts is emitted by generated server apps so the runtime can fail reloads when a required RPC service has zero or multiple hotfix implementations.
  • LakonaTimer, TimerId, and TimerTick<TArgs> define the hotfix-safe timer surface used by feature lifecycle methods and timer callbacks.

[FriendOf] is metadata for the hotfix model and tooling. It is not an access-control mechanism; generated accessors are normal public members on the stable type in the first implementation.

Stable App assemblies own actor identity, serialized state, persistence schema, DTOs, RPC contracts, and transport contracts. Hotfix assemblies own replaceable behavior. Public extension methods in [HotfixBehaviorOf] classes are the actor API exposed through generated selectors and actor refs.

Feature Lifecycle

Hotfix feature descriptors use a single public authoring shape:

[HotfixFeature("battle-runtime")]
public sealed class BattleRuntimeFeature : HotfixGameFeature
{
    public static void Configure(HotfixFeatureContext context)
    {
    }

    public static async ValueTask StartAsync(HotfixFeatureStartCall call)
    {
        await Task.CompletedTask;
    }

    public static async ValueTask StopAsync(HotfixFeatureStopCall call)
    {
        await Task.CompletedTask;
    }
}

Only Configure is required. StartAsync and StopAsync are optional activation and removal hooks. They are not every-reload hooks: a successful reload that retains the same feature name preserves HotfixFeatureState and does not rerun StartAsync or StopAsync for that retained feature.

The only supported public configure member is public static void Configure(HotfixFeatureContext context). No other public Configure overloads are supported. Feature descriptors are not singletons; the runtime does not construct them for Configure, StartAsync, or StopAsync.

HotfixFeatureState may store stable values such as framework ids, timer ids, strings, primitive values, and DTOs from shared non-collectible assemblies. It must not contain hotfix-owned DTOs, services, delegates, or instances because those values can keep the collectible hotfix load context alive.

Timers

Feature-owned timers are created from feature StartAsync, stored in feature state, and destroyed from StopAsync:

public static async ValueTask StartAsync(HotfixFeatureStartCall call)
{
    var timerId = await LakonaTimer.CreatePeriodicTimerAsync<BattleTimers, BattleTick>(
        TimeSpan.Zero,
        TimeSpan.FromMilliseconds(50),
        nameof(BattleTimers.TickAsync),
        new BattleTick("default"),
        call.CancellationToken);

    call.State.Items["battle.timer"] = timerId;
}

public static async ValueTask StopAsync(HotfixFeatureStopCall call)
{
    if (call.State.Items.TryGetValue("battle.timer", out var value) &&
        value is TimerId timerId)
    {
        await LakonaTimer.DestroyTimerAsync(timerId, CancellationToken.None);
    }

    call.State.Items.Remove("battle.timer");
}

public sealed class BattleTimers
{
    public static ValueTask TickAsync(TimerTick<BattleTick> tick)
    {
        return default;
    }
}

public sealed record BattleTick(string QueueId);

Use LakonaTimer.CreateOnceTimerAsync<TCallback, TArgs>(dueTime, nameof(TCallback.Method), args, cancellationToken) for one-shot work and LakonaTimer.CreatePeriodicTimerAsync<TCallback, TArgs>(dueTime, period, nameof(TCallback.Method), args, cancellationToken) for periodic work. Feature StopAsync should destroy timers with noncancelable cleanup when the timer must not leak after a canceled stop token.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  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 (1)

Showing the top 1 NuGet packages that depend on Lakona.Game.Server.Hotfix.Abstractions:

Package Downloads
Lakona.Game.Server.Hotfix

Runtime loader and dispatcher for Lakona.Game server hotfix assemblies.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.2.10 30 7/4/2026
0.2.9 52 7/2/2026