1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

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
This commit is contained in:
Loïc Blot 2017-09-26 00:11:20 +02:00 committed by GitHub
parent 6df312a608
commit 6f1c907204
37 changed files with 1206 additions and 39 deletions

View file

@ -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