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()
OnReceiveHotfix(LP_ApplyHotfix uint16)
OnAliveReq(LP_AliveReq uint16)
OnMigrateCommand(LP_MigrateCommand uint16, ip string, port int16)
OnOpcodeEncryption(LP_OpcodeEncryption uint16, startOpcode uint16, endOpcode uint16, isSplit bool)
DecryptOpcode(randNum uint16) uint16
SetLinearCipher(toggle bool)
SendPacket(oPacket COutPacket)
Stepping(iv []byte)
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)
NewConnectPacket(region def.Region, version uint16, minorVersion string, seqRcv [4]byte, seqSnd [4]byte) COutPacket
NewHotfixPacket() COutPacket
ProcessPacket(cs CClientSocket, iPacket CInPacket)
SocketClose(id int32)
}
type CInPacket ¶
type CInPacket interface {
DecryptHeader(pBuff []byte)
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)
EncryptHeader(pBuff []byte, dataLen int, dwKey []byte)
MakeBufferList(cipherType def.CipherType, dwKey []byte) []byte
DumpString(nSize int) string
}
func NewCOutPacket ¶
func NewCOutPacket(nType ...any) COutPacket
Source Files
¶
Click to show internal directories.
Click to hide internal directories.