1 #ifndef CLIENTSERVER_HEADER
2 #define CLIENTSERVER_HEADER
4 #define PROTOCOL_ID 0x4f457403
10 Server's reply to TOSERVER_INIT.
11 Sent second after connected.
14 [2] u8 deployed version
15 [3] v3s16 player's position + v3f(0,BS/2,0) floatToInt'd
18 TOCLIENT_BLOCKDATA = 0x20, //TODO: Multiple blocks
19 TOCLIENT_ADDNODE = 0x21,
20 TOCLIENT_REMOVENODE = 0x22,
22 TOCLIENT_PLAYERPOS = 0x23,
25 // Followed by an arbitary number of these:
26 // Number is determined from packet length.
28 [N+2] v3s32 position*100
29 [N+2+12] v3s32 speed*100
30 [N+2+12+12] s32 pitch*100
31 [N+2+12+12+4] s32 yaw*100
34 TOCLIENT_PLAYERINFO = 0x24,
37 // Followed by an arbitary number of these:
38 // Number is determined from packet length.
43 TOCLIENT_OPT_BLOCK_NOT_FOUND = 0x25, // Not used
45 TOCLIENT_SECTORMETA = 0x26, // Not used
49 [3...] v2s16 pos + sector metadata
52 TOCLIENT_INVENTORY = 0x27,
55 [2] serialized inventory
58 TOCLIENT_OBJECTDATA = 0x28,
63 u16 number of player positions
80 Sent first after connected.
83 [2] u8 SER_FMT_VER_HIGHEST
84 [3] u8[20] player_name
87 TOSERVER_INIT2 = 0x11,
89 Sent as an ACK for TOCLIENT_INIT.
90 After this, the server can send data.
92 [0] u16 TOSERVER_INIT2
95 TOSERVER_GETBLOCK=0x20, // Not used
96 TOSERVER_ADDNODE = 0x21, // Not used
97 TOSERVER_REMOVENODE = 0x22, // deprecated
99 TOSERVER_PLAYERPOS = 0x23,
102 [2] v3s32 position*100
103 [2+12] v3s32 speed*100
104 [2+12+12] s32 pitch*100
105 [2+12+12+4] s32 yaw*100
108 TOSERVER_GOTBLOCKS = 0x24,
117 TOSERVER_DELETEDBLOCKS = 0x25,
126 TOSERVER_ADDNODE_FROM_INVENTORY = 0x26, // deprecated
133 TOSERVER_CLICK_OBJECT = 0x27,
137 [2] u8 button (0=left, 1=right)
143 TOSERVER_CLICK_GROUND = 0x28,
147 [2] u8 button (0=left, 1=right)
148 [3] v3s16 nodepos_undersurface
149 [9] v3s16 nodepos_abovesurface
153 TOSERVER_RELEASE = 0x29,
160 TOSERVER_SIGNTEXT = 0x30,
170 // Flags for TOSERVER_GETBLOCK
171 #define TOSERVER_GETBLOCK_FLAG_OPTIONAL (1<<0)