Repository navigation
UniNet v0.7.0
Resume result reporting + auto-retry (breaking — REC-001, ADR-0044). ReconnectAsync returning true only ever meant "the connection established" — the server's reattach outcome was discarded, rejections were complete silence, and the fast-reconnect race (reconnecting before the server noticed the old connection died) silently spawned a fresh player every time.
Changed (breaking)
NetworkServer.ResumeSessionreturnsGraceResumeResultinstead ofbool—Reattached,SessionNotFound(detach race — retryable window included),Expired,UnknownToken(guessed/consumed token, invalid connection). Direct callers:false→ the exact reason,true→GraceResumeResult.Reattached. Every failure still consumes nothing (SEC-001 intact).
Added
- Wire 14 — resume result to the requesting connection:
{ok, reason, retryableRemainingMs}. Consumed and swept-expired tokens are tombstoned (bounded by the grace window) so a double-consume loser learnsUnknownTokenand a swept session reportsExpired— neither masquerades as a retryableSessionNotFound. Generator 0.2.10 (server hub send + client receiver registration). - Client observability:
NetworkClient.LastResumeResult+NetworkClient.ResumeResultReceivedevent (dispatch thread — marshal viaQueueOnMain). Fresh connections without a token receive no wire 14. - Auto-retry: while a
SessionNotFoundretry window is armed,NetworkClient.TickResumeRetry(driver Update cadence) re-sends the resume request every 0.5 s until the window closes or a terminal result arrives — the detach race converges toReattachedinstead of a silently fresh player. IUniNetSystemChannel.SendResumeResult— default no-op (test channels unaffected); the generated server hub implements the wire send.
Migration
- Update direct
ResumeSessioncalls fromboolto the enum. Game code observing reconnects should subscribe toResumeResultReceived—ReconnectAsync's return value is (and remains) only the connection attempt. - No change for standard clients; both ends should update together (default version handshake rejects mixed 0.6.x/0.7.x).