Documentation ¶
Index ¶
- Constants
- func IsOldClient(err error) (old bool)
- func ReadMCByteString(buff []byte) (bstr []byte, length int, err error)
- func ReadMCString(buff []byte) (str string, length int, err error)
- func WriteMCByteString(bstr []byte) (payload []byte)
- func WriteMCString(str string) (payload []byte)
- type Icon
- type MCHandShake
- type MCKick
- type MCLogin
- type MCPacket
- type MCSimpleStatusResponse
- type MCStatusResponse
- type OldClient
- type RAWPacket
- func (pkt *RAWPacket) IsStatusPing() (status_ping bool)
- func (pkt *RAWPacket) IsStatusRequest() (status_req bool)
- func (pkt *RAWPacket) ToBytes() (packet []byte)
- func (pkt *RAWPacket) ToHandShake() (handshake *MCHandShake, err error)
- func (pkt *RAWPacket) ToKick() (kick *MCKick, err error)
- func (pkt *RAWPacket) ToLogin() (login *MCLogin, err error)
- func (pkt *RAWPacket) ToStatusResponse() (resp *MCStatusResponse, err error)
- type SocketReader
Constants ¶
View Source
const (
HandShakeID uint64 = 0
)
Variables ¶
This section is empty.
Functions ¶
func IsOldClient ¶
func WriteMCByteString ¶
func WriteMCString ¶
Types ¶
type MCHandShake ¶
type MCHandShake struct { // ID is always 0x00 Proto uint64 ServerAddr string ServerPort uint16 NextState uint64 }
func (*MCHandShake) ToRawPacket ¶
func (handshake *MCHandShake) ToRawPacket() (pkt *RAWPacket, err error)
type MCKick ¶
func (*MCKick) ToRawPacket ¶
type MCSimpleStatusResponse ¶
type MCSimpleStatusResponse struct { // ID is always 0x00 Version struct { Name string `json:"name"` Protocol int `json:"protocol"` } `json:"version"` Players struct { Max int `json:"max"` Online int `json:"online"` } `json:"players"` Description string `json:"description"` Favicon Icon `json:"favicon,omitempty"` }
type MCStatusResponse ¶
type MCStatusResponse struct { // ID is always 0x00 Version struct { Name string `json:"name"` Protocol int `json:"protocol"` } `json:"version"` Players struct { Max int `json:"max"` Online int `json:"online"` } `json:"players"` Description *mcchat.ChatMsg `json:"description"` Favicon Icon `json:"favicon,omitempty"` }
func (*MCStatusResponse) ToRawPacket ¶
func (resp *MCStatusResponse) ToRawPacket() (pkt *RAWPacket, err error)
type RAWPacket ¶
func ReadInitialPacket ¶
func ReadInitialPacket(r SocketReader) (packet *RAWPacket, err error)
func ReadPacket ¶
func ReadPacket(r SocketReader) (packet *RAWPacket, err error)
func (*RAWPacket) IsStatusPing ¶
func (*RAWPacket) IsStatusRequest ¶
func (*RAWPacket) ToHandShake ¶
func (pkt *RAWPacket) ToHandShake() (handshake *MCHandShake, err error)
func (*RAWPacket) ToStatusResponse ¶
func (pkt *RAWPacket) ToStatusResponse() (resp *MCStatusResponse, err error)
type SocketReader ¶
type SocketReader interface { io.Reader io.ByteScanner }
Click to show internal directories.
Click to hide internal directories.