SharedWorldService service_url$

Parameters

service_url$ - the address of your Shared World service, such as "https://play.example.com"

Description

Sets the service your game uses to meet other players.

Players meet through a Shared World service: a signalling server with a TURN relay that you deploy yourself (services/shared-world in the source repository) - there is no built-in public service. Usually you put a b3d-shared-world.json file beside your game, containing {"service":"https://play.example.com"}, and it is read when the game first connects. SharedWorldService sets the address from code instead, and then the file is not read.

Only an https:// address with no path, query or user name is accepted. It is not a secret, so never put relay passwords or keys in it. A bad address is refused, keeping the previous one, and SharedWorldError() says why. Set it before you start a session; while one is running it is refused.

For the full story - services, hosting, sharing and host migration - see the Shared World guide and its complete Shared_World_Playground.bb sample.


See also: StartSharedWorld, HostSharedWorld, JoinSharedWorld, SharedWorldError.

Index