update documentation to be more accurate to the current implementation

This commit is contained in:
hippoz 2021-09-08 00:41:38 +03:00
parent aa7c838164
commit f1b6da19a2
Signed by: hippoz
GPG key ID: 7C52899193467641

View file

@ -1,6 +1,4 @@
# Waffle API docs (currently not implemented) # Waffle API docs
*Again, this IS NOT YET IMPLEMENTED IN THE CURRENT BRAINLET RELEASE*
# Gateway # Gateway
@ -28,11 +26,11 @@ Packets can also have JSON as a payload:
Sent by the server to the client as soon as possible after they connect to the gateway. Sent by the server to the client as soon as possible after they connect to the gateway.
This payload can contain a JSON object with various information about the server. It should be relied on only when absolutely necessary. This payload contains a `pingInterval` property. Every *pingInterval*, the client must send a packet simply containing `7@1`. This is the ACTION_PING payload. If the client does not send this payload at the right time, it is disconnected.
Example: Example:
```json ```json
0@{} 0@{"pingInterval":14750}
``` ```
## 1:YOO ## 1:YOO
@ -114,28 +112,22 @@ Example:
*Auth required, Server to client* *Auth required, Server to client*
Sent by the server after YOO\_ACK, and otherwise when the entire status needs to be updated. Usually, this will be sent only once, and when subsequent user status updates need to happen, EVENT\_CHANNEL\_MEMBER\_UPDATE should be sent. An object containing a list of user presences which were updated, where the keys are the user ids and the values are [user presence objects](#user-presence-object).
JSON data format (this ones tough):
Contains a JSON object, where each key is a channel id and each property is an array of [user presence objects](#user-presence-object).
Example: Example:
```json ```json
6@{"totallyrealid":[{_id:"totallyrealuserid",username:"totallyrealusername",status:1,status_text:"hello"}]} 6@{"userid":{_id:"userid",username:"username123",status:1,status_text:"hello"}}
``` ```
## 7:EVENT\_CHANNEL\_MEMBER\_UPDATE ## 7:ACTION_PING
*Auth required, Server to client* *Auth required, Client to server*
Sent by the server when the status of a member changes. Of course, the client has to be in a channel with that member in order to receive this update. Sent by the client every `pingInterval`. The payload of this packet must always be `1`.
JSON data format:
It's just a [user presence object](#user-presence-object).
Example: Example:
```json ```json
7@{_id:"totallyrealuserid",username:"totallyrealusername",status:1,status_text:"hello"} 7@1
``` ```
## 21:ACTION_VOICE_REQUEST_SESSION ## 21:ACTION_VOICE_REQUEST_SESSION