codec

package
v0.0.0-...-d85f73f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 7, 2022 License: AGPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EncryptTypeNotNeedEncrypt = 0x00
	EncryptTypeEncryptByD2Key = 0x01
	EncryptTypeEncryptByZeros = 0x02
)
View Source
const (
	FlagNoCompression   = 0x00000000
	FlagZlibCompression = 0x00000001
)
View Source
const (
	VersionDefault = 0x0000000a
	VersionSimple  = 0x0000000b
)

Variables

This section is empty.

Functions

func CopyServerToClientMessage

func CopyServerToClientMessage(dst, src *ServerToClientMessage)

Types

type ClientCodec

type ClientCodec interface {
	Close() error
	SetDeadline(t time.Time) error
	SetReadDeadline(t time.Time) error
	SetWriteDeadline(t time.Time) error

	ReadBody(msg *ServerToClientMessage) error
	ReadHead(msg *ServerToClientMessage) error
	Write(msg *ClientToServerMessage) error
}

type ClientToServerMessage

type ClientToServerMessage struct {
	Simple      bool
	Version     uint32
	EncryptType uint8
	UserD2      []byte
	Username    string

	UserD2Key [16]byte

	Seq           uint32
	FixID         uint32
	AppID         uint32
	NetworkType   uint8 // 0x00: Others; 0x01: Wi-Fi
	NetIPFamily   uint8 // 0x00: Others; 0x01: IPv4; 0x02: IPv6; 0x03: Dual
	UserA2        []byte
	ServiceMethod string
	Cookie        []byte
	IMEI          string
	KSID          []byte
	IMSI          string
	Revision      string
	ReserveField  []byte
	Buffer        []byte
}

type ServerToClientMessage

type ServerToClientMessage struct {
	Version     uint32
	EncryptType uint8
	Username    string

	UserD2Key [16]byte

	Seq           uint32
	Code          uint32
	Message       string
	ServiceMethod string
	Cookie        []byte
	Flag          uint32
	ReserveField  []byte
	Buffer        []byte
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL