Difference between revisions of "Player Status (API)"
(Created page with "Example call: https://api.kag2d.com/player/FliesLikeABrick/status Example output: { "playerStatus": { "action": 2, "lastUpdate": "2012-06-15 17:38:29", "serv...") |
m |
||
(2 intermediate revisions by one other user not shown) | |||
Line 16: | Line 16: | ||
} | } | ||
} | } | ||
+ | |||
+ | '''Note''' that this may contain additional keys besides playerStatus in the future, and that playerStatus may contain additional keys. | ||
+ | |||
+ | '''Note''' that the lastUpdate key will be removed and instead a Last-Modified header will be used shortly - please write code that checks for one or the other if you use this call right now. | ||
+ | |||
+ | Player actions are:<br> | ||
+ | 0: logged into client or ("opened game")<br> | ||
+ | 1: joined server<br> | ||
+ | 2: playing on server<br> | ||
+ | 3: left server<br> | ||
+ | |||
You can then make a subsequent call to [[Server Status (API)]] to get the server information, since you now have the server addresses and ports. You should dynamically select serverIPv4Address or serverIPv6Address when constructing the call for [[Server Status (API)]] since not all servers will have both (and future servers may be IPv6-only!) | You can then make a subsequent call to [[Server Status (API)]] to get the server information, since you now have the server addresses and ports. You should dynamically select serverIPv4Address or serverIPv6Address when constructing the call for [[Server Status (API)]] since not all servers will have both (and future servers may be IPv6-only!) | ||
+ | |||
+ | [[Category:API]] |
Latest revision as of 17:33, 16 December 2012
Example call:
https://api.kag2d.com/player/FliesLikeABrick/status
Example output:
{ "playerStatus": { "action": 2, "lastUpdate": "2012-06-15 17:38:29", "server": { "serverIPv4Address": "204.152.222.197", "serverIPv6Address": "2607:fcd0:1337:29::2", "serverPort": 50301 } } }
Note that this may contain additional keys besides playerStatus in the future, and that playerStatus may contain additional keys.
Note that the lastUpdate key will be removed and instead a Last-Modified header will be used shortly - please write code that checks for one or the other if you use this call right now.
Player actions are:
0: logged into client or ("opened game")
1: joined server
2: playing on server
3: left server
You can then make a subsequent call to Server Status (API) to get the server information, since you now have the server addresses and ports. You should dynamically select serverIPv4Address or serverIPv6Address when constructing the call for Server Status (API) since not all servers will have both (and future servers may be IPv6-only!)