Documentation
¶
Index ¶
- Variables
- func Resolve(hostport string) (addr *net.TCPAddr, err error)
- type MinecraftStatus
- func CheckStatus(addr *net.TCPAddr) (status *MinecraftStatus, ping time.Duration, err error)
- func CheckStatusNew(addr *net.TCPAddr, host string, port uint16) (*MinecraftStatus, time.Duration, error)
- func CheckStatusNewConn(conn *net.TCPConn, host string, port uint16) (*MinecraftStatus, time.Duration, error)
- func CheckStatusOld(addr *net.TCPAddr, host string, port uint16) (*MinecraftStatus, time.Duration, error)
- func CheckStatusOldConn(conn *net.TCPConn, host string, port uint16) (*MinecraftStatus, time.Duration, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var COLOR_EXPR = regexp.MustCompile("(?i)§[a-z0-9]")
View Source
var DEADLINE = 3 * time.Second
View Source
var LAST_NEW_PROTOCOL int = 4
View Source
var LAST_OLD_PROTOCOL uint8 = 74
Functions ¶
Types ¶
type MinecraftStatus ¶
type MinecraftStatus struct { NewProtocol bool ProtocolVersion int GameVersion string Slots int Players int PlayersSample []string Description string Favicon []byte Raw *json.RawMessage `json:"-"` }
func CheckStatus ¶
check minecraft status, first tries new protocol, later older
func CheckStatusNew ¶
func CheckStatusNewConn ¶
func CheckStatusOld ¶
func CheckStatusOldConn ¶
func (*MinecraftStatus) SerializeNew ¶
func (status *MinecraftStatus) SerializeNew() ([]byte, error)
func (*MinecraftStatus) SerializeOld ¶
func (status *MinecraftStatus) SerializeOld(protocol int) ([]byte, error)
func (*MinecraftStatus) String ¶
func (status *MinecraftStatus) String() string
Click to show internal directories.
Click to hide internal directories.