2026-03-19 14:52:12 +03:00
|
|
|
package messages
|
|
|
|
|
|
|
|
|
|
type Vector3 struct {
|
|
|
|
|
X float32 `pack:"min=-500,max=500,bits=16"`
|
|
|
|
|
Y float32 `pack:"min=-500,max=500,bits=16"`
|
|
|
|
|
Z float32 `pack:"min=-500,max=500,bits=16"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Opcode uint16
|
|
|
|
|
|
|
|
|
|
const (
|
|
|
|
|
OpcodeUnknown Opcode = iota
|
|
|
|
|
OpcodeAuthorize
|
|
|
|
|
OpcodeJoinRoom
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
type MoveMessage struct {
|
2026-03-24 12:23:24 +03:00
|
|
|
Position Vector3
|
|
|
|
|
Velocity [3]float32
|
|
|
|
|
Waypoints []Vector3
|
2026-03-19 14:52:12 +03:00
|
|
|
PlayerID uint32
|
|
|
|
|
Active bool
|
|
|
|
|
Visible bool
|
|
|
|
|
Ghost bool
|
|
|
|
|
Name string
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type SpawnMessage struct {
|
|
|
|
|
EntityID uint64
|
|
|
|
|
Position Vector3
|
|
|
|
|
Health int16
|
|
|
|
|
Tags []string
|
|
|
|
|
Data []uint8
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type EnvelopeMessage struct {
|
|
|
|
|
Code Opcode
|
|
|
|
|
Counter uint8
|
|
|
|
|
}
|