1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-08-06 17:41:04 +00:00

Clean up client and server command sending / tables

This commit is contained in:
sfan5 2024-01-24 18:23:11 +01:00
parent 2b99dabdac
commit 397682a5b0
9 changed files with 79 additions and 119 deletions

View file

@ -251,7 +251,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
typedef u16 session_t;
enum ToClientCommand
enum ToClientCommand : u16
{
TOCLIENT_HELLO = 0x02,
/*
@ -288,9 +288,7 @@ enum ToClientCommand
u8 (bool) reconnect
*/
TOCLIENT_INIT_LEGACY = 0x10, // Obsolete
TOCLIENT_BLOCKDATA = 0x20, //TODO: Multiple blocks
TOCLIENT_BLOCKDATA = 0x20,
TOCLIENT_ADDNODE = 0x21,
/*
v3s16 position
@ -299,23 +297,15 @@ enum ToClientCommand
*/
TOCLIENT_REMOVENODE = 0x22,
TOCLIENT_PLAYERPOS = 0x23, // Obsolete
TOCLIENT_PLAYERINFO = 0x24, // Obsolete
TOCLIENT_OPT_BLOCK_NOT_FOUND = 0x25, // Obsolete
TOCLIENT_SECTORMETA = 0x26, // Obsolete
TOCLIENT_INVENTORY = 0x27,
/*
[0] u16 command
[2] serialized inventory
*/
TOCLIENT_OBJECTDATA = 0x28, // Obsolete
TOCLIENT_TIME_OF_DAY = 0x29,
/*
u16 time (0-23999)
Added in a later version:
f1000 time_speed
*/
@ -337,8 +327,6 @@ enum ToClientCommand
bool should_be_cached
*/
// (oops, there is some gap here)
TOCLIENT_CHAT_MESSAGE = 0x2F,
/*
u8 version
@ -349,8 +337,6 @@ enum ToClientCommand
wstring message
*/
TOCLIENT_CHAT_MESSAGE_OLD = 0x30, // Obsolete
TOCLIENT_ACTIVE_OBJECT_REMOVE_ADD = 0x31,
/*
u16 count of removed objects
@ -424,26 +410,13 @@ enum ToClientCommand
string url
*/
TOCLIENT_TOOLDEF = 0x39,
/*
u32 length of the next item
serialized ToolDefManager
*/
TOCLIENT_NODEDEF = 0x3a,
/*
u32 length of the next item
serialized NodeDefManager
*/
TOCLIENT_CRAFTITEMDEF = 0x3b,
/*
u32 length of the next item
serialized CraftiItemDefManager
*/
TOCLIENT_ANNOUNCE_MEDIA = 0x3c,
/*
u32 number of files
for each texture {
@ -647,8 +620,6 @@ enum ToClientCommand
*/
TOCLIENT_DELETE_PARTICLESPAWNER_LEGACY = 0x48, // Obsolete
TOCLIENT_HUDADD = 0x49,
/*
u32 id
@ -882,7 +853,7 @@ enum ToClientCommand
TOCLIENT_NUM_MSG_TYPES = 0x64,
};
enum ToServerCommand
enum ToServerCommand : u16
{
TOSERVER_INIT = 0x02,
/*
@ -895,14 +866,10 @@ enum ToServerCommand
std::string player name
*/
TOSERVER_INIT_LEGACY = 0x10, // Obsolete
TOSERVER_INIT2 = 0x11,
/*
Sent as an ACK for TOCLIENT_INIT.
Sent as an ACK for TOCLIENT_AUTH_ACCEPT.
After this, the server can send data.
[0] u16 TOSERVER_INIT2
*/
TOSERVER_MODCHANNEL_JOIN = 0x17,
@ -925,10 +892,6 @@ enum ToServerCommand
std::string message
*/
TOSERVER_GETBLOCK = 0x20, // Obsolete
TOSERVER_ADDNODE = 0x21, // Obsolete
TOSERVER_REMOVENODE = 0x22, // Obsolete
TOSERVER_PLAYERPOS = 0x23,
/*
[0] u16 command
@ -961,12 +924,6 @@ enum ToServerCommand
...
*/
TOSERVER_ADDNODE_FROM_INVENTORY = 0x26, // Obsolete
TOSERVER_CLICK_OBJECT = 0x27, // Obsolete
TOSERVER_GROUND_ACTION = 0x28, // Obsolete
TOSERVER_RELEASE = 0x29, // Obsolete
TOSERVER_SIGNTEXT = 0x30, // Obsolete
TOSERVER_INVENTORY_ACTION = 0x31,
/*
See InventoryAction in inventorymanager.h
@ -978,16 +935,11 @@ enum ToServerCommand
wstring message
*/
TOSERVER_SIGNNODETEXT = 0x33, // Obsolete
TOSERVER_CLICK_ACTIVEOBJECT = 0x34, // Obsolete
TOSERVER_DAMAGE = 0x35,
/*
u8 amount
*/
TOSERVER_PASSWORD_LEGACY = 0x36, // Obsolete
TOSERVER_PLAYERITEM = 0x37,
/*
Sent to change selected item.
@ -1063,8 +1015,6 @@ enum ToServerCommand
u32 token
*/
TOSERVER_BREATH = 0x42, // Obsolete
TOSERVER_CLIENT_READY = 0x43,
/*
u8 major