clientserver.h 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801
  1. /*
  2. Minetest
  3. Copyright (C) 2010-2013 celeron55, Perttu Ahola <celeron55@gmail.com>
  4. This program is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU Lesser General Public License as published by
  6. the Free Software Foundation; either version 2.1 of the License, or
  7. (at your option) any later version.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU Lesser General Public License for more details.
  12. You should have received a copy of the GNU Lesser General Public License along
  13. with this program; if not, write to the Free Software Foundation, Inc.,
  14. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  15. */
  16. #ifndef CLIENTSERVER_HEADER
  17. #define CLIENTSERVER_HEADER
  18. #include "util/string.h"
  19. /*
  20. changes by PROTOCOL_VERSION:
  21. PROTOCOL_VERSION 3:
  22. Base for writing changes here
  23. PROTOCOL_VERSION 4:
  24. Add TOCLIENT_MEDIA
  25. Add TOCLIENT_TOOLDEF
  26. Add TOCLIENT_NODEDEF
  27. Add TOCLIENT_CRAFTITEMDEF
  28. Add TOSERVER_INTERACT
  29. Obsolete TOSERVER_CLICK_ACTIVEOBJECT
  30. Obsolete TOSERVER_GROUND_ACTION
  31. PROTOCOL_VERSION 5:
  32. Make players to be handled mostly as ActiveObjects
  33. PROTOCOL_VERSION 6:
  34. Only non-cached textures are sent
  35. PROTOCOL_VERSION 7:
  36. Add TOCLIENT_ITEMDEF
  37. Obsolete TOCLIENT_TOOLDEF
  38. Obsolete TOCLIENT_CRAFTITEMDEF
  39. Compress the contents of TOCLIENT_ITEMDEF and TOCLIENT_NODEDEF
  40. PROTOCOL_VERSION 8:
  41. Digging based on item groups
  42. Many things
  43. PROTOCOL_VERSION 9:
  44. ContentFeatures and NodeDefManager use a different serialization
  45. format; better for future version cross-compatibility
  46. Many things
  47. PROTOCOL_VERSION 10:
  48. TOCLIENT_PRIVILEGES
  49. Version raised to force 'fly' and 'fast' privileges into effect.
  50. Node metadata change (came in later; somewhat incompatible)
  51. PROTOCOL_VERSION 11:
  52. TileDef in ContentFeatures
  53. Nodebox drawtype
  54. (some dev snapshot)
  55. TOCLIENT_INVENTORY_FORMSPEC
  56. (0.4.0, 0.4.1)
  57. PROTOCOL_VERSION 12:
  58. TOSERVER_INVENTORY_FIELDS
  59. 16-bit node ids
  60. TOCLIENT_DETACHED_INVENTORY
  61. PROTOCOL_VERSION 13:
  62. InventoryList field "Width" (deserialization fails with old versions)
  63. PROTOCOL_VERSION 14:
  64. Added transfer of player pressed keys to the server
  65. Added new messages for mesh and bone animation, as well as attachments
  66. GENERIC_CMD_SET_ANIMATION
  67. GENERIC_CMD_SET_BONE_POSITION
  68. GENERIC_CMD_SET_ATTACHMENT
  69. PROTOCOL_VERSION 15:
  70. Serialization format changes
  71. PROTOCOL_VERSION 16:
  72. TOCLIENT_SHOW_FORMSPEC
  73. PROTOCOL_VERSION 17:
  74. Serialization format change: include backface_culling flag in TileDef
  75. Added rightclickable field in nodedef
  76. TOCLIENT_SPAWN_PARTICLE
  77. TOCLIENT_ADD_PARTICLESPAWNER
  78. TOCLIENT_DELETE_PARTICLESPAWNER
  79. PROTOCOL_VERSION 18:
  80. damageGroups added to ToolCapabilities
  81. sound_place added to ItemDefinition
  82. PROTOCOL_VERSION 19:
  83. GENERIC_CMD_SET_PHYSICS_OVERRIDE
  84. PROTOCOL_VERSION 20:
  85. TOCLIENT_HUDADD
  86. TOCLIENT_HUDRM
  87. TOCLIENT_HUDCHANGE
  88. TOCLIENT_HUD_SET_FLAGS
  89. PROTOCOL_VERSION 21:
  90. TOCLIENT_BREATH
  91. TOSERVER_BREATH
  92. range added to ItemDefinition
  93. drowning, leveled and liquid_range added to ContentFeatures
  94. stepheight and collideWithObjects added to object properties
  95. version, heat and humidity transfer in MapBock
  96. automatic_face_movement_dir and automatic_face_movement_dir_offset
  97. added to object properties
  98. PROTOCOL_VERSION 22:
  99. add swap_node
  100. PROTOCOL_VERSION 23:
  101. TOSERVER_CLIENT_READY
  102. PROTOCOL_VERSION 24:
  103. ContentFeatures version 7
  104. ContentFeatures: change number of special tiles to 6 (CF_SPECIAL_COUNT)
  105. */
  106. #define LATEST_PROTOCOL_VERSION 24
  107. // Server's supported network protocol range
  108. #define SERVER_PROTOCOL_VERSION_MIN 13
  109. #define SERVER_PROTOCOL_VERSION_MAX LATEST_PROTOCOL_VERSION
  110. // Client's supported network protocol range
  111. #define CLIENT_PROTOCOL_VERSION_MIN 13
  112. #define CLIENT_PROTOCOL_VERSION_MAX LATEST_PROTOCOL_VERSION
  113. // Constant that differentiates the protocol from random data and other protocols
  114. #define PROTOCOL_ID 0x4f457403
  115. #define PASSWORD_SIZE 28 // Maximum password length. Allows for
  116. // base64-encoded SHA-1 (27+\0).
  117. #define FORMSPEC_API_VERSION 1
  118. #define FORMSPEC_VERSION_STRING "formspec_version[" TOSTRING(FORMSPEC_API_VERSION) "]"
  119. #define TEXTURENAME_ALLOWED_CHARS "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_.-"
  120. enum ToClientCommand
  121. {
  122. TOCLIENT_INIT = 0x10,
  123. /*
  124. Server's reply to TOSERVER_INIT.
  125. Sent second after connected.
  126. [0] u16 TOSERVER_INIT
  127. [2] u8 deployed version
  128. [3] v3s16 player's position + v3f(0,BS/2,0) floatToInt'd
  129. [12] u64 map seed (new as of 2011-02-27)
  130. [20] f1000 recommended send interval (in seconds) (new as of 14)
  131. NOTE: The position in here is deprecated; position is
  132. explicitly sent afterwards
  133. */
  134. TOCLIENT_BLOCKDATA = 0x20, //TODO: Multiple blocks
  135. TOCLIENT_ADDNODE = 0x21,
  136. /*
  137. u16 command
  138. v3s16 position
  139. serialized mapnode
  140. u8 keep_metadata // Added in protocol version 22
  141. */
  142. TOCLIENT_REMOVENODE = 0x22,
  143. TOCLIENT_PLAYERPOS = 0x23, // Obsolete
  144. /*
  145. [0] u16 command
  146. // Followed by an arbitary number of these:
  147. // Number is determined from packet length.
  148. [N] u16 peer_id
  149. [N+2] v3s32 position*100
  150. [N+2+12] v3s32 speed*100
  151. [N+2+12+12] s32 pitch*100
  152. [N+2+12+12+4] s32 yaw*100
  153. */
  154. TOCLIENT_PLAYERINFO = 0x24, // Obsolete
  155. /*
  156. [0] u16 command
  157. // Followed by an arbitary number of these:
  158. // Number is determined from packet length.
  159. [N] u16 peer_id
  160. [N] char[20] name
  161. */
  162. TOCLIENT_OPT_BLOCK_NOT_FOUND = 0x25, // Obsolete
  163. TOCLIENT_SECTORMETA = 0x26, // Obsolete
  164. /*
  165. [0] u16 command
  166. [2] u8 sector count
  167. [3...] v2s16 pos + sector metadata
  168. */
  169. TOCLIENT_INVENTORY = 0x27,
  170. /*
  171. [0] u16 command
  172. [2] serialized inventory
  173. */
  174. TOCLIENT_OBJECTDATA = 0x28, // Obsolete
  175. /*
  176. Sent as unreliable.
  177. u16 command
  178. u16 number of player positions
  179. for each player:
  180. u16 peer_id
  181. v3s32 position*100
  182. v3s32 speed*100
  183. s32 pitch*100
  184. s32 yaw*100
  185. u16 count of blocks
  186. for each block:
  187. v3s16 blockpos
  188. block objects
  189. */
  190. TOCLIENT_TIME_OF_DAY = 0x29,
  191. /*
  192. u16 command
  193. u16 time (0-23999)
  194. Added in a later version:
  195. f1000 time_speed
  196. */
  197. // (oops, there is some gap here)
  198. TOCLIENT_CHAT_MESSAGE = 0x30,
  199. /*
  200. u16 command
  201. u16 length
  202. wstring message
  203. */
  204. TOCLIENT_ACTIVE_OBJECT_REMOVE_ADD = 0x31,
  205. /*
  206. u16 command
  207. u16 count of removed objects
  208. for all removed objects {
  209. u16 id
  210. }
  211. u16 count of added objects
  212. for all added objects {
  213. u16 id
  214. u8 type
  215. u32 initialization data length
  216. string initialization data
  217. }
  218. */
  219. TOCLIENT_ACTIVE_OBJECT_MESSAGES = 0x32,
  220. /*
  221. u16 command
  222. for all objects
  223. {
  224. u16 id
  225. u16 message length
  226. string message
  227. }
  228. */
  229. TOCLIENT_HP = 0x33,
  230. /*
  231. u16 command
  232. u8 hp
  233. */
  234. TOCLIENT_MOVE_PLAYER = 0x34,
  235. /*
  236. u16 command
  237. v3f1000 player position
  238. f1000 player pitch
  239. f1000 player yaw
  240. */
  241. TOCLIENT_ACCESS_DENIED = 0x35,
  242. /*
  243. u16 command
  244. u16 reason_length
  245. wstring reason
  246. */
  247. TOCLIENT_PLAYERITEM = 0x36, // Obsolete
  248. /*
  249. u16 command
  250. u16 count of player items
  251. for all player items {
  252. u16 peer id
  253. u16 length of serialized item
  254. string serialized item
  255. }
  256. */
  257. TOCLIENT_DEATHSCREEN = 0x37,
  258. /*
  259. u16 command
  260. u8 bool set camera point target
  261. v3f1000 camera point target (to point the death cause or whatever)
  262. */
  263. TOCLIENT_MEDIA = 0x38,
  264. /*
  265. u16 command
  266. u16 total number of texture bunches
  267. u16 index of this bunch
  268. u32 number of files in this bunch
  269. for each file {
  270. u16 length of name
  271. string name
  272. u32 length of data
  273. data
  274. }
  275. u16 length of remote media server url (if applicable)
  276. string url
  277. */
  278. TOCLIENT_TOOLDEF = 0x39,
  279. /*
  280. u16 command
  281. u32 length of the next item
  282. serialized ToolDefManager
  283. */
  284. TOCLIENT_NODEDEF = 0x3a,
  285. /*
  286. u16 command
  287. u32 length of the next item
  288. serialized NodeDefManager
  289. */
  290. TOCLIENT_CRAFTITEMDEF = 0x3b,
  291. /*
  292. u16 command
  293. u32 length of the next item
  294. serialized CraftiItemDefManager
  295. */
  296. TOCLIENT_ANNOUNCE_MEDIA = 0x3c,
  297. /*
  298. u16 command
  299. u32 number of files
  300. for each texture {
  301. u16 length of name
  302. string name
  303. u16 length of sha1_digest
  304. string sha1_digest
  305. }
  306. */
  307. TOCLIENT_ITEMDEF = 0x3d,
  308. /*
  309. u16 command
  310. u32 length of next item
  311. serialized ItemDefManager
  312. */
  313. TOCLIENT_PLAY_SOUND = 0x3f,
  314. /*
  315. u16 command
  316. s32 sound_id
  317. u16 len
  318. u8[len] sound name
  319. s32 gain*1000
  320. u8 type (0=local, 1=positional, 2=object)
  321. s32[3] pos_nodes*10000
  322. u16 object_id
  323. u8 loop (bool)
  324. */
  325. TOCLIENT_STOP_SOUND = 0x40,
  326. /*
  327. u16 command
  328. s32 sound_id
  329. */
  330. TOCLIENT_PRIVILEGES = 0x41,
  331. /*
  332. u16 command
  333. u16 number of privileges
  334. for each privilege
  335. u16 len
  336. u8[len] privilege
  337. */
  338. TOCLIENT_INVENTORY_FORMSPEC = 0x42,
  339. /*
  340. u16 command
  341. u32 len
  342. u8[len] formspec
  343. */
  344. TOCLIENT_DETACHED_INVENTORY = 0x43,
  345. /*
  346. [0] u16 command
  347. u16 len
  348. u8[len] name
  349. [2] serialized inventory
  350. */
  351. TOCLIENT_SHOW_FORMSPEC = 0x44,
  352. /*
  353. [0] u16 command
  354. u32 len
  355. u8[len] formspec
  356. u16 len
  357. u8[len] formname
  358. */
  359. TOCLIENT_MOVEMENT = 0x45,
  360. /*
  361. u16 command
  362. f1000 movement_acceleration_default
  363. f1000 movement_acceleration_air
  364. f1000 movement_acceleration_fast
  365. f1000 movement_speed_walk
  366. f1000 movement_speed_crouch
  367. f1000 movement_speed_fast
  368. f1000 movement_speed_climb
  369. f1000 movement_speed_jump
  370. f1000 movement_liquid_fluidity
  371. f1000 movement_liquid_fluidity_smooth
  372. f1000 movement_liquid_sink
  373. f1000 movement_gravity
  374. */
  375. TOCLIENT_SPAWN_PARTICLE = 0x46,
  376. /*
  377. u16 command
  378. v3f1000 pos
  379. v3f1000 velocity
  380. v3f1000 acceleration
  381. f1000 expirationtime
  382. f1000 size
  383. u8 bool collisiondetection
  384. u8 bool vertical
  385. u32 len
  386. u8[len] texture
  387. */
  388. TOCLIENT_ADD_PARTICLESPAWNER = 0x47,
  389. /*
  390. u16 command
  391. u16 amount
  392. f1000 spawntime
  393. v3f1000 minpos
  394. v3f1000 maxpos
  395. v3f1000 minvel
  396. v3f1000 maxvel
  397. v3f1000 minacc
  398. v3f1000 maxacc
  399. f1000 minexptime
  400. f1000 maxexptime
  401. f1000 minsize
  402. f1000 maxsize
  403. u8 bool collisiondetection
  404. u8 bool vertical
  405. u32 len
  406. u8[len] texture
  407. u32 id
  408. */
  409. TOCLIENT_DELETE_PARTICLESPAWNER = 0x48,
  410. /*
  411. u16 command
  412. u32 id
  413. */
  414. TOCLIENT_HUDADD = 0x49,
  415. /*
  416. u16 command
  417. u32 id
  418. u8 type
  419. v2f1000 pos
  420. u32 len
  421. u8[len] name
  422. v2f1000 scale
  423. u32 len2
  424. u8[len2] text
  425. u32 number
  426. u32 item
  427. u32 dir
  428. v2f1000 align
  429. v2f1000 offset
  430. v3f1000 world_pos
  431. v2s32 size
  432. */
  433. TOCLIENT_HUDRM = 0x4a,
  434. /*
  435. u16 command
  436. u32 id
  437. */
  438. TOCLIENT_HUDCHANGE = 0x4b,
  439. /*
  440. u16 command
  441. u32 id
  442. u8 stat
  443. [v2f1000 data |
  444. u32 len
  445. u8[len] data |
  446. u32 data]
  447. */
  448. TOCLIENT_HUD_SET_FLAGS = 0x4c,
  449. /*
  450. u16 command
  451. u32 flags
  452. u32 mask
  453. */
  454. TOCLIENT_HUD_SET_PARAM = 0x4d,
  455. /*
  456. u16 command
  457. u16 param
  458. u16 len
  459. u8[len] value
  460. */
  461. TOCLIENT_BREATH = 0x4e,
  462. /*
  463. u16 command
  464. u16 breath
  465. */
  466. TOCLIENT_SET_SKY = 0x4f,
  467. /*
  468. u16 command
  469. u8[4] color (ARGB)
  470. u8 len
  471. u8[len] type
  472. u16 count
  473. foreach count:
  474. u8 len
  475. u8[len] param
  476. */
  477. TOCLIENT_OVERRIDE_DAY_NIGHT_RATIO = 0x50,
  478. /*
  479. u16 command
  480. u8 do_override (boolean)
  481. u16 day-night ratio 0...65535
  482. */
  483. TOCLIENT_LOCAL_PLAYER_ANIMATIONS = 0x51,
  484. /*
  485. u16 command
  486. v2s32 stand/idle
  487. v2s32 walk
  488. v2s32 dig
  489. v2s32 walk+dig
  490. f1000 frame_speed
  491. */
  492. TOCLIENT_EYE_OFFSET = 0x52,
  493. /*
  494. u16 command
  495. v3f1000 first
  496. v3f1000 third
  497. */
  498. };
  499. enum ToServerCommand
  500. {
  501. TOSERVER_INIT=0x10,
  502. /*
  503. Sent first after connected.
  504. [0] u16 TOSERVER_INIT
  505. [2] u8 SER_FMT_VER_HIGHEST_READ
  506. [3] u8[20] player_name
  507. [23] u8[28] password (new in some version)
  508. [51] u16 minimum supported network protocol version (added sometime)
  509. [53] u16 maximum supported network protocol version (added later than the previous one)
  510. */
  511. TOSERVER_INIT2 = 0x11,
  512. /*
  513. Sent as an ACK for TOCLIENT_INIT.
  514. After this, the server can send data.
  515. [0] u16 TOSERVER_INIT2
  516. */
  517. TOSERVER_GETBLOCK=0x20, // Obsolete
  518. TOSERVER_ADDNODE = 0x21, // Obsolete
  519. TOSERVER_REMOVENODE = 0x22, // Obsolete
  520. TOSERVER_PLAYERPOS = 0x23,
  521. /*
  522. [0] u16 command
  523. [2] v3s32 position*100
  524. [2+12] v3s32 speed*100
  525. [2+12+12] s32 pitch*100
  526. [2+12+12+4] s32 yaw*100
  527. [2+12+12+4+4] u32 keyPressed
  528. */
  529. TOSERVER_GOTBLOCKS = 0x24,
  530. /*
  531. [0] u16 command
  532. [2] u8 count
  533. [3] v3s16 pos_0
  534. [3+6] v3s16 pos_1
  535. ...
  536. */
  537. TOSERVER_DELETEDBLOCKS = 0x25,
  538. /*
  539. [0] u16 command
  540. [2] u8 count
  541. [3] v3s16 pos_0
  542. [3+6] v3s16 pos_1
  543. ...
  544. */
  545. TOSERVER_ADDNODE_FROM_INVENTORY = 0x26, // Obsolete
  546. /*
  547. [0] u16 command
  548. [2] v3s16 pos
  549. [8] u16 i
  550. */
  551. TOSERVER_CLICK_OBJECT = 0x27, // Obsolete
  552. /*
  553. length: 13
  554. [0] u16 command
  555. [2] u8 button (0=left, 1=right)
  556. [3] v3s16 blockpos
  557. [9] s16 id
  558. [11] u16 item
  559. */
  560. TOSERVER_GROUND_ACTION = 0x28, // Obsolete
  561. /*
  562. length: 17
  563. [0] u16 command
  564. [2] u8 action
  565. [3] v3s16 nodepos_undersurface
  566. [9] v3s16 nodepos_abovesurface
  567. [15] u16 item
  568. actions:
  569. 0: start digging (from undersurface)
  570. 1: place block (to abovesurface)
  571. 2: stop digging (all parameters ignored)
  572. 3: digging completed
  573. */
  574. TOSERVER_RELEASE = 0x29, // Obsolete
  575. // (oops, there is some gap here)
  576. TOSERVER_SIGNTEXT = 0x30, // Old signs, obsolete
  577. /*
  578. u16 command
  579. v3s16 blockpos
  580. s16 id
  581. u16 textlen
  582. textdata
  583. */
  584. TOSERVER_INVENTORY_ACTION = 0x31,
  585. /*
  586. See InventoryAction in inventory.h
  587. */
  588. TOSERVER_CHAT_MESSAGE = 0x32,
  589. /*
  590. u16 command
  591. u16 length
  592. wstring message
  593. */
  594. TOSERVER_SIGNNODETEXT = 0x33, // obsolete
  595. /*
  596. u16 command
  597. v3s16 p
  598. u16 textlen
  599. textdata
  600. */
  601. TOSERVER_CLICK_ACTIVEOBJECT = 0x34, // Obsolete
  602. /*
  603. length: 7
  604. [0] u16 command
  605. [2] u8 button (0=left, 1=right)
  606. [3] u16 id
  607. [5] u16 item
  608. */
  609. TOSERVER_DAMAGE = 0x35,
  610. /*
  611. u16 command
  612. u8 amount
  613. */
  614. TOSERVER_PASSWORD=0x36,
  615. /*
  616. Sent to change password.
  617. [0] u16 TOSERVER_PASSWORD
  618. [2] u8[28] old password
  619. [30] u8[28] new password
  620. */
  621. TOSERVER_PLAYERITEM=0x37,
  622. /*
  623. Sent to change selected item.
  624. [0] u16 TOSERVER_PLAYERITEM
  625. [2] u16 item
  626. */
  627. TOSERVER_RESPAWN=0x38,
  628. /*
  629. u16 TOSERVER_RESPAWN
  630. */
  631. TOSERVER_INTERACT = 0x39,
  632. /*
  633. [0] u16 command
  634. [2] u8 action
  635. [3] u16 item
  636. [5] u32 length of the next item
  637. [9] serialized PointedThing
  638. actions:
  639. 0: start digging (from undersurface) or use
  640. 1: stop digging (all parameters ignored)
  641. 2: digging completed
  642. 3: place block or item (to abovesurface)
  643. 4: use item
  644. (Obsoletes TOSERVER_GROUND_ACTION and TOSERVER_CLICK_ACTIVEOBJECT.)
  645. */
  646. TOSERVER_REMOVED_SOUNDS = 0x3a,
  647. /*
  648. u16 command
  649. u16 len
  650. s32[len] sound_id
  651. */
  652. TOSERVER_NODEMETA_FIELDS = 0x3b,
  653. /*
  654. u16 command
  655. v3s16 p
  656. u16 len
  657. u8[len] form name (reserved for future use)
  658. u16 number of fields
  659. for each field:
  660. u16 len
  661. u8[len] field name
  662. u32 len
  663. u8[len] field value
  664. */
  665. TOSERVER_INVENTORY_FIELDS = 0x3c,
  666. /*
  667. u16 command
  668. u16 len
  669. u8[len] form name (reserved for future use)
  670. u16 number of fields
  671. for each field:
  672. u16 len
  673. u8[len] field name
  674. u32 len
  675. u8[len] field value
  676. */
  677. TOSERVER_REQUEST_MEDIA = 0x40,
  678. /*
  679. u16 command
  680. u16 number of files requested
  681. for each file {
  682. u16 length of name
  683. string name
  684. }
  685. */
  686. TOSERVER_RECEIVED_MEDIA = 0x41,
  687. /*
  688. u16 command
  689. */
  690. TOSERVER_BREATH = 0x42,
  691. /*
  692. u16 command
  693. u16 breath
  694. */
  695. TOSERVER_CLIENT_READY = 0x43,
  696. /*
  697. u8 major
  698. u8 minor
  699. u8 patch
  700. u8 reserved
  701. u16 len
  702. u8[len] full_version_string
  703. */
  704. };
  705. #endif