This wiki is archived from 2021-09-05
Planetary Annihilation net API: Difference between revisions
Jump to navigation
Jump to search
| Line 1: | Line 1: | ||
[[Category:Modding]] | [[Category:Modding]] | ||
= [[File:Titans-icon.png|50px]] Planetary Annihilation net API = | = [[File:Titans-icon.png|50px]] 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 ) == | ||
Revision as of 01:08, 11 February 2017
File:Titans-icon.png 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)