Skip to content

Platform Variables

The ONE Game Hosting service has a feature called Platform Variables, which can be used for configuration of your applications. Platform variables come in two types:

  • variables pre-defined by the platform
  • user defined variables

These variables can be used inside the startupParameters property of an ApplicationBuild and inside configuration files (ApplicationBuildConfiguration elements), submitted for an ApplicationBuild. Examples are provided near the end of this page.

Platform defined variables

The platform supplies a number of predefined variables:

Variable name Description
VARSERVERID The ID of the (physical or virtual) server an application is deployed on
VARHOSTID The ID of the host an application is deployed on
VARHOSTNAME The hostname of the host an application is deployed on
VARPLAYERS Maximum number of players allowed on a game server
VARCONTINENT The name of the continent in which the host is located
VARCOUNTRYCODE The ISO 3166-1 alpha-2 code of the country in which the host is located
VARCOUNTRY The full name of the country in which the host is located
VARDCLOCATIONID The ID of the data center location in which the host is located
VARDCLOCATION The name of the data center location in which the host is located
VARDEPLOYMENTENVIRONMENTID The ID of the DeploymentEnvironment of this ApplicationInstance
VARDEPLOYMENTENVIRONMENTNAME The name of the DeploymentEnvironment of this ApplicationInstance
VARREGIONID The identifier of the DeploymentRegion in which the host is located
VARREGIONNAME The name of the DeploymentRegion in which the host is located
VARPROVIDER The name of the owner of the (physical or virtual) server (e.g. i3D.net, GCP, AWS, etc.)
VARFLEETID The identifier of the Fleet in which the host is located
VARFLEETNAME The name of the Fleet in which the host is located
VARAPPLICATIONID The identifier of the Application element belonging to the ApplicationInstance that is being deployed
VARAPPLICATIONBUILDID The identifier of the ApplicationBuild element that is being deployed
VARAPPLICATIONINSTANCEID The ID of the ApplicationInstance that's being deployed
VARIPV4PRIVATE RFC-1918 IPv4 address of the host an application is deployed on
VARIPV4PUBLIC Public IPv4 address of the host an application is deployed on
VARIPV4BINDING IPv4 address that should be used by an application to bind on (e.g. a cloud VM will locally only see the host's private IP and not the public IP)
VARIPV6 IPv6 address of the host an application is deployed on
VARIPV6BINDING IPv6 address that should be used by an application to bind on (e.g. a cloud VM will locally only see the host's private IP and not the public IP)
Table 1: Platform defined VARiables

User defined variables

Alongside the platform defined VARiables, there are also custom ones that are derived from ApplicationProperty elements. For each ApplicationProperty, a VARiable is generated. Some examples of this:

For a property named game_port, a VARiable named VAR_GAME_PORT is generated. For a property named managementport, a VARiable named VAR_MANAGEMENTPORT is generated. For a property named management_password, a VARiable named VAR_MANAGEMENT_PASSWORD is generated.

As you may already see, there is a visual difference between platform-defined VARiables and custom ones. The custom ones have the prefix VAR_ (with an underscore), whereas the platform-defined ones lack the underscore.

All VARiables are in upper case.

Please note that startParameters VAR must have quotations surrounding it when using JSON:

{
 "startParameters": "dclocation: \\\"<YOUR PARAMETER>\\\" regionId:2434242"
}

Examples

An example of VAR usage inside ApplicationBuild.startupParameters:

-ip VARIPV4BINDING -port VAR_GAME_PORT -arcusport VAR_MANAGEMENTPORT -name "Bluewolf VAR_GAME_PORT" -applicationInstanceId VARAPPLICATIONINSTANCEID -maxplayers 8

An example of VAR usage inside ApplicationBuildConfiguration.configContent:

// Server name
hostname=Bluewolf VARAPPLICATIONINSTANCEID

// Arcus management passsword
arcus_password=VAR_MANAGEMENT_PASSWORD

// Server password
srv_password=VAR_SRVPASSWORD

// etc

You can concatenate VARiables if you want - they do not have to be separated by a space:

-regionIdent VARREGIONNAME-VARAPPLICATIONINSTANCEID

It will even work without a glue character:

-regionIdent VARREGIONNAMEVARAPPLICATIONINSTANCEID

Underscore is not a glue character

Remember `_` is a character that can exist in a VAR name, so **this will not work**: `-regionIdent VARREGIONNAME_VARAPPLICATIONINSTANCEID`