internal

package
v0.0.0-...-348a65b Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2024 License: AGPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const PacketMaxLen = 343 * 1024 // 最大应用层包长度

Variables

View Source
var CLIENT_CONN_NUM int32 = 0 // 当前客户端连接数

Functions

func DecodeBinToPayload

func DecodeBinToPayload(data []byte, kcpMsgList *[]*KcpMsg, xorKey []byte)

func DecodeLoop

func DecodeLoop(data []byte, kcpMsgList *[]*KcpMsg)

func EncodePayloadToBin

func EncodePayloadToBin(kcpMsg *KcpMsg, xorKey []byte) (bin []byte)

func KcpNetInfo

func KcpNetInfo()

func NewBot

func NewBot()

Types

type Game

type Game struct {
	EntryId uint32
	Pos     *Vector
	Rot     *Vector
}

type KcpMsg

type KcpMsg struct {
	CmdId     uint16
	HeadData  []byte
	ProtoData []byte
}

type ProtoMessage

type ProtoMessage struct {
	// contains filtered or unexported fields
}

type ProtoMsg

type ProtoMsg struct {
	CmdId          uint16
	PayloadMessage pb.Message
}

type RoBot

type RoBot struct {
	HttpClient  *resty.Client
	AccountName string
	AccountUid  string
	GameUid     uint32
	IsXor       bool
	Seed        uint64
	Token       string
	XorKey      []byte
	KcpAddr     string
	KcpPort     uint32
	KcpConn     net.Conn
	Game        *Game
}

func (*RoBot) DecodePayloadToProto

func (r *RoBot) DecodePayloadToProto(msg *KcpMsg) (protoObj pb.Message)

func (*RoBot) EncodeProtoToPayload

func (r *RoBot) EncodeProtoToPayload(protoMsg *ProtoMsg) (kcpMsg *KcpMsg)

func (*RoBot) EnterSceneByServerScNotify

func (r *RoBot) EnterSceneByServerScNotify(payloadMsg pb.Message)

func (*RoBot) EnterSceneCsReq

func (r *RoBot) EnterSceneCsReq()

func (*RoBot) GetCurSceneInfoScRsp

func (r *RoBot) GetCurSceneInfoScRsp(payloadMsg pb.Message)

func (*RoBot) PlayerGetTokenCsReq

func (r *RoBot) PlayerGetTokenCsReq()

func (*RoBot) PlayerHeartBeatCsReq

func (r *RoBot) PlayerHeartBeatCsReq()

func (*RoBot) PlayerHeartbeatScRsp

func (r *RoBot) PlayerHeartbeatScRsp(payloadMsg pb.Message)

func (*RoBot) PlayerLoginCsReq

func (r *RoBot) PlayerLoginCsReq()

func (*RoBot) PlayerLoginScRsp

func (r *RoBot) PlayerLoginScRsp()

func (*RoBot) RegisterMessage

func (r *RoBot) RegisterMessage(cmdId uint16, payloadMsg pb.Message)

type Vector

type Vector struct {
	X int32
	Y int32
	Z int32
}

Jump to

Keyboard shortcuts

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