client

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2021 License: MIT Imports: 32 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrExecuteClientClosed = errors.New("AddExecute failed: cannot find execute client")
View Source
var ErrExecuteContextDone = errors.New("AddExecute failed: goroutine context done")
View Source
var ExecuteFuncChanNum int = 100

Functions

func AddHeroExecution

func AddHeroExecution(ctx context.Context, c *Client) error

func AddItemExecution

func AddItemExecution(ctx context.Context, c *Client) error

func CreatePlayerExecution

func CreatePlayerExecution(ctx context.Context, c *Client) error

func LogonExecution

func LogonExecution(ctx context.Context, c *Client) error

func NewClientBotsFlags

func NewClientBotsFlags() []cli.Flag

func NewFlags

func NewFlags() []cli.Flag

func PubSyncPlayerInfoExecution

func PubSyncPlayerInfoExecution(ctx context.Context, c *Client) error

func QueryHerosExecution

func QueryHerosExecution(ctx context.Context, c *Client) error

func QueryItemsExecution

func QueryItemsExecution(ctx context.Context, c *Client) error

func QueryPlayerInfoExecution

func QueryPlayerInfoExecution(ctx context.Context, c *Client) error

func RpcSyncPlayerInfoExecution

func RpcSyncPlayerInfoExecution(ctx context.Context, c *Client) error

Types

type Client

