Versions in this module Expand all Collapse all v0 v0.1.0 Jan 6, 2021 Changes in this version + var ErrExecuteClientClosed = errors.New("AddExecute failed: cannot find execute client") + var ErrExecuteContextDone = errors.New("AddExecute failed: goroutine context done") + var ExecuteFuncChanNum int = 100 + func AddHeroExecution(ctx context.Context, c *Client) error + func AddItemExecution(ctx context.Context, c *Client) error + func CreatePlayerExecution(ctx context.Context, c *Client) error + func LogonExecution(ctx context.Context, c *Client) error + func NewClientBotsFlags() []cli.Flag + func NewFlags() []cli.Flag + func PubSyncPlayerInfoExecution(ctx context.Context, c *Client) error + func QueryHerosExecution(ctx context.Context, c *Client) error + func QueryItemsExecution(ctx context.Context, c *Client) error + func QueryPlayerInfoExecution(ctx context.Context, c *Client) error + func RpcSyncPlayerInfoExecution(ctx context.Context, c *Client) error + type Client struct + Id int64 + func NewClient(ch chan ExecuteFunc) *Client + func (c *Client) Action(ctx *cli.Context) error + func (c *Client) Execute(ctx *cli.Context) error + func (c *Client) Run(arguments []string) error + func (c *Client) SendMessage(msg *transport.Message) + func (c *Client) Stop() + func (c *Client) WaitReturnedMsg(ctx context.Context, waitMsgNames string) + type ClientBots struct + func NewClientBots() *ClientBots + func (c *ClientBots) Action(ctx *cli.Context) error + func (c *ClientBots) AddExecute(ctx context.Context, id int64, fn ExecuteFunc) error + func (c *ClientBots) Run(arguments []string) error + func (c *ClientBots) Stop() + type Command struct + Cb func(context.Context, []string) (bool, string) + DefaultInput string + GotoPageID int + InputText string + Number int + PageID int + Text string + type CommandPage struct + Cmds []*Command + PageID int + ParentPageID int + type Commander struct + func NewCommander(c *Client) *Commander + func (cmd *Commander) CmdAccountLogon(ctx context.Context, result []string) (bool, string) + func (cmd *Commander) CmdAddHero(ctx context.Context, result []string) (bool, string) + func (cmd *Commander) CmdAddItem(ctx context.Context, result []string) (bool, string) + func (cmd *Commander) CmdAddTalent(ctx context.Context, result []string) (bool, string) + func (cmd *Commander) CmdAddToken(ctx context.Context, result []string) (bool, string) + func (cmd *Commander) CmdChangeExp(ctx context.Context, result []string) (bool, string) + func (cmd *Commander) CmdChangeLevel(ctx context.Context, result []string) (bool, string) + func (cmd *Commander) CmdCliAccountDisconnect(ctx context.Context, result []string) (bool, string) + func (cmd *Commander) CmdCreatePlayer(ctx context.Context, result []string) (bool, string) + func (cmd *Commander) CmdDelHero(ctx context.Context, result []string) (bool, string) + func (cmd *Commander) CmdDelItem(ctx context.Context, result []string) (bool, string) + func (cmd *Commander) CmdHeroPutonEquip(ctx context.Context, result []string) (bool, string) + func (cmd *Commander) CmdHeroTakeoffEquip(ctx context.Context, result []string) (bool, string) + func (cmd *Commander) CmdPublicSyncPlayerInfo(ctx context.Context, result []string) (bool, string) + func (cmd *Commander) CmdQueryHeros(ctx context.Context, result []string) (bool, string) + func (cmd *Commander) CmdQueryItems(ctx context.Context, result []string) (bool, string) + func (cmd *Commander) CmdQueryPlayerInfo(ctx context.Context, result []string) (bool, string) + func (cmd *Commander) CmdQueryTalents(ctx context.Context, result []string) (bool, string) + func (cmd *Commander) CmdQueryTokens(ctx context.Context, result []string) (bool, string) + func (cmd *Commander) CmdQuit(ctx context.Context, result []string) (bool, string) + func (cmd *Commander) CmdSendHeartBeat(ctx context.Context, result []string) (bool, string) + func (cmd *Commander) CmdServerAccountDisconnect(ctx context.Context, result []string) (bool, string) + func (cmd *Commander) CmdStartStageCombat(ctx context.Context, result []string) (bool, string) + func (cmd *Commander) CmdSyncPlayerInfo(ctx context.Context, result []string) (bool, string) + func (cmd *Commander) CmdUseItem(ctx context.Context, result []string) (bool, string) + func (cmd *Commander) CmdWebSocketAccountLogon(ctx context.Context, result []string) (bool, string) + type ExecuteFunc func(context.Context, *Client) error + type GameInfo struct + AccountID int64 + GameID string + PublicTcpAddr string + PublicWsAddr string + UserID int64 + UserName string + type GinServer struct + func NewGinServer(ctx *cli.Context) *GinServer + func (s *GinServer) Exit(ctx context.Context) + func (s *GinServer) Main(ctx *cli.Context) error + func (s *GinServer) Run(ctx *cli.Context) error + type MsgHandler struct + func NewMsgHandler(c *Client, ctx *cli.Context) *MsgHandler + func (h *MsgHandler) OnM2C_AccountLogon(ctx context.Context, sock transport.Socket, msg *transport.Message) error + func (h *MsgHandler) OnM2C_CreatePlayer(ctx context.Context, sock transport.Socket, msg *transport.Message) error + func (h *MsgHandler) OnM2C_DelItem(ctx context.Context, sock transport.Socket, msg *transport.Message) error + func (h *MsgHandler) OnM2C_ExpUpdate(ctx context.Context, sock transport.Socket, msg *transport.Message) error + func (h *MsgHandler) OnM2C_HeartBeat(ctx context.Context, sock transport.Socket, msg *transport.Message) error + func (h *MsgHandler) OnM2C_HeroAttUpdate(ctx context.Context, sock transport.Socket, msg *transport.Message) error + func (h *MsgHandler) OnM2C_HeroInfo(ctx context.Context, sock transport.Socket, msg *transport.Message) error + func (h *MsgHandler) OnM2C_HeroList(ctx context.Context, sock transport.Socket, msg *transport.Message) error + func (h *MsgHandler) OnM2C_ItemAdd(ctx context.Context, sock transport.Socket, msg *transport.Message) error + func (h *MsgHandler) OnM2C_ItemList(ctx context.Context, sock transport.Socket, msg *transport.Message) error + func (h *MsgHandler) OnM2C_ItemUpdate(ctx context.Context, sock transport.Socket, msg *transport.Message) error + func (h *MsgHandler) OnM2C_PublicSyncPlayerInfo(ctx context.Context, sock transport.Socket, msg *transport.Message) error + func (h *MsgHandler) OnM2C_QueryPlayerInfo(ctx context.Context, sock transport.Socket, msg *transport.Message) error + func (h *MsgHandler) OnM2C_StartStageCombat(ctx context.Context, sock transport.Socket, msg *transport.Message) error + func (h *MsgHandler) OnM2C_SyncPlayerInfo(ctx context.Context, sock transport.Socket, msg *transport.Message) error + func (h *MsgHandler) OnM2C_TalentList(ctx context.Context, sock transport.Socket, msg *transport.Message) error + func (h *MsgHandler) OnM2C_TokenList(ctx context.Context, sock transport.Socket, msg *transport.Message) error + func (h *MsgHandler) OnMS_SelectPlayer(ctx context.Context, sock transport.Socket, msg *transport.Message) error + type PromptUI struct + func NewPromptUI(c *Client, ctx *cli.Context) *PromptUI + func (p *PromptUI) Run(ctx *cli.Context) error + type TransportClient struct + func NewTransportClient(c *Client, ctx *cli.Context) *TransportClient + func (t *TransportClient) Exit(ctx *cli.Context) + func (t *TransportClient) GetGateEndPoints() []string + func (t *TransportClient) ReturnMsgName() <-chan string + func (t *TransportClient) Run(ctx *cli.Context) error + func (t *TransportClient) SendMessage(msg *transport.Message) + func (t *TransportClient) SetGameInfo(info *GameInfo) + func (t *TransportClient) SetProtocol(p string) + func (t *TransportClient) StartConnect(ctx context.Context) error + func (t *TransportClient) StartDisconnect()