motdjava

package
v1.0.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 7, 2024 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MotdJavaInfo

type MotdJavaInfo struct {
	Status    string `json:"status"`    //服务器状态
	Host      string `json:"host"`      //服务器Host
	Motd      string `json:"motd"`      //Motd信息
	Agreement int    `json:"agreement"` //协议版本
	Version   string `json:"version"`   //支持的游戏版本
	Online    int    `json:"online"`    //在线人数
	Max       int    `json:"max"`       //最大在线人数
	Sample    []struct {
		Id   string `json:"id"`   //在线玩家ID
		Name string `json:"name"` //在线玩家名字
	} `json:"sample"` //在线玩家列表
	Favicon string `json:"favicon"` //服务器图标
	Delay   int64  `json:"delay"`   //连接延迟
}

MotdJava信息

func MotdJava

func MotdJava(Host string) (MotdJavaInfo, error)

type MotdJavaJson

type MotdJavaJson struct {
	Description json.RawMessage `json:"description"` //服务器说明文本
	Players     struct {
		Max    int `json:"max"`    //服务器最大在线
		Online int `json:"online"` //服务器当前在线
		Sample []struct {
			Id   string `json:"id"`   //在线玩家ID
			Name string `json:"name"` //在线玩家名字
		} `json:"sample"` //在线玩家列表
	} `json:"players"`
	Version struct {
		Name     string `json:"name"`     //可用游戏版本
		Protocol int    `json:"protocol"` //服务器协议版本
	} `json:"version"`

	Favicon string `json:"favicon"` //服务器图标
}

原始Motd信息解析

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL