mugon.net docs
SDKsJavaScript

SDK versions

How the SDK version you build with maps to the platform's behaviour.

The way a game and the platform talk to each other is versioned by the major version of @mugon/sdk bundled into the game. Because a published game keeps the SDK it was built with forever, the platform has to understand every major it still runs.

  • js-sdk-version in mugon.toml says which SDK you target.
  • mugon publish verifies the bundle really contains that major and records the major with the game version.
  • The platform selects its behaviour from the recorded major before it creates the iframe. A version recorded with a major the platform doesn't support is refused with a clear message instead of a broken game. When the game reports a different major than recorded, the launch fails as well.

Within one major, changes only add things (new optional fields, new messages), so a game built with any release of a major keeps working. Anything else needs a new major. While the SDK is at 0.x, the same rule applies: the major (0) is the protocol generation. Until the first release on npm the SDK is a pre-release and makes no compatibility promise, so a minor release may still rename things (0.3 did, see below).

Updating the SDK

Bump the dependency, rebuild, update js-sdk-version in mugon.toml, publish a new game version. Minor and patch updates need no other change.

Added inWhat
0.2ctx.endGame() and ctx.nextGame(settings), see ending the game
0.3One vocabulary: players have an id and a name (ctx.self, ctx.server, ctx.initialPlayers), ownId/serverId/initialPeers are gone, connect/disconnect events are playerConnected/playerDisconnected, drop is disconnectPlayer and nextGame is requestNextRound; requestNextRound takes an optional carryOver string that the host's next round reads as ctx.carryOver

On this page