client

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 18, 2020 License: MIT Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	CmdPages = make(map[int]*CommandPage, 0)
)

Functions

func CmdAccountDisconnect

func CmdAccountDisconnect(c *TcpClient, result []string) bool

func CmdAccountLogon

func CmdAccountLogon(c *TcpClient, result []string) bool

func CmdAddHero

func CmdAddHero(c *TcpClient, result []string) bool

func CmdAddItem

func CmdAddItem(c *TcpClient, result []string) bool

func CmdAddTalent

func CmdAddTalent(c *TcpClient, result []string) bool

func CmdAddToken

func CmdAddToken(c *TcpClient, result []string) bool

func CmdChangeExp

func CmdChangeExp(c *TcpClient, result []string) bool

func CmdChangeLevel

func CmdChangeLevel(c *TcpClient, result []string) bool

func CmdCreatePlayer

func CmdCreatePlayer(c *TcpClient, result []string) bool

func CmdDelHero

func CmdDelHero(c *TcpClient, result []string) bool

func CmdDelItem

func CmdDelItem(c *TcpClient, result []string) bool

func CmdExpirePlayer

func CmdExpirePlayer(c *TcpClient, result []string) bool

func CmdHeroPutonEquip

func CmdHeroPutonEquip(c *TcpClient, result []string) bool

func CmdHeroTakeoffEquip

func CmdHeroTakeoffEquip(c *TcpClient, result []string) bool

func CmdQueryHeros

func CmdQueryHeros(c *TcpClient, result []string) bool

func CmdQueryItems

func CmdQueryItems(c *TcpClient, result []string) bool

func CmdQueryPlayerInfo

func CmdQueryPlayerInfo(c *TcpClient, result []string) bool

func CmdQueryTalents

func CmdQueryTalents(c *TcpClient, result []string) bool

func CmdQueryTokens

func CmdQueryTokens(c *TcpClient, result []string) bool

func CmdQuit

func CmdQuit(c *TcpClient, result []string) bool

func CmdSendHeartBeat

func CmdSendHeartBeat(c *TcpClient, result []string) bool

func CmdUseItem

func CmdUseItem(c *TcpClient, result []string) bool

func CmdWebSocket

func CmdWebSocket(c *TcpClient, result []string) bool

func CmdWebSocketAccountLogon

func CmdWebSocketAccountLogon(c *TcpClient, result []string) bool

func NewClientBotsFlags

func NewClientBotsFlags() []cli.Flag

func NewFlags

func NewFlags() []cli.Flag

Types

type BotAI

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

func NewBotAI

func NewBotAI(ctx *cli.Context, userID int64, userName string) *BotAI

func (*BotAI) Exit

func (ai *BotAI) Exit()

func (*BotAI) Run

func (ai *BotAI) Run() error

type BotCommand

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

func NewBotCommand

func NewBotCommand(ctx context.Context, ai *BotAI) *BotCommand

func (*BotCommand) BotCmdAccountLogon

func (bc *BotCommand) BotCmdAccountLogon(userID int64, userName string) error

func (*BotCommand) BotCmdAddHero

func (bc *BotCommand) BotCmdAddHero() error

func (*BotCommand) BotCmdAddItem

func (bc *BotCommand) BotCmdAddItem() error

func (*BotCommand) BotCmdAddToken

func (bc *BotCommand) BotCmdAddToken() error

func (*BotCommand) BotCmdChangeExp

func (bc *BotCommand) BotCmdChangeExp() error

func (*BotCommand) BotCmdChangeLevel

func (bc *BotCommand) BotCmdChangeLevel() error

func (*BotCommand) BotCmdCreatePlayer

func (bc *BotCommand) BotCmdCreatePlayer() error

func (*BotCommand) BotCmdQueryHeros

func (bc *BotCommand) BotCmdQueryHeros() error

func (*BotCommand) BotCmdQueryItems

func (bc *BotCommand) BotCmdQueryItems() error

func (*BotCommand) BotCmdQueryPlayerInfo

func (bc *BotCommand) BotCmdQueryPlayerInfo() error

type Client

type Client struct {
	ID int
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewClient

func NewClient() (*Client, error)

func (*Client) Action

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

func (*Client) After

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

func (*Client) Run

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

func (*Client) Stop

func (c *Client) Stop()

type ClientBots

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

func NewClientBots

func NewClientBots() (*ClientBots, error)

func (*ClientBots) Action

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

func (*ClientBots) After

func (c *ClientBots) After(ctx *cli.Context) 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(*TcpClient, []string) bool
	InputText    string
	DefaultInput string
}

type CommandPage

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

type MC_AccountTest

type MC_AccountTest struct {
	AccountId int64  `protobuf:"varint,1,opt,name=account_id,json=accountId,proto3" json:"account_id,omitempty"`
	Name      string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
}

type PromptUI

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

func NewPromptUI

func NewPromptUI(ctx *cli.Context, client *TcpClient) *PromptUI

func (*PromptUI) Run

func (p *PromptUI) Run() error

type TcpClient

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

func NewTcpClient

func NewTcpClient(ctx *cli.Context, ai *BotAI) *TcpClient

func (*TcpClient) Connect

func (t *TcpClient) Connect() error

func (*TcpClient) Disconnect

func (t *TcpClient) Disconnect()

func (*TcpClient) Exit

func (t *TcpClient) Exit()

func (*TcpClient) OnM2C_AccountLogon

func (t *TcpClient) OnM2C_AccountLogon(sock transport.Socket, msg *transport.Message)

func (*TcpClient) OnM2C_CreatePlayer

func (t *TcpClient) OnM2C_CreatePlayer(sock transport.Socket, msg *transport.Message)

func (*TcpClient) OnM2C_HeartBeat

func (t *TcpClient) OnM2C_HeartBeat(sock transport.Socket, msg *transport.Message)

func (*TcpClient) OnM2C_HeroInfo

func (t *TcpClient) OnM2C_HeroInfo(sock transport.Socket, msg *transport.Message)

func (*TcpClient) OnM2C_HeroList

func (t *TcpClient) OnM2C_HeroList(sock transport.Socket, msg *transport.Message)

func (*TcpClient) OnM2C_ItemList

func (t *TcpClient) OnM2C_ItemList(sock transport.Socket, msg *transport.Message)

func (*TcpClient) OnM2C_QueryPlayerInfo

func (t *TcpClient) OnM2C_QueryPlayerInfo(sock transport.Socket, msg *transport.Message)

func (*TcpClient) OnM2C_TokenList

func (t *TcpClient) OnM2C_TokenList(sock transport.Socket, msg *transport.Message)

func (*TcpClient) OnMS_SelectPlayer

func (t *TcpClient) OnMS_SelectPlayer(sock transport.Socket, msg *transport.Message)

func (*TcpClient) OnMS_TalentList

func (t *TcpClient) OnMS_TalentList(sock transport.Socket, msg *transport.Message)

func (*TcpClient) Run

func (t *TcpClient) Run() error

func (*TcpClient) SendMessage

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

func (*TcpClient) SetTcpAddress

func (t *TcpClient) SetTcpAddress(addr string)

func (*TcpClient) SetUserInfo

func (t *TcpClient) SetUserInfo(userID int64, accountID int64, userName string)

Jump to

Keyboard shortcuts

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