Creating

Whether a player can open their own instance (and what kind) is decided by the game's gamehoster-game-create setting. The generated client exposes the Gamehoster.Create functions to match: with none they aren't available at all, and otherwise a player can make a new room of the allowed access type.

Provisional: this tracks the frontend API as it settles.

What the setting allows

Game's createWhat the front end may do
noneNothing. Gamehoster.Create is not offered; players only ever join existing instances.
publicCreate a room that is listed in Browse for anyone to join.
passwordCreate a listed room, but set a password others must supply to get in.
privateCreate an unlisted room, reached only by the invite it hands back.

The client only ever offers the modes the game permits, so a player can't open a kind of room the definition didn't allow.

Opening a room

Call Gamehoster.Create with any details the mode needs: a password for password. On success you're placed into the new instance just as if you had joined one, and it's live for others to find (or reach by invite) straight away.

const created = Gamehoster.Create()
created.onSuccess = (instance) => enter(instance)
created.onError   = (error) => showError(error)   // not allowed, or bad details
Creating a public instance

For a password room, pass the password the joiner will need; for private, the result carries the invite the player can share.