Which connection flow to use
We provide two connection flows, which have different use cases depending on the kind of worker and the kind of deployment you want to connect to.
In all cases, your worker contains a reference to a
Connection object after successfully connecting to the SpatialOS Runtime.
Receptionist connection flow
Use the Receptionist connection flow in the following cases:
- Connecting a server-worker or a client-worker instance to a local deployment.
- Connecting a server-worker instance to a cloud deployment.
- (For debugging) Connecting a server-worker or a client-worker instance to a cloud deployment from your local machine.
How do I connect to a cloud deployment from my local machine?
There are three steps for connecting a worker to a cloud deployment:
- In your terminal, execute
spatial cloud connect external <deployment_name>, where
<deployment_name>is the deployment you want to connect to.
- Ensure that
UseExternalIpis set to true in the connection parameters for the worker you want to connect.
- Run your worker, either in the Unity Editor or built out as if you were connecting to a local deployment.
Note that this debugging flow does not work for mobile clients. You need to use the new v13.5+ Locator connection flow instead.
For more information about the
spatial cloud connect external command, see the CLI documentation.
Locator connection flow
Use the Locator connection flow for:
- Connecting a client-worker to a cloud deployment via the SpatialOS Launcher.
- Connecting a mobile worker-instance to a cloud deployment.
- (For debugging) Connecting a server-worker or client-worker instance to a cloud deployment from your local machine.