Documentation
¶
Index ¶
- Constants
- func GetLangBuf(s string) []byte
- func GetLangStr(buf []byte) string
- func New(setting *Setting)
- func SetLogger(backupDir string, filename string, level slog.Level, done chan bool)
- type AESInitType
- type CClientSocket
- type CClientSocketDelegate
- type CInPacket
- type COutPacket
- type CipherType
- type Region
- type Setting
Constants ¶
View Source
const ( SERVER_TYPE string = "login" SERVER_ADDR string = "127.0.0.1:8484" LOG_BACKUP_DIR string = "./log" HEADER_LENGTH int = 4 MAX_DATA_LENGTH int = 1456 FT_EPOCH_DIFF int64 = 116444736000000000 // FileTime epoch is January 1, 1601 GMSCW_DES_KEY string = "G0dD@mnN#H@ckEr!" KMS_DES_KEY string = "G0dD@mnN#H@ckEr!" JMS_DES_KEY string = "M@pl3J@p@nH@ck3r" CMS_DES_KEY string = "aVbTpJ5=ZjG&Db3$" TMS_DES_KEY string = "BrN=r54jQp2@yP6G" GMS_DES_KEY string = "N3x@nGLEUH@ckEr!" )
Variables ¶
This section is empty.
Functions ¶
func GetLangBuf ¶ added in v1.0.2
func GetLangStr ¶ added in v1.0.2
Types ¶
type AESInitType ¶ added in v1.1.3
type AESInitType uint8
const ( Default AESInitType = iota Duplicate Shuffle )
type CClientSocket ¶
type CClientSocket interface {
SetID(id int32)
GetID() int32
GetAddr() string
XORRecv(buf []byte)
XORSend(buf []byte)
OnRead()
OnConnect()
OnAliveAck()
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 Region, version uint16, minorVersion string, seqRcv [4]byte, seqSnd [4]byte) 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 CipherType, dwKey []byte) []byte
DumpString(nSize int) string
}
func NewCOutPacket ¶
func NewCOutPacket(nType ...any) COutPacket
type CipherType ¶ added in v1.1.3
type CipherType uint8
const ( AESCipher CipherType = iota XORCipher LinearCipher NullCipher )
Source Files
¶
Click to show internal directories.
Click to hide internal directories.