X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=doc%2Fprotocol;h=f194d77d3ce28a7bcb17ab676efb87bb705ec860;hb=7d462272350926dca8e1a8c94fdb527d0c9f6dc1;hp=1cea7804220573bb6a465accee2b70be330cc55a;hpb=7c5e04a4af82947ae8e26db3d03f13a555c10aba;p=blank.git diff --git a/doc/protocol b/doc/protocol index 1cea780..f194d77 100644 --- a/doc/protocol +++ b/doc/protocol @@ -30,12 +30,14 @@ packu 2 16bit unsigned int representing a float value normalized to it can be unpacked by dividing by 65535 vec3n 6 3x packn vec3u 6 3x packu -quat 8 4x packn float -entity state 50 [ 0] vec3i chunk pos (there's a variation where this is a vec3b) +quat 8 2bit index of largest component, a 2bit padding, then 3x 20bit small components in xyzw + order mapped from [-0.7072,0.7072] to [0,1048574] (with largest omitted) +entity state 42 [ 0] vec3i chunk pos (there's a variation where this is a vec3b) [12] vec3u block pos by 16, [18] vec3 velocity, [30] quat orientation, - [38] vec3 angular velocity + [38] packn pitch by PI/2 + [40] packn yaw by PI Packets @@ -77,9 +79,9 @@ Code: 2 Payload: 0 entity ID of the player, 32bit unsigned int 4 entity state of the player - 54 name of the world the server's currently running + 46 name of the world the server's currently running max 32 byte UTF-8 string -Length: 54-86 +Length: 47-78 Part @@ -102,12 +104,10 @@ Sent by clients to notify the server of their changes to the player. Code: 4 Payload: 0 player's entity state as predicted by the client - 50 movement input, vec3n - 56 pitch input by PI/2, packn - 58 yaw input by PI, packn - 60 active actions, 8bit bit field, first three bits are primary, secondary, and tertiary - 61 selected inventory slot, 8bit unsigned int -Length: 62 + 42 movement input, vec3n + 48 active actions, 8bit bit field, first three bits are primary, secondary, and tertiary + 49 selected inventory slot, 8bit unsigned int +Length: 50 Spawn Entity @@ -120,11 +120,11 @@ Payload: 0 entity ID, 32bit unsigned int 4 entity's model ID, 32bit unsigned int 8 entity state - 58 bounding box of the entity, 6x 32bit float - 82 flags, 32bit bitfield with boolean values + 50 bounding box of the entity, 6x 32bit float + 74 flags, 32bit bitfield with boolean values 1: world collision - 86 entity name, max 32 byte UTF-8 string -Length: 87 - 118 + 78 entity name, max 32 byte UTF-8 string +Length: 79 - 110 Despawn Entity @@ -146,12 +146,12 @@ Contained entities must be ordered by ascending entity ID. Code: 7 Payload: - 0 number of entities, 32bit int, 1-10 + 0 number of entities, 32bit int, 1-12 4 base for chunk coordinates, vec3i 16 entity ID, 32bit unsigned int 20 entity state with vec3b as chunk position (rather than vec3i) - 62 next entity... -Length: 16 + multiple of 45, max 466 + 53 next entity... +Length: 16 + multiple of 37, max 460 Player Correction @@ -163,13 +163,17 @@ Code: 8 Payload: 0 sequence number of the offending packet, 16bit unsigned int 2 entity state of the player's entity on the server -Length: 52 +Length: 44 Chunk Begin ----------- Sent by the server to inform the client of an upcoming chunk transmission. +The client may send this packet to the server to re-request a chunk +transmission. In that case fields other than the chunk coordinates are +ignored. Also, the server may choose not to resend the chunk (e.g. if the +player is too far away from it). Code: 9 Payload: