Skip to content

Releases: gamerelay/sdk

v0.1.0-alpha.5

v0.1.0-alpha.5 Pre-release
Pre-release

Choose a tag to compare

@github-actions github-actions released this 02 Oct 03:09
2d4b9d4
  • Short links: room.shareLink() is the room's link, the same for its life:
    https://gamerelay.io/<game>/<link> once the game's owner sets a slug and a play URL (dashboard
    → instance → Short links), which previews in chat apps with the room's name and the game's cover
    image and sends players to the play URL with ?join=<link>. Without a slug it's the page's URL
    with ?join=<link>. relay.joinLink(link) joins by a link's id, and relay.joinInvite() now
    reads ?join= as well as ?room=. room.shareInvite() shares the short link (falling back to
    the ?room= one on an older server).
  • Link-only rooms: createRoom({ linkOnly: true }) and room.setAccess({ linkOnly }) make a
    room that its code doesn't get into (room_not_found, as for a wrong code), so nobody joins by
    guessing one; a player with a seat in it still comes back by code. room.linkOnly, and
    linkOnly in the access event.

v0.1.0-alpha.4

v0.1.0-alpha.4 Pre-release
Pre-release

Choose a tag to compare

@github-actions github-actions released this 30 Sep 15:18
d5d37bc
  • Host controls: the room's host can run it like a game server. room.kick(playerId, { ban?, message? }) removes a player the way the owner's kick does (banned from the room by default).
    room.setAccess({ locked?, public?, maxPlayers? }) locks the room to newcomers (joins fail with
    the new locked code; players in it can still reconnect), lists or unlists it, and changes its
    size, never below the players in it. room.setListing({ name?, meta? }) sets what room lists
    show: a name of up to 48 characters and up to 512 bytes of JSON. room.transferHost(playerId)
    hands the host role over. All four are host only (not_host for anyone else) and return
    promises. Everyone gets the new access and listing events, and room.locked,
    room.isPublic, room.name and room.meta stay current (room.maxPlayers too, which is no
    longer read-only).
  • Server browser: relay.listRooms(tag, { includeFull: true }) also lists full and locked
    rooms, and every listing now has name, meta, locked and hostName.
    relay.online() says how many players the game has online.
  • Kicked while offline: a player kicked while their connection was down now gets
    closed('kicked', message) when the SDK reconnects, instead of closed('lost') or, without a
    ban, quietly getting a fresh seat back (the reconnect asks to resume, and the server says why
    it can't).
  • Refused joins stay put: joining a room that refuses you (locked, banned, full) no longer
    takes you, or your party, out of the room you're in. A party moves only if every member can.
  • A party leader keeps its room over a reconnect: a leader whose connection drops gets its
    own seat back even if a party member can't come in (kicked, or outside a room since locked or
    filled), and nobody is pulled along; a reconnect also no longer hands the party's lead away.
    This is the server's doing, so it applies to every SDK version.
  • These need a server with host controls (gamerelay.io has them). Older SDKs in the same room
    are unaffected: they ignore the new events.

v0.1.0-alpha.3

v0.1.0-alpha.3 Pre-release
Pre-release

Choose a tag to compare

@github-actions github-actions released this 29 Sep 20:14
3281281
  • Smaller messages: the SDK asks the server for relayed messages in a short form (the
    sender's room slot instead of its id), about 18% fewer bytes per message and per metered
    byte. gamerelay.io serves it; an older server just sends the long form.
  • Player to player uses less upload: a player whose copies reach you after the server's
    (common on a relayed route near the game server) is told so, and then sends you only every
    10th copy for 30 s, which keeps checking whether the route got faster.

v0.1.0-alpha.2

v0.1.0-alpha.2 Pre-release
Pre-release

Choose a tag to compare

@github-actions github-actions released this 29 Sep 16:59
4ab38b2
  • Player to player, on by default (experimental): broadcasts also go straight between
    players, directly on the same network or else through GameRelay's nearest relay, racing the
    server's copy, which still goes to everyone. connect({ lan: false }) turns it off. Party
    members can also connect directly over the internet with lan: { direct: 'party' }, if the
    game's dashboard allows it (off by default). Players on older SDKs in the same room are
    unaffected. See the docs page, "Experimental: player to player".
  • Player to player, more reliable: a relayed connection no longer drops every hour when its
    relay credentials expire (the 20-minute refresh now reaches open connections, with an ICE
    restart that keeps the channel open). After a network change (Wi-Fi to cellular), the route is
    restarted after 3 s instead of sitting dead for ~30 s. With relays, a connection that didn't open
    is tried again after 5 s, 30 s and 2 min. Copies over 2 KB go by the server only, since the lossy
    channel mostly lost them. Connection setup sends far fewer server messages, and the debug overlay
    shows each channel's round trip.
  • Security: another player can no longer learn your IP address through the player-to-player
    shortcut (a fake relay candidate, or candidates inside an offer or answer), take over another
    player's entity ids before a newcomer sees them, or grow your memory with made-up entity kinds
    or input keys. A peer's copies get the server's size and rate limits, only a server copy starts
    a sender's session, and a peer can make us reconnect at most once every 2 s. State patches can't
    set __proto__. Entity ids now end in a short tag of their creator, 7 characters longer.
  • Reliability: a connection that died without closing (switching from Wi-Fi to cellular, a
    laptop waking) is noticed within about 9 s, or at once when the page is shown again or comes
    back online, and the player rejoins before their seat is given up. Calls to the server, and
    claims, no longer wait forever: calls fail with timeout after 10 s, and a claim is retried and
    then settles. relay.now() no longer jumps when the device's clock changes, and follows the
    server after a reconnect. The SDK no longer sends a burst the server's rate limit would drop
    whole: position updates give way and everything else waits its turn (a full offline queue
    also keeps your messages over heartbeats), with a warning when your entity rates can't fit.
    Reconnects after a server restart are spread out, keyframes after a reconnect too, and sends
    from relay.tick go out without waiting for the next frame.
  • New error, too_many_rooms: createRoom and quickMatch reject with it when a player
    already has 4 rooms nobody else is in, or the game is at its plan's room limit. Reuse a room for
    the next round instead of creating one each time.
  • Types: the published gamerelay.d.ts no longer lists the SDK's internal plumbing
    (relay.request, relay.warn, debugInfo and the like), so autocomplete shows only the
    public API. new Room() is still not allowed; rooms come from relay.createRoom,
    joinRoom and quickMatch.
  • Docs: kind.mine() says what really happens when you write an entity you don't own: the
    write is skipped, with a console warning. llms.txt lists the module build
    (https://gamerelay.io/sdk/gamerelay.mjs) and says relay.features flags are reserved.
  • Also on JSR as @gamerelay/sdk, and each release has notes on GitHub.