From 0e17d8ea0a2a9f860efaf64661806e901c9b6c30 Mon Sep 17 00:00:00 2001 From: CoffeeBunny Date: Tue, 9 Mar 2021 10:00:11 +0100 Subject: [PATCH] Initial commit --- README.md | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..28b246d --- /dev/null +++ b/README.md @@ -0,0 +1,49 @@ +# Ultimate Chat Client - Protocol + +This README explains in details how the protocol works for the chat client and how to use it to build your own client. + +This chat client is just a joke, and a gibberish bodge using encrypted JSON messages over MQTT. + +## Packets + +All packets have the same default headers for sending and receiving packets. +The header should be described as following: +```json5 +{ + "type": "message", // the packet type + "from": "username", // the username of the sender + "timestamp": 1615212625000 // unix timestamp (UTC) in millis of when the packet was sent +} +``` + +**Packet send message** + +Available content types are: text, cowsay, ponysay + +cowsay and ponysay requires the content-icon tag to specify the icon for the message. + +```json5 +{ +"header": { + "type": "message", + "from": "username", + "timestamp": 1615212625000, +}, +"message-id": "9c054a90-2905-474b-b688-c70b07b8f790", // the id of the message to identify it +"content-type": "text", // the message type - look at available content types below +"content-icon": "tux", // icon for the message if the type is cowsay or ponysay +"content": "your message here", // the content of the message that is sent - needs to correspond with the type +} +``` + +**Packet request messages** +```json5 +{ +"header": { + "type": "request", + "from": "username", + "timestamp": 1615212625000 +}, +"length": 420, // the amount of messages requested back in time +} +``` \ No newline at end of file