1
0

80 lines
1.8 KiB
Go

package packets
type Vec3 struct {
X float32 `json:"x"`
Y float32 `json:"y"`
Z float32 `json:"z"`
}
type Vec2 struct {
X float32 `json:"x"`
Y float32 `json:"y"`
}
type InitMessage struct {
Type string `json:"type"`
PlayerID int `json:"playerId"`
X float32 `json:"x"`
Y float32 `json:"y"`
Z float32 `json:"z"`
Yaw float32 `json:"yaw"`
Pitch float32 `json:"pitch"`
TimeOfDay float32 `json:"timeOfDay"`
}
type MovementMessage struct {
Type string `json:"type"`
X float32 `json:"x"`
Y float32 `json:"y"`
Z float32 `json:"z"`
Yaw float32 `json:"yaw"`
Pitch float32 `json:"pitch"`
VelX float32 `json:"velX"`
VelY float32 `json:"velY"`
VelZ float32 `json:"velZ"`
}
type PlayerMovementMessage struct {
Type string `json:"type"`
PlayerID int `json:"playerId"`
X float32 `json:"x"`
Y float32 `json:"y"`
Z float32 `json:"z"`
Yaw float32 `json:"yaw"`
Pitch float32 `json:"pitch"`
VelX float32 `json:"velX"`
VelY float32 `json:"velY"`
VelZ float32 `json:"velZ"`
}
type PositionCorrectionMessage struct {
Type string `json:"type"`
X float32 `json:"x"`
Y float32 `json:"y"`
Z float32 `json:"z"`
}
type PlayerJoinedMessage struct {
Type string `json:"type"`
PlayerID int `json:"playerId"`
Username string `json:"username"`
X float32 `json:"x"`
Y float32 `json:"y"`
Z float32 `json:"z"`
}
type PlayerLeftMessage struct {
Type string `json:"type"`
PlayerID int `json:"playerId"`
}
type ChatMessage struct {
Type string `json:"type"`
Username string `json:"username,omitempty"`
Message string `json:"message"`
}
type TimeUpdateMessage struct {
Type string `json:"type"`
TimeOfDay float32 `json:"timeOfDay"`
}