![]() |
VOOZH | about |
dotnet add package Lakona.Game.Client --version 0.1.7
NuGet\Install-Package Lakona.Game.Client -Version 0.1.7
<PackageReference Include="Lakona.Game.Client" Version="0.1.7" />
<PackageVersion Include="Lakona.Game.Client" Version="0.1.7" />Directory.Packages.props
<PackageReference Include="Lakona.Game.Client" />Project file
paket add Lakona.Game.Client --version 0.1.7
#r "nuget: Lakona.Game.Client, 0.1.7"
#:package Lakona.Game.Client@0.1.7
#addin nuget:?package=Lakona.Game.Client&version=0.1.7Install as a Cake Addin
#tool nuget:?package=Lakona.Game.Client&version=0.1.7Install as a Cake Tool
Lakona.Game.Client contains engine-neutral client helpers for game clients built on top of Lakona.Rpc.
The package focuses on one recommended main entry point, LakonaGameClient, plus lower-level reliable server push and reconnect-aware state helpers:
The library does not depend on Unity, Godot, or any transport package. Game clients remain responsible for choosing their transport, dispatching callbacks onto the engine main thread, and applying business-specific payloads.
using Lakona.Game.Abstractions;
using Lakona.Game.Client;
using Lakona.Game.Client.ReliablePush;
using Lakona.Game.Client.Sessions;
var client = new LakonaGameClient();
client.StartSession(sessionId, lastReliableSequence: 0);
await client.ProcessReliablePushAsync(
ReliablePushSequence.From(update.ReliableSequence),
update,
applyAsync: static (payload, ct) =>
{
// Apply the business payload on the application's chosen thread.
return ValueTask.CompletedTask;
},
acknowledgeAsync: async (ack, ct) =>
{
// Send ack.Sequence.Value through the game's RPC API. Use your own client-facing
// session token or stream id if the server requires one for acknowledgement.
await playerService.AckReliablePushAsync(sessionId, ack.Sequence.Value, ct);
return ReliablePushAckOutcome.Accepted();
},
cancellationToken);
if (client.Snapshot.Phase == ClientSessionPhase.RefreshRequired)
{
// Clear transient view state and fetch an authoritative game snapshot.
}
if (client.Snapshot.Phase == ClientSessionPhase.StateLost)
{
// Start a new login/session flow. StateLost remains terminal until StartSession is called again.
}
Use ReliablePushInbox directly only when you want to manage session phase separately. The session id is an opaque client-side key chosen by your game protocol, not Lakona.Game.Server.Sessions.GameSessionKey.
using Lakona.Game.Abstractions;
using Lakona.Game.Client.ReliablePush;
var inbox = new ReliablePushInbox();
inbox.StartSession(sessionId, lastAppliedSequence);
await inbox.ProcessAsync(
ReliablePushSequence.From(update.ReliableSequence),
update,
applyAsync: static (payload, ct) =>
{
// Apply the business payload on the application's chosen thread.
return ValueTask.CompletedTask;
},
acknowledgeAsync: async (ack, ct) =>
{
// Send ack.SessionId and ack.Sequence.Value through the game's RPC API.
await playerService.AckReliablePushAsync(ack.SessionId, ack.Sequence.Value, ct);
return ReliablePushAckOutcome.Accepted();
},
cancellationToken);
ClientSessionController is a pure state helper. Unity, Godot, and plain .NET clients can render their own UI from the snapshot without the framework touching engine APIs or dispatchers.
using Lakona.Game.Abstractions;
using Lakona.Game.Client.ReliablePush;
using Lakona.Game.Client.Sessions;
var controller = new ClientSessionController();
controller.StartSession(sessionId);
controller.MarkReconnecting();
controller.ApplyAckOutcome(ReliablePushAckOutcome.StateRefreshRequired());
if (controller.Snapshot.Phase == ClientSessionPhase.RefreshRequired)
{
// Clear transient view state and fetch an authoritative game snapshot.
}
controller.ApplyAckOutcome(ReliablePushAckOutcome.StateLost());
if (controller.Snapshot.Phase == ClientSessionPhase.StateLost)
{
// Start a new login/session flow. StateLost remains terminal until StartSession is called again.
}
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 net5.0 was computed. net5.0-windows net5.0-windows was computed. net6.0 net6.0 was computed. net6.0-android net6.0-android was computed. net6.0-ios net6.0-ios was computed. net6.0-maccatalyst net6.0-maccatalyst was computed. net6.0-macos net6.0-macos was computed. net6.0-tvos net6.0-tvos was computed. net6.0-windows net6.0-windows was computed. net7.0 net7.0 was computed. net7.0-android net7.0-android was computed. net7.0-ios net7.0-ios was computed. net7.0-maccatalyst net7.0-maccatalyst was computed. net7.0-macos net7.0-macos was computed. net7.0-tvos net7.0-tvos was computed. net7.0-windows net7.0-windows was computed. net8.0 net8.0 was computed. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 was computed. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 was computed. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
| .NET Core | netcoreapp3.0 netcoreapp3.0 was computed. netcoreapp3.1 netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.1 netstandard2.1 is compatible. |
| MonoAndroid | monoandroid monoandroid was computed. |
| MonoMac | monomac monomac was computed. |
| MonoTouch | monotouch monotouch was computed. |
| Tizen | tizen60 tizen60 was computed. |
| Xamarin.iOS | xamarinios xamarinios was computed. |
| Xamarin.Mac | xamarinmac xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos xamarinwatchos was computed. |
This package is not used by any NuGet packages.
This package is not used by any popular GitHub repositories.