up3
Build and deploy / Build (push) Has been cancelled
Build and deploy / Update Contributors (push) Has been cancelled
Build and deploy / Deploy (push) Has been cancelled
Build and deploy / Build (push) Has been cancelled
Build and deploy / Update Contributors (push) Has been cancelled
Build and deploy / Deploy (push) Has been cancelled
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
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,
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user