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 package messages
// Vector3 — трёхмерный вектор с квантизацией.
type Vector3 struct { type Vector3 struct {
X float32 `pack:"min=-500,max=500,bits=16"` X float32 `pack:"min=-500,max=500,bits=16"`
Y float32 `pack:"min=-500,max=500,bits=16"` Y float32 `pack:"min=-500,max=500,bits=16"`
@@ -15,20 +14,17 @@ const (
OpcodeJoinRoom OpcodeJoinRoom
) )
// MoveMessage содержит всё многообразие поддерживаемых типов.
type MoveMessage struct { type MoveMessage struct {
Position Vector3 // вложенный тип Position Vector3
Velocity [3]float32 // фиксированный массив без квантизации Velocity [3]float32
Waypoints []Vector3 // слайс вложенных типов Waypoints []Vector3
PlayerID uint32 PlayerID uint32
// 3 подряд bool → упаковываются в 1 байт
Active bool Active bool
Visible bool Visible bool
Ghost bool Ghost bool
Name string Name string
} }
// SpawnMessage — пример с целочисленными полями и массивами примитивов.
type SpawnMessage struct { type SpawnMessage struct {
EntityID uint64 EntityID uint64
Position Vector3 Position Vector3