From e7da5de2553c2a684cae448f87b931980442da9a Mon Sep 17 00:00:00 2001 From: hippoz Date: Thu, 25 Mar 2021 01:35:14 +0200 Subject: [PATCH] Update 'resources/Docs/DOCS.md' --- resources/Docs/DOCS.md | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/resources/Docs/DOCS.md b/resources/Docs/DOCS.md index 85e486b..c7b8563 100644 --- a/resources/Docs/DOCS.md +++ b/resources/Docs/DOCS.md @@ -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.