summaryrefslogtreecommitdiff
path: root/src/network/networkprotocol.h
diff options
context:
space:
mode:
authorLoïc Blot <nerzhul@users.noreply.github.com>2017-07-16 10:47:31 +0200
committerGitHub <noreply@github.com>2017-07-16 10:47:31 +0200
commit7ddf67aa1478813e12a5fcdfb4986b9e5adfe62f (patch)
tree0bbbee7ed9470e0de149ec9bdaf6a51693ec0e22 /src/network/networkprotocol.h
parentecbc972ea6a2371d64b1d9c9576d31be36b8ae6a (diff)
downloadminetest-7ddf67aa1478813e12a5fcdfb4986b9e5adfe62f.tar.gz
minetest-7ddf67aa1478813e12a5fcdfb4986b9e5adfe62f.tar.bz2
minetest-7ddf67aa1478813e12a5fcdfb4986b9e5adfe62f.zip
Chat protocol rewrite (#5117)
* New TOCLIENT_CHAT_MESSAGE packet * Rename old packet to TOCLIENT_CHAT_MESSAGE_OLD for compat * Handle TOCLIENT_CHAT_MESSAGE new structure client side * Client chat queue should use a specific object * SendChatMessage: use the right packet depending on protocol version (not complete yet) * Add chatmessage(type) objects and handle them client side (partially) * Use ChatMessage instead of std::wstring server side * Update with timestamp support
Diffstat (limited to 'src/network/networkprotocol.h')
-rw-r--r--src/network/networkprotocol.h22
1 files changed, 20 insertions, 2 deletions
diff --git a/src/network/networkprotocol.h b/src/network/networkprotocol.h
index 8304d3003..759334839 100644
--- a/src/network/networkprotocol.h
+++ b/src/network/networkprotocol.h
@@ -160,9 +160,17 @@ with this program; if not, write to the Free Software Foundation, Inc.,
instead of guessing based on the active object list.
PROTOCOL VERSION 34:
Add sound pitch
+ PROTOCOL VERSION 35:
+ Rename TOCLIENT_CHAT_MESSAGE to TOCLIENT_CHAT_MESSAGE_OLD (0x30)
+ Add TOCLIENT_CHAT_MESSAGE (0x2F)
+ This chat message is a signalisation message containing various informations:
+ * timestamp
+ * sender
+ * type (RAW, NORMAL, ANNOUNCE, SYSTEM)
+ * content
*/
-#define LATEST_PROTOCOL_VERSION 34
+#define LATEST_PROTOCOL_VERSION 35
// Server's supported network protocol range
#define SERVER_PROTOCOL_VERSION_MIN 24
@@ -307,7 +315,17 @@ enum ToClientCommand
// (oops, there is some gap here)
- TOCLIENT_CHAT_MESSAGE = 0x30,
+ TOCLIENT_CHAT_MESSAGE = 0x2F,
+ /*
+ u8 version
+ u8 message_type
+ u16 sendername length
+ wstring sendername
+ u16 length
+ wstring message
+ */
+
+ TOCLIENT_CHAT_MESSAGE_OLD = 0x30, // Deprecated by proto v35
/*
u16 length
wstring message