Docker auto-scale and asleep motd status (#488)

This commit is contained in:
Lenart Kos
2025-12-20 20:31:34 +01:00
committed by GitHub
parent b67d0985dc
commit 4dff00dda9
18 changed files with 885 additions and 165 deletions
+31
View File
@@ -79,6 +79,13 @@ const (
PacketIdHandshake = 0x00
PacketIdLogin = 0x00 // during StateLogin
PacketIdLegacyServerListPing = 0xFE
PacketIdStatusRequest = 0x00
PacketIdPingRequest = 0x01
)
const (
PacketIdStatusResponse = 0x00
PackedIdPongResponse = 0x01
)
type Handshake struct {
@@ -106,6 +113,30 @@ type LegacyServerListPing struct {
ServerPort uint16
}
// StatusResponse is a minimal structure for the status JSON
type StatusResponse struct {
Version struct {
Name string `json:"name"`
Protocol int `json:"protocol"`
} `json:"version"`
Players struct {
Max int `json:"max"`
Online int `json:"online"`
Sample []struct {
Name string `json:"name"`
ID string `json:"id"`
} `json:"sample,omitempty"`
} `json:"players"`
Description map[string]interface{} `json:"description"`
Favicon string `json:"favicon,omitempty"`
EnforcesSecureChat *bool `json:"enforcesSecureChat,omitempty"`
}
// PingPayload represents the status ping payload (packet 0x01)
type PingPayload struct {
Timestamp int64
}
type ByteReader interface {
ReadByte() (byte, error)
}