SharedRoomKey$ ( )

Parameters

None.

Description

Returns the room's key, such as the level it plays.

A key is what a room plays. Players who give MatchSharedWorld the same key share rooms, and every copy reads the key to know what to build: the server builds that level, and so does each player's copy. Keys are any text of up to 64 bytes, such as "garden/four_corners".

Once a copy is in a room, this is the room's own key, which can differ from the one it asked for: a friend who joins by address plays the room's level, whatever they picked. Before that, it is the key this copy asked for. A server that a game server started has its room's key from the start, before the room is open, so it can build the level first.

A room started without a key takes the key of the first player who joins it with one. That is how an online test's room plays the level its player picks: build the level on the server once SharedRoomKey() is no longer "", which it is by the time SHARED_EVENT_PLAYER_JOINED comes. The key never changes after that.

For the full story - room keys, the day's choices and boards - see the Shared World guide.


See also: MatchSharedWorld, QuerySharedGame, SharedDailyKey, SubmitSharedScore, ShareKeyedEntity.

Index