ULinkGame.Client
0.1.6
dotnet add package ULinkGame.Client --version 0.1.6
NuGet\Install-Package ULinkGame.Client -Version 0.1.6
<PackageReference Include="ULinkGame.Client" Version="0.1.6" />
<PackageVersion Include="ULinkGame.Client" Version="0.1.6" />
<PackageReference Include="ULinkGame.Client" />
paket add ULinkGame.Client --version 0.1.6
#r "nuget: ULinkGame.Client, 0.1.6"
#:package ULinkGame.Client@0.1.6
#addin nuget:?package=ULinkGame.Client&version=0.1.6
#tool nuget:?package=ULinkGame.Client&version=0.1.6
ULinkGame.Client
ULinkGame.Client contains engine-neutral client helpers for game clients built on top of ULinkRPC.
The package focuses on one recommended main entry point, ULinkGameClient, plus lower-level reliable server push and reconnect-aware state helpers:
- track the latest applied reliable push sequence
- detect duplicate reliable push messages
- decide whether an incoming push should be applied and acknowledged
- reset sequence state when the client starts a new logical session
- expose an engine-neutral session phase snapshot for reconnect, refresh, and state-lost flows
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.
Main Client API
using ULinkGame.Abstractions;
using ULinkGame.Client;
using ULinkGame.Client.ReliablePush;
using ULinkGame.Client.Sessions;
var client = new ULinkGameClient();
client.StartSession(new GameSessionKey(playerId, sessionId, generation), 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.Session.SessionId, ack.Session.Generation, and ack.Sequence.Value through the game's RPC API.
await playerService.AckReliablePushAsync(ack.Session.SessionId, ack.Session.Generation, 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.
}
Lower-level reliable push inbox
Use ReliablePushInbox directly only when you want to manage session phase separately. Session identity comes from ULinkGame.Abstractions.GameSessionKey.
using ULinkGame.Abstractions;
using ULinkGame.Client.ReliablePush;
var session = new GameSessionKey(ownerKey: playerId, sessionId: sessionId, generation: generation);
var inbox = new ReliablePushInbox();
inbox.StartSession(session, 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.Session and ack.Sequence.Value through the game's RPC API.
await playerService.AckReliablePushAsync(ack.Session.SessionId, ack.Session.Generation, ack.Sequence.Value, ct);
return ReliablePushAckOutcome.Accepted();
},
cancellationToken);
Engine-neutral session state
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 ULinkGame.Abstractions;
using ULinkGame.Client.ReliablePush;
using ULinkGame.Client.Sessions;
var controller = new ClientSessionController();
controller.StartSession(new GameSessionKey(playerId, sessionId, generation));
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 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. |
-
.NETStandard 2.1
- ULinkGame.Abstractions (>= 0.1.3)
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 |
|---|