ApplicationProperty
The ApplicationProperty is an element that adds meaning to the Application element. E.g. you can define that an application uses a certain network port, or requires a password or multiple ports, and a preset password, or have the system generate a unique password for each ApplicationInstance. These properties are necessary for the system to function properly.
ApplicationProperties can only be set for the Application type Game.
Element structure
Property | Value type | Required | Read-only | Description |
---|---|---|---|---|
propertyId | string | N/A | Yes | Unique identifier of the element |
propertyType | int | Yes | No | Type ID of the property |
propertyKey | string | Yes | No | The name of the property |
propertyValue | mixed | Only for network port | No | The value of the property |
propertyKey constraints
The characters allowed for a propertyKey are : a-z, A-Z, 0-9, _
A property key must start with a lowercase character.
The maximum length of a propertyKey is 50 characters.
propertyValue constraints
Any UTF-8 character is allowed in a propertyValue.
The maximum length of a propertyValue is 150 characters.
propertyType
ApplicationProperty elements consist of a propertyType
, a propertyKey
and a propertyValue
. The propertyType
indicates the functionality of the property. The propertyKey
gives the property a name and the value
a value. Not all property types require a value. E.g. if you have a property of propertyType
password16
, you can leave propertyValue
empty. This means we will generate a password, in this case with a length of 16 characters. If however you do enter a propertyValue
, then we take that as the password and the system will not generate a new random password. You can find all available property types and usages in the next chapter.
Available property types
A propertyType is indicated by its numerical ID. The following types are available:
ID | Type | Value type | Value required? | Description |
---|---|---|---|---|
0 | raw value | mixed | yes | A custom raw value. This property's key and value will be passed to ApplicationBuilds, ApplicationInstances and labels as-is. |
1 | public network port | 0 or a number between 10240 - 29999 (inclusive) | yes | Indicates a default or random network port for your application to use. Please see the paragraph below for more information. |
2 | password8 | string | no | An 8 character password. If no value provided, we generate a unique password for every ApplicationInstance. |
3 | password16 | string | no | A 16 character password. If no value provided, we generate a unique password for every ApplicationInstance. |
4 | password24 | string | no | A 24 character password. If no value provided, we generate a unique password for every ApplicationInstance. |
5 | public network port range | a number between 2 and 200 | yes | A number indicating the size of the desired public port range. |
6 | private network port | 0 or a number between 30000 - 49151 | yes | Indicates a default or random network port for your application to use. Please see the paragraph below for more information. |
7 | private network port range | a number between 2 and 200 | yes | A number indicating the size of the desired private port range. |
Public network port property explained
When the platform deploys a new ApplicationInstance and you have added an ApplicationProperty of type public network port
or private network port
(or multiple), it will find a unique network port to use, per host. Which port is selected depends on the following logic:
If you enter a value of 0 for the network port property, the platform will find a completely random port within the range of 10240 - 29999 (public range) or 30000 - 49151 (private range).
If you enter a value between 10240 - 29999 (public) or 30000 - 49151 (private), the platform will take that value as the starting point to find a free port. If the given value is a free network port, then that will be used. If the port is already occupied by another instance, it is incremented and checked for availability again. This increment continues until a free network ports has been found for your application instance to use.
Info
We recommend always setting a network port value to 0 for random port generation. Only use specific values if you have a reason to do so.
Public network ports can be accessed from the internet and as such must be used for connections of players to your game server.
Public network port range property explained
Just like with the single port property type, port ranges will be generated uniquely for each ApplicationInstance.
In the property value, you indicate the size of the desired port range by entering a number between 2 - 200 (inclusive). Our platform will then generate a port range for each ApplicationInstance and make it available via platform variables. The port range notation of the variable at that point will be e.g.: 10500-10520
.
Private network port property explained
All rules for public network ports also apply for private network ports. The only difference is that all ports generated for a private network port are not accessible from the internet and should only be used for internal services.
Private network port range property explained
All rules for public network port ranges also apply for private network port ranges. The only difference is that all ports generated for a private network port range are not accessible from the internet and should only be used for internal services.
Property inheritance
An Application's properties will be inherited by all ApplicationBuild elements belonging to said Application.
Property value overrides
An ApplicationProperty's value can be overridden at later stages, in the listed order:
- an ApplicationBuild will inherit an Application's properties. Its values can be overridden in the ApplicationBuild (API documentation)
- a DeploymentRegion can override a property on a per-region basis. This can be useful if you want to define different property values for each deployment region, allowing you to start your applications with region-based startup parameters (API documentation)
As such, an override on DeploymentRegion level always wins. If no override for a DeploymentRegion is present, an override of the ApplicationBuild will win. If no override for an ApplicationBuild is present, the original property value defined for the Application will win.
Property usage
Every property you define will become available as platform variables that can be used in configuration related properties: ApplicationBuild.startupParameters and ApplicationBuildConfiguration.configContents. Please see the platform variables topic for more details.
Restrictions
You can assign any number of ApplicationProperties to an Application. There is no limitation there. The only rule is that you must have unique propertyKey names per Application.
Relations
See also: Application element relations