improve mobile API doc

This commit is contained in:
Thibault Duplessis 2014-05-10 10:24:34 +02:00
parent 7cd8854da2
commit 4dc4a6ebf7

View file

@ -43,3 +43,13 @@ The client should ping the server every second.
```javascript
socket.send(JSON.stringify({t: 'p', v: socketVersion}));
```
## Pong
The server answers client pings with a message of type `n`, containing the number of online players.
```javascript
{t: 'n', d: 1570}
```
The delay between `ping` and `pong` can be used to calculate the client lag.