Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetLangBuf ¶ added in v1.0.2
func GetLangStr ¶ added in v1.0.2
Types ¶
type CClientSocket ¶
type CClientSocket interface {
SetID(id int32)
GetID() int32
GetAddr() string
XORRecv(buf []byte)
XORSend(buf []byte)
OnRead()
OnConnect()
OnAliveReq(LP_AliveReq uint16)
OnMigrateCommand(LP_MigrateCommand uint16, ip string, port int16)
SendPacket(oPacket COutPacket)
Flush()
OnError(err error)
Close()
}
func NewCClientSocket ¶
func NewCClientSocket(delegate CClientSocketDelegate, conn net.Conn, rcvIV []byte, sndIV []byte) CClientSocket
type CClientSocketDelegate ¶ added in v1.0.7
type CClientSocketDelegate interface {
DebugInPacketLog(id int32, iPacket CInPacket)
DebugOutPacketLog(id int32, oPacket COutPacket)
ProcessPacket(cs CClientSocket, iPacket CInPacket)
SocketClose(id int32)
}
type CInPacket ¶
type CInPacket interface {
AppendBuffer(pBuff []byte, bEnc bool)
DecryptData(dwKey []byte)
GetType() uint16
GetTypeByte() uint8
GetRemain() int
GetOffset() int
GetLength() int
DecodeBool() bool
Decode1() int8
Decode2() int16
Decode4() int32
Decode8() int64
DecodeFT() time.Time
DecodeStr() string
DecodeLocalStr() string
DecodeLocalName() string
DecodeBuffer(uSize int) []byte
DumpString(nSize int) string
Clear()
}
func NewCInPacket ¶
type COutPacket ¶
type COutPacket interface {
GetType() uint16
GetTypeByte() uint8
GetSendBuffer() []byte
GetOffset() int
GetLength() int
EncodeBool(b bool)
Encode1(n int8)
Encode2(n int16)
Encode4(n int32)
Encode8(n int64)
EncodeFT(t time.Time)
EncodeStr(s string)
EncodeLocalStr(s string)
EncodeLocalName(s string)
EncodeBuffer(buf []byte)
MakeBufferList(uSeqBase uint16, bEnc bool, dwKey []byte) []byte
DumpString(nSize int) string
}
func NewCOutPacket ¶
func NewCOutPacket(nType uint16) COutPacket
func NewCOutPacketByte ¶ added in v1.0.9
func NewCOutPacketByte(nType uint8) COutPacket
Source Files
¶
Click to show internal directories.
Click to hide internal directories.