Documentation ¶
Index ¶
- Constants
- type ACK
- type AcknowledgementPacket
- type ConnectedPing
- type ConnectedPong
- type ConnectionAccept
- type ConnectionRequest
- type Datagram
- type EncapsulatedPacket
- func (packet *EncapsulatedPacket) Encode()
- func (packet *EncapsulatedPacket) GetFromBinary(stream *Datagram) (*EncapsulatedPacket, error)
- func (packet *EncapsulatedPacket) GetLength() int
- func (packet *EncapsulatedPacket) IsOrdered() bool
- func (packet *EncapsulatedPacket) IsReliable() bool
- func (packet *EncapsulatedPacket) IsSequenced() bool
- func (packet *EncapsulatedPacket) IsSequencedOrOrdered() bool
- type IConnectedPacket
- type IPacket
- type NAK
- type NewIncomingConnection
- type OpenConnectionReply1
- type OpenConnectionReply2
- type OpenConnectionRequest1
- type OpenConnectionRequest2
- type Packet
- func (packet *Packet) DecodeStep()
- func (packet *Packet) EncodeId()
- func (packet *Packet) GetAddress() (address string, port uint16, ipVersion byte)
- func (packet *Packet) GetId() int
- func (packet *Packet) HasMagic() bool
- func (packet *Packet) PutAddress(address string, port uint16, ipVersion byte)
- func (packet *Packet) ResetBase()
- type UnconnectedMessage
- type UnconnectedPing
- type UnconnectedPong
Constants ¶
View Source
const ( BitFlagValid = 0x80 BitFlagIsAck = 0x40 BitFlagIsNak = 0x20 BitFlagPacketPair = 0x10 BitFlagContinuousSend = 0x08 BitFlagNeedsBAndAs = 0x04 )
View Source
const ( ReliabilityUnreliable byte = iota ReliabilityUnreliableSequenced ReliabilityReliable ReliabilityReliableOrdered ReliabilityReliableSequenced ReliabilityUnreliableWithAck ReliabilityReliableWithAck ReliabilityReliableOrderedWithAck SplitFlag = 0x10 )
View Source
const ( FlagDatagramAck = 0xc0 FlagDatagramNack = 0xa0 )
View Source
const ( IdConnectedPing = 0x00 IdConnectedPong = 0x03 IdUnconnectedPing = 0x01 IdUnconnectedPong = 0x1c IdOpenConnectionRequest1 = 0x05 IdOpenConnectionReply1 = 0x06 IdOpenConnectionRequest2 = 0x07 IdOpenConnectionReply2 = 0x08 IdConnectionRequest = 0x09 IdConnectionAccept = 0x10 IdNewIncomingConnection = 0x13 IdDisconnectNotification = 0x15 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AcknowledgementPacket ¶
func (*AcknowledgementPacket) Decode ¶
func (packet *AcknowledgementPacket) Decode()
func (*AcknowledgementPacket) Encode ¶
func (packet *AcknowledgementPacket) Encode()
type ConnectedPing ¶
func NewConnectedPing ¶
func NewConnectedPing() *ConnectedPing
func (*ConnectedPing) Decode ¶
func (ping *ConnectedPing) Decode()
func (*ConnectedPing) Encode ¶
func (ping *ConnectedPing) Encode()
type ConnectedPong ¶
func NewConnectedPong ¶
func NewConnectedPong() *ConnectedPong
func (*ConnectedPong) Decode ¶
func (pong *ConnectedPong) Decode()
func (*ConnectedPong) Encode ¶
func (pong *ConnectedPong) Encode()
type ConnectionAccept ¶
type ConnectionAccept struct { *Packet ClientAddress string ClientPort uint16 PingSendTime uint64 PongSendTime uint64 SystemAddresses []string SystemPorts []uint16 SystemIdVersions []byte }
func NewConnectionAccept ¶
func NewConnectionAccept() *ConnectionAccept
func (*ConnectionAccept) Decode ¶
func (request *ConnectionAccept) Decode()
func (*ConnectionAccept) Encode ¶
func (request *ConnectionAccept) Encode()
type ConnectionRequest ¶
func NewConnectionRequest ¶
func NewConnectionRequest() *ConnectionRequest
func (*ConnectionRequest) Decode ¶
func (request *ConnectionRequest) Decode()
func (*ConnectionRequest) Encode ¶
func (request *ConnectionRequest) Encode()
type Datagram ¶
type Datagram struct { *Packet PacketPair bool ContinuousSend bool NeedsBAndAs bool SequenceNumber uint32 // contains filtered or unexported fields }
func NewDatagram ¶
func NewDatagram() *Datagram
func (*Datagram) AddPacket ¶
func (datagram *Datagram) AddPacket(packet *EncapsulatedPacket)
func (*Datagram) GetPackets ¶
func (datagram *Datagram) GetPackets() *[]*EncapsulatedPacket
type EncapsulatedPacket ¶
type EncapsulatedPacket struct { *Packet Reliability byte HasSplit bool Length uint MessageIndex uint32 OrderIndex uint32 OrderChannel byte SplitId int16 SplitCount uint SplitIndex uint SequenceIndex uint32 }
func NewEncapsulatedPacket ¶
func NewEncapsulatedPacket() *EncapsulatedPacket
func (*EncapsulatedPacket) Encode ¶
func (packet *EncapsulatedPacket) Encode()
func (*EncapsulatedPacket) GetFromBinary ¶
func (packet *EncapsulatedPacket) GetFromBinary(stream *Datagram) (*EncapsulatedPacket, error)
func (*EncapsulatedPacket) GetLength ¶
func (packet *EncapsulatedPacket) GetLength() int
func (*EncapsulatedPacket) IsOrdered ¶
func (packet *EncapsulatedPacket) IsOrdered() bool
func (*EncapsulatedPacket) IsReliable ¶
func (packet *EncapsulatedPacket) IsReliable() bool
func (*EncapsulatedPacket) IsSequenced ¶
func (packet *EncapsulatedPacket) IsSequenced() bool
func (*EncapsulatedPacket) IsSequencedOrOrdered ¶
func (packet *EncapsulatedPacket) IsSequencedOrOrdered() bool
type IConnectedPacket ¶
type IConnectedPacket interface { Encode() GetBuffer() []byte }
type NewIncomingConnection ¶
type NewIncomingConnection struct { *Packet ServerAddress string ServerPort uint16 PingSendTime uint64 PongSendTime uint64 SystemAddresses []string SystemPorts []uint16 SystemIdVersions []byte }
func NewNewIncomingConnection ¶
func NewNewIncomingConnection() *NewIncomingConnection
func (*NewIncomingConnection) Decode ¶
func (request *NewIncomingConnection) Decode()
func (*NewIncomingConnection) Encode ¶
func (request *NewIncomingConnection) Encode()
type OpenConnectionReply1 ¶
type OpenConnectionReply1 struct { *UnconnectedMessage ServerId int64 MtuSize int16 Security bool }
func NewOpenConnectionReply1 ¶
func NewOpenConnectionReply1() *OpenConnectionReply1
func (*OpenConnectionReply1) Decode ¶
func (response *OpenConnectionReply1) Decode()
func (*OpenConnectionReply1) Encode ¶
func (response *OpenConnectionReply1) Encode()
type OpenConnectionReply2 ¶
type OpenConnectionReply2 struct { *UnconnectedMessage ServerId int64 MtuSize int16 ClientAddress string ClientPort uint16 UseEncryption bool }
func NewOpenConnectionReply2 ¶
func NewOpenConnectionReply2() *OpenConnectionReply2
func (*OpenConnectionReply2) Decode ¶
func (response *OpenConnectionReply2) Decode()
func (*OpenConnectionReply2) Encode ¶
func (response *OpenConnectionReply2) Encode()
type OpenConnectionRequest1 ¶
type OpenConnectionRequest1 struct { *UnconnectedMessage Protocol byte MtuSize int16 }
func NewOpenConnectionRequest1 ¶
func NewOpenConnectionRequest1() *OpenConnectionRequest1
func (*OpenConnectionRequest1) Decode ¶
func (request *OpenConnectionRequest1) Decode()
func (*OpenConnectionRequest1) Encode ¶
func (request *OpenConnectionRequest1) Encode()
type OpenConnectionRequest2 ¶
type OpenConnectionRequest2 struct { *UnconnectedMessage ServerAddress string ServerPort uint16 MtuSize int16 ClientId int64 }
func NewOpenConnectionRequest2 ¶
func NewOpenConnectionRequest2() *OpenConnectionRequest2
func (*OpenConnectionRequest2) Decode ¶
func (request *OpenConnectionRequest2) Decode()
func (*OpenConnectionRequest2) Encode ¶
func (request *OpenConnectionRequest2) Encode()
type Packet ¶
func (*Packet) DecodeStep ¶
func (packet *Packet) DecodeStep()
func (*Packet) GetAddress ¶
func (*Packet) PutAddress ¶
type UnconnectedMessage ¶
type UnconnectedMessage struct { *Packet // contains filtered or unexported fields }
func NewUnconnectedMessage ¶
func NewUnconnectedMessage(packet *Packet) *UnconnectedMessage
func (*UnconnectedMessage) HasValidMagic ¶
func (message *UnconnectedMessage) HasValidMagic() bool
func (*UnconnectedMessage) PutMagic ¶
func (message *UnconnectedMessage) PutMagic()
func (*UnconnectedMessage) ReadMagic ¶
func (message *UnconnectedMessage) ReadMagic()
type UnconnectedPing ¶
type UnconnectedPing struct { *UnconnectedMessage PingTime int64 }
func NewUnconnectedPing ¶
func NewUnconnectedPing() *UnconnectedPing
func (*UnconnectedPing) Decode ¶
func (ping *UnconnectedPing) Decode()
func (*UnconnectedPing) Encode ¶
func (ping *UnconnectedPing) Encode()
type UnconnectedPong ¶
type UnconnectedPong struct { *UnconnectedMessage PingTime int64 ServerId int64 PongData string }
func NewUnconnectedPong ¶
func NewUnconnectedPong() *UnconnectedPong
func (*UnconnectedPong) Decode ¶
func (pong *UnconnectedPong) Decode()
func (*UnconnectedPong) Encode ¶
func (pong *UnconnectedPong) Encode()
Source Files ¶
- acknowledgement.go
- connected_ping.go
- connected_pong.go
- connection_accept.go
- connection_request.go
- datagram.go
- encapsulated.go
- identifiers.go
- new_incoming_connection.go
- open_connection_reply_1.go
- open_connection_reply_2.go
- open_connection_request_1.go
- open_connection_request_2.go
- packet.go
- unconnected_message.go
- unconnected_ping.go
- unconnected_pong.go
Click to show internal directories.
Click to hide internal directories.