This wiki is archived from 2021-09-05
Planetary Annihilation net API: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
mNo edit summary |
||
(2 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
[[Category:Modding]] | [[Category:Modding]] | ||
= | = Planetary Annihilation net API = | ||
Do NOT use these API directly. | |||
The preferred approach is to make use of the connect to game scene. | |||
== api.net.startGame( region, mode ) == | == api.net.startGame( region, mode ) == | ||
Line 150: | Line 154: | ||
|unique game identifier for invites to private game | |unique game identifier for invites to private game | ||
|} | |} | ||
One of the following handlers should be fired: | |||
* login_accepted | |||
* login_rejected | |||
* connection_failed (does not currently fire) |
Latest revision as of 11:23, 9 September 2021
Planetary Annihilation net API
Do NOT use these API directly.
The preferred approach is to make use of the connect to game scene.
api.net.startGame( region, mode )
region | mandatory | string | uber region: Australia, USCentral or EUWest |
---|---|---|---|
mode | mandatory | string | Config or gw optionally prefixed with content eg PAExpansion1:Config for Titans |
returns | object | ||
LobbyId | string | unique game identifier | |
ServerHostName | string | hostname or IP address | |
ServerPort | string | port number | |
Ticket | string | uber game ticket | |
Expires | string | ISO 8601 UTC timestamp |
api.net.joinGame( params )
Joins an Uber game based on a lobbyId.
params | mandatory | object | only lobbyId is used |
---|---|---|---|
returns | object | ||
LobbyId | string | unique game identifier | |
ServerHostName | string | hostname or IP address | |
ServerPort | string | port number | |
Ticket | string | uber game ticket | |
Expires | string | ISO 8601 UTC timestamp |
Internally retries 5 times baaed on PollWaitTimeMS.
Currently never returns if invalid lobbyId.
api.net.connect( params )
Connects to a game server.
params | mandatory | object | |
---|---|---|---|
host | mandatory | string | hostname or IP address |
port | mandatory | string | port number |
display_name | mandatory | string | |
ticket | mandatory for uber servers | string | returned from startGame or joinGame |
with_content | optional | string | PAExpansion1 for Titans |
clientData | mandatory for uber servers | object |
clientData:
password | optional | object | |
---|---|---|---|
uberid | mandatory for uber servers | string | unique player identifier |
uuid | optional | string | unique game identifier for invites to private game |
One of the following handlers should be fired:
- login_accepted
- login_rejected
- connection_failed (does not currently fire)