Provide official ListPingHandler implementation

This commit is contained in:
Tnze
2021-12-08 13:18:24 +08:00
parent 2274463c6c
commit 1c2332d678
4 changed files with 135 additions and 77 deletions

View File

@ -16,7 +16,7 @@ type ListPingHandler interface {
MaxPlayer() int
OnlinePlayer() int
PlayerSamples() []PlayerSample
Description() chat.Message
Description() *chat.Message
}
type PlayerSample struct {
@ -60,8 +60,8 @@ func (s *Server) listResp() ([]byte, error) {
Online int `json:"online"`
Sample []PlayerSample `json:"sample"`
} `json:"players"`
Description chat.Message `json:"description"`
FavIcon string `json:"favicon,omitempty"`
Description *chat.Message `json:"description"`
FavIcon string `json:"favicon,omitempty"`
}
list.Version.Name = s.ListPingHandler.Name()