Documentation ¶
Index ¶
- func Compress(data []byte) []byte
- func PackBoolean(b bool) byte
- func PackDouble(d float64) (p []byte)
- func PackFloat(f float32) (p []byte)
- func PackPosition(x, y, z int) (p []byte)
- func PackString(s string) (p []byte)
- func PackUint16(n uint16) (p []byte)
- func PackUint32(n uint32) (p []byte)
- func PackUint64(n uint64) (p []byte)
- func PackVarInt(n int32) (VarInt []byte)
- func ReadNBytes(b io.ByteReader, n int) (bs []byte, err error)
- func UnpackDouble(b io.ByteReader) (float64, error)
- func UnpackFloat(b io.ByteReader) (float32, error)
- func UnpackInt16(b io.ByteReader) (int16, error)
- func UnpackInt32(b io.ByteReader) (int32, error)
- func UnpackInt64(b io.ByteReader) (int64, error)
- func UnpackPosition(b io.ByteReader) (x, y, z int, err error)
- func UnpackString(b io.ByteReader) (s string, err error)
- func UnpackVarInt(b io.ByteReader) (int32, error)
- type Packet
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ReadNBytes ¶
func ReadNBytes(b io.ByteReader, n int) (bs []byte, err error)
ReadNBytes read N bytes from bytes.Reader
func UnpackPosition ¶
func UnpackPosition(b io.ByteReader) (x, y, z int, err error)
UnpackPosition 读取一个位置
Types ¶
type Packet ¶
Packet define a net data package
func RecvPacket ¶
func RecvPacket(r io.ByteReader, useZlib bool) (*Packet, error)
RecvPacket recive a packet from server
Click to show internal directories.
Click to hide internal directories.