Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var COLOR_MAP = map[rune]string{
'0': "black",
'1': "dark_blue",
'2': "dark_green",
'3': "dark_aqua",
'4': "dark_red",
'5': "dark_purple",
'6': "gold",
'7': "gray",
'8': "dark_gray",
'9': "blue",
'a': "green",
'b': "aqua",
'c': "red",
'd': "light_purple",
'e': "yellow",
'f': "white",
}
Functions ¶
func TranslateColorCodes ¶
Types ¶
type LegacyPingResponse ¶
type PingResponse ¶
type PingResponse struct { Version VersionEntry `json:"version"` Players PlayersEntry `json:"players"` Description interface{} `json:"description"` Faviconb64 string `json:"favicon,omitempty"` }
type PingServer ¶
type PingServer struct { Responder Responder // only responderhook can be hotswapped // contains filtered or unexported fields }
func CreatePingServer ¶
func CreatePingServer(bindAddr string, hook Responder) *PingServer
func (*PingServer) AcceptConnection ¶
func (ps *PingServer) AcceptConnection(handler PingServerErrorHandler) error
func (*PingServer) AcceptConnections ¶
func (ps *PingServer) AcceptConnections(handler PingServerErrorHandler) (err error)
func (*PingServer) Bind ¶
func (ps *PingServer) Bind() (err error)
func (*PingServer) Close ¶
func (ps *PingServer) Close() error
func (*PingServer) SetResponseTimeout ¶
func (ps *PingServer) SetResponseTimeout(timeout int)
type PingServerErrorHandler ¶
type PingServerErrorHandler func(error)
type PlayerConn ¶
type PlayerConn struct {
// contains filtered or unexported fields
}
type PlayerEntry ¶
type PlayersEntry ¶
type PlayersEntry struct { MaxPlayers int `json:"max"` OnlinePlayers int `json:"online"` Sample []PlayerEntry `json:"sample,omitempty"` }
type Responder ¶
type Responder interface { OnConnect(net.Addr) error RespondPing(*Handshake) (*PingResponse, error) RespondJoin(*Handshake, string) (interface{}, error) RespondLegacyPing(*Handshake) (*LegacyPingResponse, error) }
func CreateSimpleResponder ¶
func CreateSimpleResponder(response *PingResponse, kickResponse interface{}, legacyResponse *LegacyPingResponse) Responder
type SimpleResponder ¶
type SimpleResponder struct {
// contains filtered or unexported fields
}
func (SimpleResponder) RespondJoin ¶
func (s SimpleResponder) RespondJoin(h *Handshake, u string) (interface{}, error)
func (SimpleResponder) RespondLegacyPing ¶
func (s SimpleResponder) RespondLegacyPing(h *Handshake) (*LegacyPingResponse, error)
func (SimpleResponder) RespondPing ¶
func (s SimpleResponder) RespondPing(h *Handshake) (*PingResponse, error)
type TextSelection ¶
type TextSelection struct { Text string `json:"text"` Bold bool `json:"bold,omitempty"` Italic bool `json:"italic,omitempty"` Underlined bool `json:"underlined,omitempty"` Strikethrough bool `json:"strikethrough,omitempty"` Obfuscated bool `json:"obfuscated,omitempty"` Color string `json:"color,omitempty"` Extra []interface{} `json:"extra,omitempty"` }
func ConvertMCChat ¶
func ConvertMCChat(input string) *TextSelection
type VersionEntry ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.