Documentation
¶
Index ¶
- Constants
- func WriteUInt16(buffer *bytes.Buffer, val uint16)
- func WriteUInt32(buffer *bytes.Buffer, val uint32)
- func WriteUInt64(buffer *bytes.Buffer, val uint64)
- type AcknowledgePacket
- type ChannelOpPacket
- type ChannelOperation
- type ConnectionAcceptedPacket
- type ConnectionRejectedPacket
- type ConnectionRejectedReason
- type ConnectionRequestPacket
- type ContainerPacket
- type EncodeDecodeError
- type Packet
- type PacketID
Constants ¶
View Source
const PROTOCOL_VERSION uint8 = 0
Variables ¶
This section is empty.
Functions ¶
func WriteUInt16 ¶
func WriteUInt32 ¶
func WriteUInt64 ¶
Types ¶
type AcknowledgePacket ¶
type AcknowledgePacket struct {
// contains filtered or unexported fields
}
ID 0x0A - Packet sent whenever a packet with reliable flag was received. Can acknowledge multiple reliable packets
func (*AcknowledgePacket) Decode ¶
func (packet *AcknowledgePacket) Decode(data []byte) error
func (*AcknowledgePacket) Encode ¶
func (packet *AcknowledgePacket) Encode() ([]byte, error)
type ChannelOpPacket ¶
type ChannelOpPacket struct {
// contains filtered or unexported fields
}
ID 0x0B - Packet used to signal different network operations This also is used to close the entire connection, by closing channel 0 (reserved for protocol operations)
func (*ChannelOpPacket) Decode ¶
func (packet *ChannelOpPacket) Decode(data []byte) error
func (*ChannelOpPacket) Encode ¶
func (packet *ChannelOpPacket) Encode() ([]byte, error)
type ChannelOperation ¶
type ChannelOperation uint8
const ( OPEN_CHANNEL ChannelOperation = iota CLOSE_CHANNEL RESET_ORDERED_IDS )
type ConnectionAcceptedPacket ¶
type ConnectionAcceptedPacket struct {
ServerId uint64
}
ID 0x02 - Response from server to accept and open a connection
func (*ConnectionAcceptedPacket) Decode ¶
func (packet *ConnectionAcceptedPacket) Decode(data []byte) error
func (*ConnectionAcceptedPacket) Encode ¶
func (packet *ConnectionAcceptedPacket) Encode() ([]byte, error)
type ConnectionRejectedPacket ¶
type ConnectionRejectedPacket struct {
// contains filtered or unexported fields
}
ID 0x03 - Response from server to reject a connection request
func (*ConnectionRejectedPacket) Decode ¶
func (packet *ConnectionRejectedPacket) Decode(data []byte) error
func (*ConnectionRejectedPacket) Encode ¶
func (packet *ConnectionRejectedPacket) Encode() ([]byte, error)
type ConnectionRejectedReason ¶
type ConnectionRejectedReason uint8
const ( INCOMPATIBLE_PROTOCOL_VER ConnectionRejectedReason = iota MAX_CONNECTIONS_REACHED RATELIMITED )
type ConnectionRequestPacket ¶
ID: 0x01 - Send from client to server to try to open a connection
func (*ConnectionRequestPacket) Decode ¶
func (packet *ConnectionRequestPacket) Decode(data []byte) error
func (*ConnectionRequestPacket) Encode ¶
func (packet *ConnectionRequestPacket) Encode() ([]byte, error)
type ContainerPacket ¶
type ContainerPacket struct {
// contains filtered or unexported fields
}
ID 0x0C Container Packet acts as a header for all packets sent over the network
type EncodeDecodeError ¶
type EncodeDecodeError struct {
Reason string
}
func (EncodeDecodeError) Error ¶
func (err EncodeDecodeError) Error() string
Click to show internal directories.
Click to hide internal directories.