This wiki is archived from 2021-09-05

Planetary Annihilation net API: Difference between revisions

From Planetary Annihilation: TITANS and Classic PA Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 4: Line 4:
== api.net.startGame( region, mode ) ==
== api.net.startGame( region, mode ) ==


create a new local or Uber game:
{| class="wikitable"
* region: local or valid Uber region string
!region
* mode: Config or gw optionally prefixed with content eg PAExpansion1:Config for Titans
|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
|}


returns object with:
== api.net.joinGame( params ) ==
* LobbyId (string)
* ServerHostname (string)
* ServerPort (string)
* Ticket (string)
* Expires (string)


== api.net.joinGame( params ) ==
Joins an Uber game based on a lobbyId.
 
{| class="wikitable"
!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
|}


joins an Uber game based on a lobbyId:
Internally retries 5 times baaed on PollWaitTimeMS.
* lobbyId (string)
* all other params are ignored


returns object with:
Currently never returns if invalid lobbyId.
* ServerHostName
* ServerPort
and if lobbyId resolved:
* LobbyId
* Ticket
* Expires
and if delayed:
* PollWaitTimeMS


== api.net.connect( params ) ==
== api.net.connect( params ) ==


joins an Uber game based on a lobbyId:
Connects to a game server.
* lobbyId (string)
 
* all other params are ignored
{| class="wikitable"
!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:


returns object with:
{| class="wikitable"
* ServerHostName
!password
* ServerPort
|optional
|object
|
|-
!uberid
|mandatory for uber servers
|string
|unique player identifier
|-
!uuid
|optional
|string
|unique game identifier for invites to private game
|}

Revision as of 21:57, 17 April 2016

File:Titans-icon.png Planetary Annihilation net API

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