Unity (C#) SDK — Room Updates

Room updates are the reliable event lane: submit named actions, then poll for broadcasts and pending requests. Keep the returned cursor so each client sees every update exactly once, across reconnects.

Room Updates

Methods for data synchronization between players

UpdatePlayersAsync

public Task<UpdatePlayersResponse> UpdatePlayersAsync<T>(string playerToken, UpdatePlayers<T> request, CancellationToken ct = default)

Sends updates to specific players or all players. Uses typed UpdatePlayers parameter.

PollUpdatesAsync

public Task<PollUpdatesResponse> PollUpdatesAsync(string playerToken, PollUpdates request, CancellationToken ct = default)

Polls for updates from specific source players. Use PollUpdates request object to specify from_players, from_players_ids, and lastUpdate.

Durable per-player room state

Room updates are the durable state lane: send writes a typed update — position, loadout, ready flag, board state — addressed to a target set, and it persists for late joiners instead of evaporating like an ephemeral message. Latest value wins: write the current state, not a history.

Poll reads updates since the last cursor you stored, optionally filtered by source players. Keep the returned cursor per client so every update is delivered exactly once — across reconnects and rejoins, which is what makes the lane reliable.

  • Updates for durable state, actions for requests that need answers, realtime for high-frequency ephemeral events.
  • Keep payloads small and typed — every member polls them on a cadence.
  • Store the cursor client-side; restarting from zero replays the whole room history.
  • SDK methods are async Tasks — await them inside your own async methods, or continue on the main thread when the result touches scene objects. The managed HttpClient transport works in both Mono and IL2CPP builds.