Documentation
¶
Index ¶
- Variables
- func LookUpTypeByPacketInfo(direction proto_base.Direction, state proto_base.State, pid, version int32) (p proto_base.PacketInfo, ok bool)
- func LookUpTypeByPacketInfoAndCopyType(direction proto_base.Direction, state proto_base.State, pid, version int32) (p proto_base.EncodeDecodeAble, ok bool)
- func LookupPacketInfoByType(packet proto_base.EncodeDecodeAble) (p proto_base.PacketInfo, ok bool)
- func LookupPacketInfoByTypeLookupPacketInfoByTypeAndMore(packet proto_base.EncodeDecodeAble, state proto_base.State) (p proto_base.PacketInfo, ok bool)
- type Conn
- func (c *Conn) OnTick(_ event.Tick) (err error)
- func (c *Conn) Receive() (packet proto_base.EncodeDecodeAble, err error)
- func (c *Conn) Send(packet proto_base.EncodeDecodeAble) (err error)
- func (c *Conn) SetState(state proto_base.State)
- func (c *Conn) SetVersion(version string) (err error)
- func (c *Conn) Start(handlers ...any) (err error)
- func (c *Conn) State() proto_base.State
- type RawConn
- type UnCodablePacket
Constants ¶
This section is empty.
Variables ¶
View Source
var BadPacketIdError = errors.New("bad packet id")
View Source
var BadPacketTypeError = errors.New("bad packet type")
View Source
var PacketNotFullyDecodedError = errors.New("packet not fully decoded")
Functions ¶
func LookUpTypeByPacketInfo ¶
func LookUpTypeByPacketInfo(direction proto_base.Direction, state proto_base.State, pid, version int32) (p proto_base.PacketInfo, ok bool)
func LookUpTypeByPacketInfoAndCopyType ¶
func LookUpTypeByPacketInfoAndCopyType(direction proto_base.Direction, state proto_base.State, pid, version int32) (p proto_base.EncodeDecodeAble, ok bool)
func LookupPacketInfoByType ¶
func LookupPacketInfoByType(packet proto_base.EncodeDecodeAble) (p proto_base.PacketInfo, ok bool)
func LookupPacketInfoByTypeLookupPacketInfoByTypeAndMore ¶
func LookupPacketInfoByTypeLookupPacketInfoByTypeAndMore(packet proto_base.EncodeDecodeAble, state proto_base.State) (p proto_base.PacketInfo, ok bool)
Types ¶
type Conn ¶
type Conn struct {
RawConn
*event.Loop
Actor proto_base.Actor
Version string
ProtocolVersion int32
// contains filtered or unexported fields
}
func (*Conn) Receive ¶
func (c *Conn) Receive() (packet proto_base.EncodeDecodeAble, err error)
func (*Conn) Send ¶
func (c *Conn) Send(packet proto_base.EncodeDecodeAble) (err error)
func (*Conn) SetState ¶
func (c *Conn) SetState(state proto_base.State)
func (*Conn) SetVersion ¶
func (*Conn) State ¶
func (c *Conn) State() proto_base.State
type RawConn ¶
func (*RawConn) ReceiveRaw ¶
type UnCodablePacket ¶
type UnCodablePacket struct {
Err error
Data []byte
Direction proto_base.Direction
}
UnCodablePacket represents a packet that could not be decoded due to proto_generated not supporting all packets.
Click to show internal directories.
Click to hide internal directories.