Sites

Menu

Command line arguments

In the SpatialOS GDK for Unreal, you can use GDK-specific command line arguments to customize how the GDK runs. For example, you can specify how a worker instance connects to a deployment or choose which network stack a worker instance uses to communicate with the SpatialOS Runtime.

Connection arguments

You can use one of the following methods to connect a worker instance to a SpatialOS deployment:

  • Use the Receptionist to connect a client-worker or server-worker instance to a local or cloud deployment.
  • Use the Locator to connect a client-worker instance to a cloud deployment.

Each time you connect one worker instance to a deployment, you can choose only one method for connection. You might need to add both general connection arguments and method-specific arguments.

Note: If you specify both Receptionist arguments and Locator arguments to connect one worker instance to a deployment, errors might occur.

When you use either method to connect a worker instance to a deployment, you can add the following general connection arguments:

Argument Type Description
-workerId string

The worker ID that the worker instance uses to connect to a SpatialOS deployment. 

If you don’t specify a value, the worker instance generates a random worker ID and uses it to connect to a deployment.

-workerType string

The worker type that the worker instance uses to connect to a SpatialOS deployment. In the GDK, you can specify the following worker types:

  • UnrealWorker for server-workers
  • UnrealClient for client-workers

For example, to connect a server-worker instance to a local deployment, run:

MyProject.exe MyMap -server -workerType UnrealWorker

Here are the default settings when you launch a deployment without specifiying any workerType:

  • When you run the command with the -server argument, you connect a server-worker instance to the deployment.
  • When you run the command without the -server argument, you connect a client-worker instance to the deployment.
-useExternalIpForBridge bool

Set to true to connect a worker instance to a deployment in either of the following ways:

  • To connect to a deployment on a different machine from the worker instance’s machine (not hosted in the cloud).
  • To connect to a cloud deployment using spatial cloud connect external.

Default: false

-linkProtocol string The network stack that the worker instance uses to communicate with the SpatialOS Runtime. The available options are KCP and TCP

Note: The GDK does not support the RakNet network stack.

Default: KCP

Receptionist arguments

When you connect a client-worker or server-worker instance to a deployment without the authentication flow, you can add the following Receptionist arguments before you launch the deployment:

Argument Type Description
-receptionistHost string The IP of the deployment that the worker instance connects to.

Default: 127.0.0.1

-receptionistPort string The port of the deployment that the worker instance connects to.

Default: 7777

For example, to connect a server-worker instance to a deployment on a different machine using Receptionist, run:

MyProject.exe MyMap -server -workerType UnrealWorker -receptionistHost <IP of a different machine> -useExternalIpForBridge true

Locator arguments

When you use the SpatialOS Launcher or player authentication service to connect a client-worker instance to a deployment, add the following Locator arguments before you launch the deployment:

Argument Type Description
-playerIdentityToken string The PlayerIdentityToken (PIT) that the client-worker instance passes to the Locator service to prove its player identity within SpatialOS.
-loginToken string The LoginToken that the client-worker instance passes to the Locator service to be permitted to join the deployment.

Other arguments

In addition to the arguments for worker connections, you can use the following arguments for other settings:

Argument Type Descrption
-NoLogToSpatial flag Use this flag to stop a server-worker instance from sending warning or error log messages to SpatialOS.

Note: You can add this flag to help improve performance if SpatialOS is generating a large number of warning or error log messages.

-enableProtocolLogging bool Set to true to enable protocol logging to record any data exchanged between the worker instance and the deployment it's connected to, as well as other significant events.

Default:false

-protocolLoggingPrefix string The path that the protocol logs are generated to.

Note: If you enable protocol logging, you must set this value.

-OverrideSpatialNetworking bool Use this argument to override any other setting that you've configured for the networking mode:
  • When you run the command with the -OverrideSpatialNetworking or the -OverrideSpatialNetworking=true argument, you enable SpatialOS networking.
  • When you run the command with the -OverrideSpatialNetworking=false argument, you disable SpatialOS networking and use native Unreal networking instead.

Map travel URL options

In the GDK, so that a client-worker instance executes a map travel, you can add the following URL options to the ClientTravel URL:

Option Type Description
locator flag

To connect a client-worker instance to a deployment using the Locator, add this flag to the ClientTravel URL.

Note: If you add this option, ensure that you also add the playeridentity option and the login option to the URL.
playeridentity string The PlayerIdentityToken (PIT) that the client-worker instance passes to the Locator service to prove its player identity within SpatialOS.
login
string The LoginToken that the client-worker instance passes to the Locator service to be permitted to join the deployment.
useExternalIpForBridge
bool

Set to true to connect a client-worker instance to a deployment in either of the following ways:

  • To connect to a deployment on a different machine from the worker instance's machine (not hosted in the cloud).

  • To connect to a cloud deployment using spatial cloud connect external.

Default: false


——
2019-06-13 Page added with editorial review

Search results

Was this page helpful?

Thanks for letting us know!

Thanks for your feedback

Need more help? Ask on the forums