Documentation ¶
Index ¶
- Constants
- Variables
- type EncryptType
- type IncomingPacketInfo
- type Request
- type RequestParams
- type RequestType
- type TCPListener
- func (t *TCPListener) Close()
- func (t *TCPListener) Connect(addr *net.TCPAddr) error
- func (t *TCPListener) PlannedDisconnect(f func(*TCPListener))
- func (t *TCPListener) ReadBytes(len int) ([]byte, error)
- func (t *TCPListener) ReadInt32() (int32, error)
- func (t *TCPListener) UnexpectedDisconnect(f func(*TCPListener, error))
- func (t *TCPListener) Write(buf []byte) error
- type Transport
Constants ¶
View Source
const ( RequestTypeLogin = 0x0A RequestTypeSimple = 0x0B )
Variables ¶
View Source
var ErrConnectionClosed = errors.New("connection closed")
Functions ¶
This section is empty.
Types ¶
type EncryptType ¶
type EncryptType uint32
const ( EncryptTypeNoEncrypt EncryptType = iota // 0x00 EncryptTypeD2Key // 0x01 EncryptTypeEmptyKey // 0x02 )
type IncomingPacketInfo ¶
type IncomingPacketInfo struct { CommandName string SequenceId uint16 Params RequestParams }
type Request ¶
type Request struct { Type RequestType EncryptType EncryptType SequenceID int32 Uin int64 CommandName string Body []byte }
type RequestParams ¶
type RequestParams map[string]interface{}
func (RequestParams) Bool ¶
func (p RequestParams) Bool(k string) bool
func (RequestParams) Int32 ¶
func (p RequestParams) Int32(k string) int32
type RequestType ¶
type RequestType uint32
type TCPListener ¶
type TCPListener struct {
// contains filtered or unexported fields
}
func (*TCPListener) Close ¶
func (t *TCPListener) Close()
func (*TCPListener) PlannedDisconnect ¶
func (t *TCPListener) PlannedDisconnect(f func(*TCPListener))
PlannedDisconnect 预料中的断开连接 如调用 Close() Connect()
func (*TCPListener) ReadInt32 ¶
func (t *TCPListener) ReadInt32() (int32, error)
func (*TCPListener) UnexpectedDisconnect ¶
func (t *TCPListener) UnexpectedDisconnect(f func(*TCPListener, error))
UnexpectedDisconnect 未预料的断开连接
func (*TCPListener) Write ¶
func (t *TCPListener) Write(buf []byte) error
Click to show internal directories.
Click to hide internal directories.