Documentation
¶
Index ¶
- Constants
- Variables
- func GetLangBuf(s string) []byte
- func GetLangStr(buf []byte) string
- func New(setting *Setting)
- func SetLogger(backupDir string, filename string, level slog.Level) func()
- type AESInitType
- type CClientSocket
- type CClientSocketDelegate
- type CInPacket
- type COutPacket
- type CipherType
- type Region
- type Setting
Constants ¶
View Source
const ( LOG_BACKUP_DIR string = "./log" SERVER_TYPE string = "login" SERVER_ADDR string = "127.0.0.1:8484" HEADER_LENGTH int = 4 MAX_DATA_LENGTH int = 1456 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!" )
View Source
const FT_EPOCH_DIFF int64 = 116444736000000000 // (difference between 1601 and 1970 epochs)
Variables ¶
View Source
var ( ST_ZERO time.Time // ST 0001-01-01 00:00:00 <-> FT -504911232000000000 ST_ZERO_OVERFLOW time.Time = time.Date(1754, 8, 30, 22, 43, 41, 0, time.UTC) // ST 1754-08-30 22:43:41 <-> FT 48491090210000000 ST_SQL_MIN time.Time = time.Date(1753, 1, 1, 0, 0, 0, 0, time.UTC) // ST 1753-01-01 00:00:00 <-> FT 47966688000000000 ST_SQL_MIN_DATE time.Time = time.Date(1000, 1, 1, 0, 0, 0, 0, time.UTC) // ST 1000-01-01 00:00:00 <-> FT -189657504000000000 ST_START time.Time = time.Date(1900, 1, 1, 0, 0, 0, 0, time.UTC) // ST 1900-01-01 00:00:00 <-> FT 94354848000000000 ST_END time.Time = time.Date(2079, 1, 1, 0, 0, 0, 0, time.UTC) // ST 2079-01-01 00:00:00 <-> FT 150842304000000000 ST_EMPTY time.Time = time.Date(0, 0, 0, 0, 0, 0, 0, time.UTC) // ST 0000-00-00 00:00:00 <-> FT -505255104000000000 )
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()
LoopAliveAck(aliveAckSec int)
OnAliveAck()
LoopAliveReq(aliveReqSec int, LP_AliveReq uint16)
OnAliveReq(LP_AliveReq uint16)
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
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
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.