Packet specification
The packet is designed to be always padded to 4 bytes. All values are
little-endian-encoded. All packets have a 4-byte header representing an
integer, specifying the type of data:
Тип |
Значення |
0 |
null |
1 |
bool |
2 |
integer |
3 |
float |
4 |
текст |
5 |
Вектор |
6 |
rect2 |
7 |
Вектор |
8 |
transform2d |
9 |
plane |
10 |
quat |
11 |
aabb |
12 |
basis |
13 |
transform |
14 |
color |
15 |
node path |
16 |
rid |
17 |
object |
18 |
dictionary |
19 |
array |
20 |
raw array |
21 |
int array |
22 |
real array |
23 |
string array |
24 |
vector2 array |
25 |
vector3 array |
26 |
color array |
27 |
макс. |
Following this is the actual packet contents, which varies for each type of
packet. Note that this assumes Godot is compiled with single-precision floats,
which is the default. If Godot was compiled with double-precision floats, the
length of "Float" fields within data structures should be 8, and the offset
should be (offset - 4) * 2 + 4
. The "float" type itself always uses double
precision.
0: null
Зміщення |
<title>LEN</title> |
Тип |
Опис |
4 |
4 |
Integer (ціле) |
0 for False, 1 for True |
Зміщення |
<title>LEN</title> |
Тип |
Опис |
4 |
8 |
Integer (ціле) |
64-bit signed integer |
Зміщення |
<title>LEN</title> |
Тип |
Опис |
4 |
4 |
Float |
IEE 754 32-Bits Float |
Зміщення |
<title>LEN</title> |
Тип |
Опис |
4 |
4 |
Integer (ціле) |
String length (in bytes) |
8 |
X |
Байтів |
UTF-8 encoded string |
This field is padded to 4 bytes.
Зміщення |
<title>LEN</title> |
Тип |
Опис |
4 |
4 |
Float |
X coordinate |
8 |
4 |
Float |
Y coordinate |
Зміщення |
<title>LEN</title> |
Тип |
Опис |
4 |
4 |
Float |
X coordinate |
8 |
4 |
Float |
Y coordinate |
12 |
4 |
Float |
X size |
16 |
4 |
Float |
Y size |
Зміщення |
<title>LEN</title> |
Тип |
Опис |
4 |
4 |
Float |
X coordinate |
8 |
4 |
Float |
Y coordinate |
12 |
4 |
Float |
Z coordinate |
Зміщення |
<title>LEN</title> |
Тип |
Опис |
4 |
4 |
Float |
Звичайний (1024x768) |
8 |
4 |
Float |
Normal Y |
12 |
4 |
Float |
Normal Z |
16 |
4 |
Float |
Відстань |
Зміщення |
<title>LEN</title> |
Тип |
Опис |
4 |
4 |
Float |
Imaginary X |
8 |
4 |
Float |
Imaginary Y |
12 |
4 |
Float |
Imaginary Z |
16 |
4 |
Float |
Real W |
Зміщення |
<title>LEN</title> |
Тип |
Опис |
4 |
4 |
Float |
X coordinate |
8 |
4 |
Float |
Y coordinate |
12 |
4 |
Float |
Z coordinate |
16 |
4 |
Float |
X size |
20 |
4 |
Float |
Y size |
24 |
4 |
Float |
Z size |
Зміщення |
<title>LEN</title> |
Тип |
Опис |
4 |
4 |
Float |
The X component of the X column vector, accessed via [0][0] |
8 |
4 |
Float |
The Y component of the X column vector, accessed via [0][1] |
12 |
4 |
Float |
The Z component of the X column vector, accessed via [0][2] |
16 |
4 |
Float |
The X component of the Y column vector, accessed via [1][0] |
20 |
4 |
Float |
The Y component of the Y column vector, accessed via [1][1] |
24 |
4 |
Float |
The Z component of the Y column vector, accessed via [1][2] |
28 |
4 |
Float |
The X component of the Z column vector, accessed via [2][0] |
32 |
4 |
Float |
The Y component of the Z column vector, accessed via [2][1] |
36 |
4 |
Float |
The Z component of the Z column vector, accessed via [2][2] |
Зміщення |
<title>LEN</title> |
Тип |
Опис |
4 |
4 |
Float |
Red (typically 0..1, can be above 1 for overbright colors) |
8 |
4 |
Float |
Green (typically 0..1, can be above 1 for overbright colors) |
12 |
4 |
Float |
Blue (typically 0..1, can be above 1 for overbright colors) |
16 |
4 |
Float |
альфа |
Зміщення |
<title>LEN</title> |
Тип |
Опис |
4 |
4 |
Integer (ціле) |
String length, or new format (val&0x80000000!=0 and NameCount=val&0x7FFFFFFF) |
Зміщення |
<title>LEN</title> |
Тип |
Опис |
4 |
4 |
Integer (ціле) |
val&0x7FFFFFFF = elements, val&0x80000000 = shared (bool) |
Then what follows is, for amount of "elements", pairs of key and value,
one after the other, using this same format.
Зміщення |
<title>LEN</title> |
Тип |
Опис |
4 |
4 |
Integer (ціле) |
val&0x7FFFFFFF = elements, val&0x80000000 = shared (bool) |
Then what follows is, for amount of "elements", values one after the
other, using this same format.
Зміщення |
<title>LEN</title> |
Тип |
Опис |
4 |
4 |
Integer (ціле) |
Array length (Bytes) |
Довжина |
1 |
Байт |
Байт |
The array data is padded to 4 bytes.
Зміщення |
<title>LEN</title> |
Тип |
Опис |
4 |
4 |
Integer (ціле) |
Array length (Integers) |
Довжина |
4 |
Integer (ціле) |
32-bit signed integer |
Зміщення |
<title>LEN</title> |
Тип |
Опис |
4 |
4 |
Integer (ціле) |
Array length (Floats) |
Довжина |
4 |
Integer (ціле) |
32-bits IEEE 754 float |
Зміщення |
<title>LEN</title> |
Тип |
Опис |
4 |
4 |
Integer (ціле) |
Array length (Strings) |
For each String:
Зміщення |
<title>LEN</title> |
Тип |
Опис |
X+0 |
4 |
Integer (ціле) |
String length |
X+4 |
X |
Байтів |
UTF-8 encoded string |
Every string is padded to 4 bytes.
Зміщення |
<title>LEN</title> |
Тип |
Опис |
4 |
4 |
Integer (ціле) |
Array length |
Довжина |
4 |
Float |
X coordinate |
Довжина |
4 |
Float |
Y coordinate |
Зміщення |
<title>LEN</title> |
Тип |
Опис |
4 |
4 |
Integer (ціле) |
Array length |
Довжина |
4 |
Float |
X coordinate |
Довжина |
4 |
Float |
Y coordinate |
Довжина |
4 |
Float |
Z coordinate |
Зміщення |
<title>LEN</title> |
Тип |
Опис |
4 |
4 |
Integer (ціле) |
Array length |
Довжина |
4 |
Float |
Red (typically 0..1, can be above 1 for overbright colors) |
Довжина |
4 |
Float |
Green (typically 0..1, can be above 1 for overbright colors) |
Довжина |
4 |
Float |
Blue (typically 0..1, can be above 1 for overbright colors) |
Довжина |
4 |
Float |
альфа |