From 6f1c90720402415b62fb4d5e809ec7dbc1cd7f96 Mon Sep 17 00:00:00 2001 From: Loïc Blot Date: Tue, 26 Sep 2017 00:11:20 +0200 Subject: Implement mod communication channels (#6351) Implement network communication for channels * Implement ModChannel manager server side to route incoming messages from clients to other clients * Add signal handler switch on client & ModChannelMgr on client to handle channels * Add Lua API bindings + client packet sending + unittests * Implement server message sending * Add callback from received message handler to Lua API using registration method --- src/network/networkprotocol.h | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) (limited to 'src/network/networkprotocol.h') diff --git a/src/network/networkprotocol.h b/src/network/networkprotocol.h index f4258e9cd..28132396b 100644 --- a/src/network/networkprotocol.h +++ b/src/network/networkprotocol.h @@ -180,6 +180,7 @@ with this program; if not, write to the Free Software Foundation, Inc., Backwards compatibility drop Add 'can_zoom' to player object properties Add glow to object properties + Mod channels */ #define LATEST_PROTOCOL_VERSION 36 @@ -611,6 +612,22 @@ enum ToClientCommand u8[len] player name */ + TOCLIENT_MODCHANNEL_MSG = 0x57, + /* + u16 channel name length + std::string channel name + u16 channel name sender + std::string channel name + u16 message length + std::string message + */ + TOCLIENT_MODCHANNEL_SIGNAL = 0x58, + /* + u8 signal id + u16 channel name length + std::string channel name + */ + TOCLIENT_SRP_BYTES_S_B = 0x60, /* Belonging to AUTH_MECHANISM_SRP. @@ -645,6 +662,26 @@ enum ToServerCommand [0] u16 TOSERVER_INIT2 */ + TOSERVER_MODCHANNEL_JOIN = 0x17, + /* + u16 channel name length + std::string channel name + */ + + TOSERVER_MODCHANNEL_LEAVE = 0x18, + /* + u16 channel name length + std::string channel name + */ + + TOSERVER_MODCHANNEL_MSG = 0x19, + /* + u16 channel name length + std::string channel name + u16 message length + std::string message + */ + TOSERVER_GETBLOCK = 0x20, // Obsolete TOSERVER_ADDNODE = 0x21, // Obsolete TOSERVER_REMOVENODE = 0x22, // Obsolete -- cgit v1.2.3