Update 'resources/Docs/DOCS.md'

This commit is contained in:
hippoz 2021-03-25 01:35:14 +02:00
parent 6d99951fe7
commit e7da5de255

View file

@ -47,23 +47,25 @@ JSON data format:
| Field | Description |
| - | - |
| token | The authentication token |
| client? | The name of the application the client is connecting from (see below) |
Example:
```json
1@{"token":"my totally real token","client":"amazing client"}
1@{"token":"my totally real token"}
```
If the token is invalid, or the connection is otherwise rejected, the client should be disconnected as soon as possible, and no YOO\_ACK should be sent.
It is suggested that the field "client" is send in the format of "(operating system)/(user agent vendor)/(user agent)/(optional full user agent string)", example: "Linux/Mozilla/Firefox/some firefox useragent string idk"
## 2:YOO\_ACK
*Part of handshake, Server to client*
Sent by the server as soon as possible after processing the YOO payload from the client.
This payload contains an empty JSON object, that may have data added to it in later versions of this software.
JSON data format:
| Field | Description |
| - | - |
| user | A [message author object](#message-author-object) |
| session_id | A UUIDv4 |
| channels | An array of [channels](#channel-object) |
Example:
```json
@ -185,6 +187,22 @@ Used mostly for messages.
| _id | The id of the channel |
| name | The name of the channel |
## Channel object
| Field | Description |
| - | - |
| _id | The id of the channel |
| name | The name of the channel |
| creator | A [user object](#user-object) |
## User object
| Field | Description |
| - | - |
| _id | The id of the user |
| name | The name of the user |
| color | A hex color that represents that user |
## Message author object
Used mostly for messages.