Files
mc/server/status.go
T

23 lines
644 B
Go
Raw Permalink Normal View History

2026-07-09 08:33:57 +08:00
package server
import (
"github.com/sandertv/gophertunnel/minecraft"
)
// statusProvider handles the way the server shows up in the server list. The
// online players and maximum players are not changeable from outside the
// server, but the server name may be changed at any time.
type statusProvider struct {
name string
}
// ServerStatus returns the player count, max players and the server's name as
// a minecraft.ServerStatus.
func (s statusProvider) ServerStatus(playerCount, maxPlayers int) minecraft.ServerStatus {
return minecraft.ServerStatus{
ServerName: s.name,
PlayerCount: playerCount,
MaxPlayers: maxPlayers,
}
}