Methods for managing global and player-specific game data
public Task<GameDataResponse<T>> GetGameData<T>(CancellationToken ct = default)
Retrieves global game data with generic type support. Data is automatically deserialized using JsonUtility.
public Task<SuccessResponse> UpdateGameData<T>(T data, CancellationToken ct = default)
Updates global game data. Requires private API token. Uses generic type for type safety.
public Task<PlayerDataResponse<T>> GetPlayerData<T>(string playerToken, CancellationToken ct = default)
Retrieves player-specific data with generic type support. Requires player authentication.
public Task<SuccessResponse> UpdatePlayerData<T>(string playerToken, T data, CancellationToken ct = default)
Updates player-specific data with generic type support. Requires player authentication.
Game data is JSON your game owns, kept at two scopes. The game-scope blob holds live configuration — name and room rules, version policy, client config — that every SDK reads at startup, so rule tweaks reach players without shipping a client update. The player-scope record per user carries progression: stats, loadouts, unlocks and match state that must outlive sessions.
Reads need only the public API token since the game blob is world-readable. Writes are privileged: game scope requires the private token, and a player record requires that player's token or admin credentials. Player fields are also what the leaderboard sorts — keep ranked fields numeric and consistently named across builds.