Skip to content
Install desktop app

Game SDKs

Guide version 1.10.0

C# 1.3.0

Download Inspacy.GameSdk.1.3.0.nupkg

SHA-256 · b4ae62c086690037e5d2f0985a4e0866a846cb178d4cde068acb7a619a18c50e

Find friends who play this game

Use .NET 10 on Windows, Linux or macOS. Place the downloaded .nupkg in ./packages and extract its examples/GameSample directory. Set INSPACY_ORIGIN and INSPACY_GAME_ID. Login also reads INSPACY_CLIENT_ID and INSPACY_REDIRECT_URI. Open the printed URL and enter the complete callback URL on stdin. Membership reads INSPACY_ACCESS_TOKEN. Integrated packaged launch uses Windows x64.

dotnet add package Inspacy.GameSdk --version 1.3.0 --source ./packages
var page = await player.FriendsAsync(ct: ct);
var same = await publisher.GetFriendsAsync(retailSubject, ct: ct);
if (page.NextCursor is { } next) page = await player.FriendsAsync(next, ct);

Expected result

Every game supports friend discovery when the store activates the feature under its updated policies. Sharing starts enabled for each game. The player can turn it off on web, mobile or desktop. Show only the accepted friends who have both signed in to this game and still share there.

If something goes wrong

Read up to 50 aliases per page. Follow nextCursor until null. A null self and an empty list are valid. Re-read current access after a change. Turning sharing back on issues a fresh alias.

Choose a language and run a player example

Use an SDK inside a game or on its server to work with a signed-in player. Pick your language to see the exact functions, installation instructions and examples shipped for that release.

Steps

  1. Choose a language tab and download the published package. Compare the file’s SHA-256 with the value beside the download, then follow Install the SDK in that tab.
  2. For your first session, open Sign in a player and follow the callback registration steps. For an existing session, set INSPACY_ORIGIN, INSPACY_GAME_ID and INSPACY_ACCESS_TOKEN to the API origin, numeric game ID and that game’s player token.
  3. Open Function reference. Run its player read in the project you installed, or run the player example supplied in the archive. Check the entitlement and total seconds for the signed-in player. A new player can have zero seconds.

Example

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "get_sdk_docs",
    "arguments": {}
  }
}

Expected result

All five language guides offer SDK 1.3.0 with paginated game friends for players and publisher backends.

If something goes wrong

For an unknown selector, return to the published language, version and topic index.

C# function referenceC function referenceC++ function referenceJavaScript function referenceRust function reference

Which client should make this call?

The runtime has three callers. A player signs in to a particular game. Your backend holds the game’s publisher key. Each dedicated server has a reporter key tied to that server. Use the function reference for the spelling in your language.

GET /api/store/game-runtime/v1/{gameId}/me
Player. Read the scoped player identifier (subject), entitlement, content and expansion IDs, beta, membership and total seconds.
GET /api/store/game-runtime/v1/{gameId}/me/beta
Player. Read the beta program, current state and expiry after a key is redeemed.
GET /api/store/game-runtime/v1/{gameId}/me/membership
Player. Read active, asOf and validUntil before offering a monthly benefit.
POST /api/store/game-runtime/v1/{gameId}/playtime/{sessionId}/events
Player. Record start, heartbeat and end for one session. The receipt gives the updated total and identifies preview play.
GET /api/store/game-access/v1/{gameId}/players/{subject}
Publisher backend. Look up access for the authenticated player using the game-scoped subject.
POST /api/store/achievements/v1/unlocks
Publisher backend. Report an achievement code for a player. A credential may be authorized to report for a delegated expansion.
POST /api/store/tickets/v1/redeem
Publisher backend. Redeem the packaged game’s one-use ticket to establish your own session. Inspect the returned game, build, subject and purpose.
POST /api/store/server-reports/v1/{gameId}/{serverId}
Dedicated server. Publish its online status, player count and optional capacity. The receipt identifies the generation and sequence accepted.
GET /api/store/game-runtime/v1/{gameId}/rankings
Player. List published categories for this game.
GET /api/store/game-runtime/v1/{gameId}/rankings/{category}/standings
Player. Page through standings using the returned cursor and read your own rank.
POST /api/store/rankings/v1/scores
Publisher backend with score permission. Submit one player’s integer score with its saved request UUID.
POST /api/moderation/game-reports/v1/{gameId}
Player. Report another player in this game with a saved request UUID.
POST /api/moderation/game-reports/v1/{gameId}/server
Publisher backend with report permission. Submit a game-conduct report and optional evidence.
GET /api/moderation/game-reports/v1/{gameId}/server/{reportId}
Publisher backend with report permission. Read the state and outcome of a report submitted by your game.
POST /api/store/game-bans/v1/{gameId}
Publisher backend with ban permission. Ban a player from this game with a saved command UUID.
GET /api/store/game-access/v1/{gameId}/players/{subject}/ban
Publisher backend. Check the player’s current ban when starting a session and at least every five minutes.
Configure Windows ownership and sign-in

