Merge remote-tracking branch 'origin/master'

This commit is contained in:
2026-03-25 13:02:40 +03:00
+3 -7
View File
@@ -1,6 +1,5 @@
package messages
// Vector3 — трёхмерный вектор с квантизацией.
type Vector3 struct {
X float32 `pack:"min=-500,max=500,bits=16"`
Y float32 `pack:"min=-500,max=500,bits=16"`
@@ -15,20 +14,17 @@ const (
OpcodeJoinRoom
)
// MoveMessage содержит всё многообразие поддерживаемых типов.
type MoveMessage struct {
Position Vector3 // вложенный тип
Velocity [3]float32 // фиксированный массив без квантизации
Waypoints []Vector3 // слайс вложенных типов
Position Vector3
Velocity [3]float32
Waypoints []Vector3
PlayerID uint32
// 3 подряд bool → упаковываются в 1 байт
Active bool
Visible bool
Ghost bool
Name string
}
// SpawnMessage — пример с целочисленными полями и массивами примитивов.
type SpawnMessage struct {
EntityID uint64
Position Vector3