Skip to content

Releases

UniNet v0.24.2

Choose a tag to compare

@github-actions github-actions released this 15 Nov 14:13

Teleport classification follows speed, not distance alone (generator and wire formats unchanged).

Fixed

  • Fast legitimate motion is no longer misread as a teleport — a remote sample was cleared as a teleport whenever its displacement exceeded max(SnapThreshold, 3 × displacement EMA). The EMA needs several samples to adapt, so an object that was already fast when two server ticks merged into one delta (a dash at 27 u/s, 0.9 u in 33 ms) tripped the distance test, the buffer was cleared, and the body snapped — measured 1.24 u in a single frame. The classification now also requires the implied speed (delta / arrival-cadence) to exceed TeleportSpeedCeiling (40 u/s), so a respawn or an explicit teleport (hundreds of u/s) still snaps immediately.

Verified

  • NetworkTransformRemoteRenderTests gains a cold-EMA regression: 0.9 u in one cadence keeps all three samples (interpolation), while a 30 u jump snaps. Full EditMode suite re-run.

UniNet v0.24.1

Choose a tag to compare

@github-actions github-actions released this 15 Nov 14:07

Remote-motion smoothness patch (generator unchanged, wire formats unchanged — no client update required).

Fixed

  • Remote samples are spaced by cadence, not by arrival time — NetworkTransform stamped every received snapshot with UniNetTime.Now. When two deltas land in the same frame their arrival times are ~0 ms apart, so that segment collapsed to a sliver (or the second sample was refused by the buffer's monotonic guard and its position was lost entirely); the renderer then crossed the missing distance in a single frame. Remote bodies visibly jumped — most obvious during a dash, where the per-sample distance is largest. Each position/rotation buffer now advances its own sample clock by the estimated arrival cadence (seeded from the first real gap, bounded lead, stall resync), so every segment keeps a real width while the axis still tracks wall time.
  • The adaptive interpolation delay no longer steps a whole frame at once — the effective delay was recomputed from the arrival-gap EMA on every sample and applied instantly, so changing InterpolationDelay at runtime (a game widening the window for a burst) moved renderTime backwards in one frame and the body jumped by the window change. The delay is now smoothed per sample toward its target, and its target is floored at ~one arrival gap so a sparse stream cannot starve the buffer into hold-then-catch-up.

Added

  • NetworkTransform.EffectiveInterpolationDelay is observable — the smoothed delay the renderer actually uses (previously an unused internal expression). Game instrumentation and regressions can assert on what is drawn instead of on the configured maximum.

Verified

  • NetworkTransformRemoteRenderTests gains two regressions that fail on the old behaviour: a same-frame delta pair must keep both samples and a real segment width (arrival stamping produced a 1.0 ms sliver), and a runtime InterpolationDelay change must not move the delay more than a fraction of a sample at a time. Full Unity EditMode suite: 351 passed / 0 failed / 1 pre-existing skip.

UniNet v0.24.0

Choose a tag to compare

@github-actions github-actions released this 03 Nov 00:50

Sender context + additive scenes (generator 0.3.0; wire 11 format changed — update both ends together, the version handshake rejects mixed versions).

Added

  • Verified sender context — RpcSender (ADR-0056) — append a trailing RpcSender parameter to {Name}_Implementation/{Name}_Validate on a ServerRpc and the generated dispatch injects the transport-assigned caller: ConnId (unforgeable — never serialized, never a client-supplied argument), IsLocal (server/host direct call), PlayerNetId (the connection's declared player object). The RPC declaration and every call site stay unchanged. ServerRpc-only: UNINET018 rejects it on Client/Multicast implementations, UNINET017 rejects it on the RPC declaration. Wire format unchanged — existing RPCs regenerate identically.
  • Additive scene synchronization (ADR-0057) — server.LoadSceneAdditive(name) / server.UnloadScene(name) extend scene management beyond Replace: the active set is base + additive scenes, one transition at a time (a second start throws until AllClientsSceneLoaded), joiners replay the whole active set in order with per-scene modes, and unload destroys that scene's registered objects BEFORE the unload command on the same reliable stream. Clients report unload readiness automatically (sceneUnloaded hook). Wire 11 now carries [mode][sceneName] — clients ≤0.23 are rejected by the version handshake, so update both ends together.

UniNet v0.23.0

Choose a tag to compare

@github-actions github-actions released this 29 Oct 08:10

Stabilization release — FR-01..07 plus audit hardening (generator 0.2.19; wire formats unchanged, default handshake version bumps as usual).

Added

  • Game-RPC send gate (FR-01) — broadcast [ClientRpc], the To/ToOwner companions, and [MulticastRpc] network sends now go only to connections that are approved and not scene-held (ServerConnection.CanReceiveGameData: !Disconnected && VersionApproved && !AwaitingSceneReady). Calls before approval or during a scene transition are dropped immediately — no queue, no replay. The system handshake (Welcome etc.), multicast local execution, and approved connections that never changed scenes are unaffected.
  • Periodic in-motion baseline (FR-02) — an Unreliable-delivery sub-object that keeps producing deltas now re-sends its full state on the reliable batch every 1.0 s (UnreliableBaselineIntervalSeconds), so a lost delta converges to the latest authoritative state within one interval even while other fields keep changing (collections re-baseline wholesale — a tag-1 full, never an op replay). Idle subs are still healed once by the existing 0.25 s quiescence resend; batching/budget contracts unchanged.
  • AOI re-entry refresh (FR-04) — re-entering a dynamic object's relevance no longer silently ignores the re-sent spawn baseline when the client still holds the instance: transform + per-slot full state are refreshed in place (no re-instantiation, SubId slots and typeKeys verification kept, RepNotify raised like the first spawn). Host duplicates keep the server originals untouched.
  • State-only ack reconciliation (FR-05) — INetworkMoveSimulation.ReconcileState(…): when an ack's predicted position already matches, the state snapshot recorded for that sequence is byte-compared against the server echo and, on divergence only, restored and re-simulated with Rollback's exact replay semantics. An agreeing ack costs one comparison (no replay). Default interface method — custom INetworkMoveSimulation implementations keep the legacy discard-only behavior. Wire fields, death gate, ownership epoch, teleport re-anchor unchanged. Note: the comparison is exact on WriteState bytes, so a lossy (quantized) state codec can encode distinct states identically — sub-wire-precision divergence is skipped (the same limit the rollback restore has).
  • Finite semantic-preserving backlog + explicit overflow (FR-06) — deferred replication entries coalesce per (NetId, SubId) into the LATEST full state (senders may never interleave a stale-index op delta past a queued full — index continuity for collections is preserved end to end); the deferred queue is capped at MaxDeferredDeltas (1024) with overflow force-sent (DeferredForcedSendCount, counted on actual deliveries). The main-thread queue is capped (UniNetEnvironment.MainQueueCapacity, 65536); overflow drops are explicit (LogFault + DroppedMainActions). Client-side apply drops are observable via UniNetEnvironment.DroppedReplicateEntries. New counters: DeferredCoalescedCount, DeferredForcedSendCount, DroppedMainActions, DroppedReplicateEntries.
  • Headless generator regression host + CI gate (FR-07) — Tests/UniNet.CodeGenerator.Tests runs the real generator (source-built or the packaged analyzer DLL) through RunGeneratorsAndUpdateCompilation and executes the generated send/codec paths on the real Core runtime; wired as a required validate job step in CI alongside the generator build.

Fixed

  • Generator source build restored — a merge remnant in UniNetCodeGenerator.cs (CS1010/CS1002) made the generator source uncompilable; the shipped analyzer DLL was a stale artifact. The source pipeline is whole again and the packaged DLL is rebuilt from it (0.2.18).
  • RPC collection codec (FR-03) — receiving a List<T> RPC argument pre-allocated capacity instead of adding elements (empty list + every following argument corrupted); arrays/collections longer than 65,535 elements now throw ArgumentException before serialization instead of wrapping the UInt16 count; a fully-decoded but misaligned payload (trailing bytes) never reaches the game implementation. Wire format unchanged for existing payloads.
  • Parser crash on unsupported RPC args — an unsupported parameter (e.g. List<List<int>>) reported UNINET002 but kept emitting, crashing the generator (CS8785) and swallowing the diagnostic; it now reports and skips only that RPC (matching the Replicated-field path).
  • Malformed array receive hardening (generator 0.2.19) — the generated array receiver no longer pre-allocates from the wire's UInt16 count alone: a forged 12-byte header with count 65,535 used to allocate ~263 KB before failing. The count is rejected before allocation if it exceeds the remaining payload bytes (every supported element consumes at least one byte). Malformed lengths are never clamped into empty or shorter arrays: terminal-array and truncated-byte-array regressions assert that the implementation is not invoked. Wire format, null/empty/max-size receive unchanged. The headless regression host now dispatches a header-only forged 65,535-count frame (implementation not invoked, no count-sized allocation) plus array/null/empty/65,535 round-trips through the real generated handler.
  • RPC identifier hygiene (F13) — legal payload names such as netId, r, w, server, __n, and __i, plus escaped keywords, no longer collide with generated protocol fields or locals. Private wire helpers use ordinal aliases; public payload names and working named-argument calls are preserved. A To recipient parameter gains __ prefixes only if its usual connId name conflicts with a payload name. Method IDs and wire bytes are unchanged. Real compile, dispatch, targeting, and named-argument regressions cover all three RPC kinds.
  • verify-install.sh exit handling — set -e aborted the script on Unity's non-zero exit before the FAIL summary, the compiler-error scan, and the detailed-log path could run; the capture is now guarded (|| EXIT=$?). A hermetic regression (Tests/PackageTools/run-tests.sh) executes the real script's judgment block against a fake Unity — exit 23 → FAIL + log path + exit 1, exit 0 → PASS, exit 0 + error CS → FAIL, missing package trace → FAIL — and is wired into the CI validate job. No real Unity, clone, or network involved.
  • Arena PlayMode jump wait — the 1000-frame guard fired before the physically accurate 3 s simulation cap under batch-mode headless FPS (a pre-existing harness budget bug); raised to the file-wide 6000 convention.
  • Deferred merge cap bypass + partial-success wipe (F11) — when a deferred-entry merge was impossible (a faulted serializer view or an all-empty full rewrite), the fallback kept BOTH same-key entries, appending one per tick and growing the deferred queue past MaxDeferredDeltas without bound; and a merge whose owner view faulted while the others view succeeded was treated as success, discarding the fresh owner delta and stranding that receive group on a stale payload. Now: a fault on EITHER view voids the merge atomically, and the merge-impossible fallback force-drains the OLDER entry (by Seq) on the reliable batch past the budget (existing force-send precedent) while retaining the newer one on the same reliable lane — the queue holds exactly one entry per key, the per-key wire stream stays seq-monotonic, and every receive group converges after recovery without a new value change.
  • Saturated-main-queue detach cleanup loss (F12) — when the main queue was at capacity, DetachConnection removed the connection but dropped its cleanup lambda, permanently skipping ownership reassignment (dead owners), the player-object mapping, and the ClientDisconnected event. New: UniNetEnvironment.TryQueueOnMain (explicit accept/reject) carries general work; a rejected one-shot detach cleanup falls back to a reserved FIFO retained for PumpMain after normal work (no inline callbacks, no retry loop, no blocking); AttachConnection refuses admission both at normal capacity and while reserved cleanup remains, even if normal work has made room (returns 0, rolls the registration back, disconnects the hub), bounding the reserve by the already-admitted cohort rather than historical connection churn. A throwing action still aborts the current pump call; no throughput/reentrancy contract change is included. Approval-release enqueues rejected by a saturated queue revert to unapproved (the declare-timeout sweep owns them) and approval dispatch/verdict rejections are fault-logged. New observability: ReservedCleanupCount / ReservedCleanupDrainedCount (enqueue/dequeue totals); PendingMainActions includes both queues.
  • Same-key backlog ordering on priority changes (F15) — a runtime priority increase could send a fresh reliable delta before its older queued delta, permanently reverting the receiver. Queued keys now share the group's maximum effective priority and use Seq ordering; the reusable scratch dictionary is limited to queued keys and fresh candidates need no extra pass when the queue is empty. CoreInvariantRegressionTests passed 15/15 in isolated Unity EditMode, including actual generated FastArray replay, >64 recipients, send-fault pool ownership, queue-backpressure churn, and priority increase/decrease controls. This does not promise replay after channel failures.
  • Role-aware client dynamic-mirror lifecycle (F06) — ClientAsync (and ReconnectAsync through it) now purges the previous client generation's dynamic mirrors immediately BEFORE swapping in the new client registry: a leftover mirror kept its cached dynamic netId, was skipped by the fresh generation's scene registration, and a catch-up spawn of a recycled id instantiated a second live instance beside the stale ghost. ClientStop is now client-role-aware too — in host mode the live server's authoritative dynamic originals and their registry entries survive (the still...
Read more

UniNet v0.22.0

Choose a tag to compare

@github-actions github-actions released this 22 Oct 15:28

Generator type support expansion (GEN-002/GEN-004, generator 0.2.17 — no runtime change).

Added

  • Nested NetworkBehaviour support: the generated partial now wraps in the ContainingType chain (partial class Outer { partial class Inner { ... } }), enabling RPC/replication on nested classes.
  • Generic NetworkBehaviour definitions emit error UNINET016 (Unity cannot attach generic MonoBehaviour components).
  • RPC parameters accept Vector2/3/4, Quaternion (uncompressed float decomposition), and 1-D T[]/List<T> (null flag + UInt16 length prefix + sequential elements).

UniNet v0.21.0

Choose a tag to compare

@github-actions github-actions released this 22 Oct 14:01

Persistent rotation/scale sync on NetworkTransform, opt-in (TRS-001, ADR-0054 — generator unchanged; new [Replicated] fields ride the existing generic codec). NetworkTransform only ever replicated position — rotation was spawn-time-only (frozen after join) and scale was not on the wire at all.

Added

  • SyncRotation (default off): [Replicated(Notify)] quaternion components sampled by the server, Slerp-interpolated on remotes (same adaptive delay and arrival pacing as position), with angular-displacement snap (turn-rate EMA gated — warmup-safe). Owner and remote apply; the server ignores (rotation is server-driven, not predicted).
  • SyncScale (default off): replicated localScale applied immediately on receipt (discrete — un-interpolated).
  • SetNetworkRotation(Quaternion) — server-only rotation teleport, independent of SetNetworkPosition (position untouched).
  • Late joiners get the current pose in the full-state spawn/catch-up automatically. Awake seeds all replicated fields from the spawn pose unconditionally ((0,0,0,0) quaternions impossible; zero bandwidth with flags off).
  • Tests T1-T9 (EditMode): Slerp follow, angular snap, immediate scale, spawn-pose seeding, opt-out invariance, owner-apply/server-ignore, late-join convergence, SetNetworkRotation contract (incl. position-untouched), server scale sampling.

UniNet v0.20.0

Choose a tag to compare

@github-actions github-actions released this 22 Oct 12:32

Server-time synchronization contract documented + measurement tests (TIM-001 — zero logic change). The time-sync behavior (offset EMA, monotonic clamp, no half-RTT compensation) was undocumented; the audit could not tell a real defect from a bounded nuisance.

Added

  • UniNetTime XML now states the contract: forward progress is always 1 (the offset is frozen between syncs); an offset decrease stalls progress for at most 0.25·|Δoffset| (one EMA step, bounded); client Now carries a constant bias of at most the s2c one-way delay (no RTT/2 compensation — UE-style push, deliberate); monotonic via the _lastNow clamp; not thread-safe (QueueOnMain precondition). Execution code is byte-identical.
  • Tests T1-T5 (deterministic fake clocks): decrease monotonicity + stall bound, repeated-decrease Σ bound, EMA convergence, server-ignore, and a hit-bias measurement (bias=50ms -> rewind error 50ms) that gates any future half-RTT compensation work.

UniNet v0.19.0

Choose a tag to compare

@github-actions github-actions released this 22 Oct 09:25

Symmetric stop/fail/restart lifecycle cleanup (LIF-001, ADR-0052 — no wire/protocol change). Three coupled lifecycle defects: ServerStopAsync skipped the dynamic-spawn sweep that the synchronous ServerStop performed (ghost netIds aliasing onto the next session after a restart); a failed ServerAsync listen left a zombie server attached to the scene (no rollback); and NetworkBehaviour's registration flags had no reset path, so after a stop/restart cycle scene objects were silently never re-registered to the new server instance.

Changed

  • ServerStopAsync now sweeps dynamically spawned objects exactly like the synchronous stop (main-thread contract unchanged).
  • ServerAsync wraps the listen in try/catch — a failure (e.g. port already in use) detaches the environment (SetServer(null)) before rethrowing, leaving a clean slate for a retry on another port.
  • Registration tracking replaced with generation stamps: NetworkServer.Generation / NetworkClient.Generation (public static counters) and per-behaviour _registeredServerGen/_registeredClientGen. Registration skips and IsServer/IsClient compare against the current instance's generation — every new server/client instance re-registers all scene objects automatically, and same-generation re-calls stay idempotent. User-visible improvement: scene objects now re-register automatically after a stop/restart cycle (previously silently dropped). Generation values never leave the process (wire/protocol unchanged).
  • Tests: PlayMode ServerRestartSweepPlayTests — async-stop sweep, same-port restart with non-aliasing netIds, scene re-registration after restart, listen-failure rollback, host restart loopback. RED evidence: disabling the sweep fails T1/T2.

UniNet v0.18.0

Choose a tag to compare

@github-actions github-actions released this 22 Oct 08:14

Enum RPC parameters and replicated fields (GEN-003 — no wire change; generator 0.2.16). [ServerRpc]/[ClientRpc]/[MulticastRpc] parameters and [Replicated] fields rejected enums with UNINET002 — users had to wrap every enum in a [Message].

Added

  • Enums are now accepted everywhere primitives are: the generator resolves an enum to its declared underlying integer (byte..ulong) and emits the same codec with an explicit cast — the wire bytes are identical to the backing primitive (wire-compatible). Covers RPC parameters, replicated fields (delta/full/array element paths), and collection element types. Nullable enums are not supported.
  • Out-of-range values pass through unvalidated by design (UE/Photon parity) — server-authoritative range checks belong in the user's [ServerRpc(Validate = true)] hook.
  • UNINET002's message now states that enums are supported through their underlying integer.
  • Tests: EditMode EnumRpcWireTests — int/byte/ulong-backed roundtrips, byte-for-byte payload equality with the raw primitive, out-of-range pass-through, replicated enum scalar + enum array sync. Fixtures live in Tests/Fixtures (see the note in Gen003EnumFixtures.cs about why NetworkBehaviour fixtures must not live in test assemblies).

UniNet v0.17.0

Choose a tag to compare

@github-actions github-actions released this 22 Oct 05:58

Dispatch registration-collision guard (GEN-001 — no wire/generator change). The dispatch table silently overwrote an existing handler on any re-registration (a lone Debug.WriteLine was the only trace) — a cross-assembly FNV-1a method-ID clash would hijack the dispatch invisibly.

Changed

  • User-range method IDs (>= 64): re-registration is idempotent when the handler is the SAME method (delegate method identity, not instance identity — method-group arguments produce fresh delegates per registration pass); a DIFFERENT handler on a taken ID (cross-assembly clash, which compile-time UNINET007 cannot see) is rejected first-wins and surfaced through LogFault with both method names. Same handler with a different delivery mode is also a conflict (strict).
  • Reserved wire IDs (< 64, wires 13/14) keep the silent overwrite — every assembly registers its own internal handler under the same ID by design ("idempotent across assemblies").
  • Tests: EditMode UniNetDispatchRegistrationTests — idempotent re-registration, cross-handler rejection (first-wins pinned), reserved-range overwrite, delivery-mode mismatch.