Sign in from a browser or standalone game

Register a public client for this game, then use the player’s system browser and S256 PKCE.

Before you start

  • Register the exact HTTPS callback in the game credential settings. For the runnable native sample, register http://127.0.0.1:48241/inspacy/callback and copy the new public client ID.

Steps

  1. Generate fresh state and a PKCE verifier for each attempt. Open the issuer’s /connect/authorize with response_type=code, scope=openid game.player and the S256 challenge. Browser clients use their own registered HTTPS callback.
  2. Compare the returned state, then post the code, verifier, client ID and original callback to /connect/token. Send the access token to this game’s runtime /me route. The sample keeps tokens in memory.
  3. Read expansionGameIds, betaAccess, membership and totalSeconds. A publisher service resolves the pairwise subject for that game. The dedicated server has its own separate reporting credential.

Example

python game-session.py --origin "$INSPACY_API_ORIGIN" --client "$GAME_CLIENT_ID" --game 42

Expected result

The response contains this game’s decisions for the signed-in player. An empty collection of expansions is valid.

If something goes wrong

After a callback change, revoked authorization, spent code or mismatched audience, start a new authorization with the current client ID.

Download game-session.py

Report a dedicated server’s status

Players can see the status and current player count of named servers on the game page.

Before you start

  • Create an active server record and issue its reporter credential from the game’s settings. Keep the secret on that server.

Steps

  1. Send an initial observation on startup. Use a persisted increasing generation for each process restart and increase the sequence within that generation.
  2. Send fresh online observations while running. When possible send one final offline observation. Retry a lost response with the identical generation and sequence.

Example

curl --fail-with-body -X POST "$INSPACY_API_ORIGIN/api/store/server-reports/v1/42/7" -H "X-Api-Key: $SERVER_REPORTER_KEY" -H "Content-Type: application/json" --data '{"generation":1,"sequence":0,"online":true,"players":0,"capacity":24}'

Expected result

A fresh online report can show zero players. After 90 seconds without a fresh observation the listing shows a stale status.

If something goes wrong

On 429 honor Retry-After. When a key is rotated, install the replacement on its assigned server.

Submit scores and read standings

List the published categories with a game player session. Set INSPACY_RANKING_CATEGORY to a category code. The standings include the player’s own place, even outside the current page. Private profiles have no public name. A tie shares a rank.

Steps

  1. In the publisher’s game editor, publish a category and issue a backend credential with score permission.
  2. Submit a score from the backend example, then use the player example to read the same category.

Example

inspacy docs sdk --language javascript --version 1.3.0 --topic rankings --locale en

Expected result

Select your language for its sample commands and function names.

If something goes wrong

On your backend, set INSPACY_PUBLISHER_KEY to a game credential with score permission, INSPACY_SUBJECT to the retail player subject, INSPACY_SCORE to the integer score and INSPACY_REQUEST_ID to a UUID saved with this submission. The receipt gives the best score. Retry a lost response with identical values and UUID. A changed submission under that UUID returns 409.

Report a player

Set INSPACY_REPORTED_SUBJECT to another player’s retail subject for this game and INSPACY_REQUEST_ID to a saved UUID. The game player session identifies the reporter. The receipt gives an opaque report ID and its state. A backend with report permission can also submit evidence and check its own case by INSPACY_REPORT_ID.

Steps

  1. Sign in through the game client and run the player report example with a second participant’s retail subject.
  2. For a server-originated case, run the publisher report example with report permission. Save its receipt and request the status with the same game credential.

Example

inspacy docs sdk --language javascript --version 1.3.0 --topic reports --locale en

Expected result

Select your language for its sample commands and function names.

If something goes wrong

Set INSPACY_REPORT_REASON to the applicable reason and supply INSPACY_REPORT_EXPLANATION for other. Retry identical inputs after an uncertain response. Respect Retry-After on 429. If the store returns moderation_unavailable, use the support channel in the store.

Manage game bans

Run the publisher example on your server with a game credential that has ban permission. Set INSPACY_SUBJECT, your own INSPACY_BAN_REASON and a saved UUID in INSPACY_COMMAND_ID. The ban applies only to this player in this game. Only Inspacy staff may remove it. Players can contest it through their account.

Steps

  1. Issue a game credential with ban permission and store it on your backend.
  2. Run the ban example with your own reason code. Read player-ban again after staff have reviewed a removal request.

Example

inspacy docs sdk --language javascript --version 1.3.0 --topic game-bans --locale en

Expected result

Select your language for its sample commands and function names.

If something goes wrong

After a lost reply, repeat the same command with the original ID. Check player-ban when starting each server session and at least every five minutes thereafter. An active ban returns game_banned at store enforcement points. A replay after staff removal returns the removed state.

Independent game store

Extraordinary worlds.
A place to make them yours.

© 2026 Inspacy.GameStore

Looking for your next adventure?

Explore new worlds and keep your favorites close.