type Client struct {
	Id int64
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewClient

func NewClient(ch chan ExecuteFunc) *Client

func (*Client) Action

func (c *Client) Action(ctx *cli.Context) error

func (*Client) Execute

func (c *Client) Execute(ctx *cli.Context) error

func (*Client) Run

func (c *Client) Run(arguments []string) error

func (*Client) SendMessage

func (c *Client) SendMessage(msg *transport.Message)

func (*Client) Stop

func (c *Client) Stop()

func (*Client) WaitReturnedMsg

func (c *Client) WaitReturnedMsg(ctx context.Context, waitMsgNames string)

type ClientBots

type ClientBots struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewClientBots

func NewClientBots() *ClientBots

func (*ClientBots) Action

func (c *ClientBots) Action(ctx *cli.Context) error

func (*ClientBots) AddExecute

func (c *ClientBots) AddExecute(ctx context.Context, id int64, fn ExecuteFunc) error

func (*ClientBots) Run

func (c *ClientBots) Run(arguments []string) error

func (*ClientBots) Stop

func (c *ClientBots) Stop()

type Command

type Command struct {
	Number       int
	Text         string
	PageID       int
	GotoPageID   int
	Cb           func(context.Context, []string) (bool, string)
	InputText    string
	DefaultInput string
}

type CommandPage

type CommandPage struct {
	PageID       int
	ParentPageID int
	Cmds         []*Command
}

type Commander

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

func NewCommander

func NewCommander(c *Client) *Commander

func (*Commander) CmdAccountLogon

func (cmd *Commander) CmdAccountLogon(ctx context.Context, result []string) (bool, string)

func (*Commander) CmdAddHero

func (cmd *Commander) CmdAddHero(ctx context.Context, result []string) (bool, string)

func (*Commander) CmdAddItem

func (cmd *Commander) CmdAddItem(ctx context.Context, result []string) (bool, string)

func (*Commander) CmdAddTalent

func (cmd *Commander) CmdAddTalent(ctx context.Context, result []string) (bool, string)

func (*Commander) CmdAddToken

func (cmd *Commander) CmdAddToken(ctx context.Context, result []string) (bool, string)

func (*Commander) CmdChangeExp

func (cmd *Commander) CmdChangeExp(ctx context.Context, result []string) (bool, string)

func (*Commander) CmdChangeLevel

func (cmd *Commander) CmdChangeLevel(ctx context.Context, result []string) (bool, string)

func (*Commander) CmdCliAccountDisconnect

func (cmd *Commander) CmdCliAccountDisconnect(ctx context.Context, result []string) (bool, string)

func (*Commander) CmdCreatePlayer

func (cmd *Commander) CmdCreatePlayer(ctx context.Context, result []string) (bool, string)

func (*Commander) CmdDelHero

func (cmd *Commander) CmdDelHero(ctx context.Context, result []string) (bool, string)

func (*Commander) CmdDelItem

func (cmd *Commander) CmdDelItem(ctx context.Context, result []string) (bool, string)

func (*Commander) CmdHeroPutonEquip

func (cmd *Commander) CmdHeroPutonEquip(ctx context.Context, result []string) (bool, string)

func (*Commander) CmdHeroTakeoffEquip

func (cmd *Commander) CmdHeroTakeoffEquip(ctx context.Context, result []string) (bool, string)

func (*Commander) CmdPublicSyncPlayerInfo

func (cmd *Commander) CmdPublicSyncPlayerInfo(ctx context.Context, result []string) (bool, string)

func (*Commander) CmdQueryHeros

func (cmd *Commander) CmdQueryHeros(ctx context.Context, result []string) (bool, string)

func (*Commander) CmdQueryItems

func (cmd *Commander) CmdQueryItems(ctx context.Context, result []string) (bool, string)

func (*Commander) CmdQueryPlayerInfo

func (cmd *Commander) CmdQueryPlayerInfo(ctx context.Context, result []string) (bool, string)

func (*Commander) CmdQueryTalents

func (cmd *Commander) CmdQueryTalents(ctx context.Context, result []string) (bool, string)

func (*Commander) CmdQueryTokens

func (cmd *Commander) CmdQueryTokens(ctx context.Context, result []string) (bool, string)

func (*Commander) CmdQuit

func (cmd *Commander) CmdQuit(ctx context.Context, result []string) (bool, string)

func (*Commander) CmdSendHeartBeat

func (cmd *Commander) CmdSendHeartBeat(ctx context.Context, result []string) (bool, string)

func (*Commander) CmdServerAccountDisconnect

func (cmd *Commander) CmdServerAccountDisconnect(ctx context.Context, result []string) (bool, string)

func (*Commander) CmdStartStageCombat

func (cmd *Commander) CmdStartStageCombat(ctx context.Context, result []string) (bool, string)

func (*Commander) CmdSyncPlayerInfo

func (cmd *Commander) CmdSyncPlayerInfo(ctx context.Context, result []string) (bool, string)

func (*Commander) CmdUseItem

func (cmd *Commander) CmdUseItem(ctx context.Context, result []string) (bool, string)

func (*Commander) CmdWebSocketAccountLogon

func (cmd *Commander) CmdWebSocketAccountLogon(ctx context.Context, result []string) (bool, string)

type ExecuteFunc

type ExecuteFunc func(context.Context, *Client) error

type GameInfo

type GameInfo struct {
	UserID        int64  `json:"userId"`
	UserName      string `json:"userName"`
	AccountID     int64  `json:"accountId"`
	GameID        string `json:"gameId"`
	PublicTcpAddr string `json:"publicTcpAddr"`
	PublicWsAddr  string `json:"publicWsAddr"`
}

type GinServer

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

func NewGinServer

func NewGinServer(ctx *cli.Context) *GinServer

func (*GinServer) Exit

func (s *GinServer) Exit(ctx context.Context)

func (*GinServer) Main

func (s *GinServer) Main(ctx *cli.Context) error

func (*GinServer) Run

func (s *GinServer) Run(ctx *cli.Context) error

type MsgHandler

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

func NewMsgHandler

func NewMsgHandler(c *Client, ctx *cli.Context) *MsgHandler

func (*MsgHandler) OnM2C_AccountLogon

func (h *MsgHandler) OnM2C_AccountLogon(ctx context.Context, sock transport.Socket, msg *transport.Message) error

func (*MsgHandler) OnM2C_CreatePlayer

func (h *MsgHandler) OnM2C_CreatePlayer(ctx context.Context, sock transport.Socket, msg *transport.Message) error

func (*MsgHandler) OnM2C_DelItem

func (h *MsgHandler) OnM2C_DelItem(ctx context.Context, sock transport.Socket, msg *transport.Message) error

func (*MsgHandler) OnM2C_ExpUpdate

func (h *MsgHandler) OnM2C_ExpUpdate(ctx context.Context, sock transport.Socket, msg *transport.Message) error

func (*MsgHandler) OnM2C_HeartBeat

func (h *MsgHandler) OnM2C_HeartBeat(ctx context.Context, sock transport.Socket, msg *transport.Message) error

func (*MsgHandler) OnM2C_HeroAttUpdate

func (h *MsgHandler) OnM2C_HeroAttUpdate(ctx context.Context, sock transport.Socket, msg *transport.Message) error

func (*MsgHandler) OnM2C_HeroInfo

func (h *MsgHandler) OnM2C_HeroInfo(ctx context.Context, sock transport.Socket, msg *transport.Message) error

func (*MsgHandler) OnM2C_HeroList

func (h *MsgHandler) OnM2C_HeroList(ctx context.Context, sock transport.Socket, msg *transport.Message) error

func (*MsgHandler) OnM2C_ItemAdd

func (h *MsgHandler) OnM2C_ItemAdd(ctx context.Context, sock transport.Socket, msg *transport.Message) error

func (*MsgHandler) OnM2C_ItemList

func (h *MsgHandler) OnM2C_ItemList(ctx context.Context, sock transport.Socket, msg *transport.Message) error

func (*MsgHandler) OnM2C_ItemUpdate

func (h *MsgHandler) OnM2C_ItemUpdate(ctx context.Context, sock transport.Socket, msg *transport.Message) error

func (*MsgHandler) OnM2C_PublicSyncPlayerInfo

func (h *MsgHandler) OnM2C_PublicSyncPlayerInfo(ctx context.Context, sock transport.Socket, msg *transport.Message) error

func (*MsgHandler) OnM2C_QueryPlayerInfo

func (h *MsgHandler) OnM2C_QueryPlayerInfo(ctx context.Context, sock transport.Socket, msg *transport.Message) error

func (*MsgHandler) OnM2C_StartStageCombat

func (h *MsgHandler) OnM2C_StartStageCombat(ctx context.Context, sock transport.Socket, msg *transport.Message) error

func (*MsgHandler) OnM2C_SyncPlayerInfo

func (h *MsgHandler) OnM2C_SyncPlayerInfo(ctx context.Context, sock transport.Socket, msg *transport.Message) error

func (*MsgHandler) OnM2C_TalentList

func (h *MsgHandler) OnM2C_TalentList(ctx context.Context, sock transport.Socket, msg *transport.Message) error

func (*MsgHandler) OnM2C_TokenList

func (h *MsgHandler) OnM2C_TokenList(ctx context.Context, sock transport.Socket, msg *transport.Message) error

func (*MsgHandler) OnMS_SelectPlayer

func (h *MsgHandler) OnMS_SelectPlayer(ctx context.Context, sock transport.Socket, msg *transport.Message) error

type PromptUI

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

func NewPromptUI

func NewPromptUI(c *Client, ctx *cli.Context) *PromptUI

func (*PromptUI) Run

func (p *PromptUI) Run(ctx *cli.Context) error

type TransportClient

type TransportClient struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func NewTransportClient

func NewTransportClient(c *Client, ctx *cli.Context) *TransportClient

func (*TransportClient) Exit

func (t *TransportClient) Exit(ctx *cli.Context)

func (*TransportClient) GetGateEndPoints

func (t *TransportClient) GetGateEndPoints() []string

func (*TransportClient) ReturnMsgName

func (t *TransportClient) ReturnMsgName() <-chan string

func (*TransportClient) Run

func (t *TransportClient) Run(ctx *cli.Context) error

func (*TransportClient) SendMessage

func (t *TransportClient) SendMessage(msg *transport.Message)

func (*TransportClient) SetGameInfo

func (t *TransportClient) SetGameInfo(info *GameInfo)

func (*TransportClient) SetProtocol

func (t *TransportClient) SetProtocol(p string)

func (*TransportClient) StartConnect

func (t *TransportClient) StartConnect(ctx context.Context) error

func (*TransportClient) StartDisconnect

func (t *TransportClient) StartDisconnect()

Jump to

Keyboard shortcuts

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