robots

package
v0.0.0-...-f84f93e Latest Latest
Warning

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

Go to latest
Published: May 30, 2018 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var RobotsCh chan interface{}

通道

Functions

func CloseRobots

func CloseRobots()

关闭

func Msg2Robots

func Msg2Robots(code string, num int64)

消息通知

func RemoveN

func RemoveN(c byte, cs []byte, n int) []byte

移除n个牌

func RunRobot

func RunRobot(host, port, phone, code string, msgCh chan interface{})

启动一个机器人

func Start

func Start(host, port string)

启动

Types

type Login

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

type Logout

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

type Message

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

通知消息体

type Robot

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

机器人连接数据

func (*Robot) Close

func (this *Robot) Close()

关闭连接

func (*Robot) Closed

func (this *Robot) Closed()

关闭连接

func (*Robot) Logined

func (this *Robot) Logined()

关闭连接

func (*Robot) Reader

func (this *Robot) Reader()

协议路由

func (*Robot) RecvMsg

func (this *Robot) RecvMsg()

接收消息

func (*Robot) SendBroken

func (c *Robot) SendBroken()

玩家打骰子

func (*Robot) SendCreate

func (c *Robot) SendCreate()

玩家创建房间

func (*Robot) SendDiscard

func (c *Robot) SendDiscard()

自己出牌

func (*Robot) SendDiscard2

func (c *Robot) SendDiscard2()

庄家出牌

func (*Robot) SendEntry

func (c *Robot) SendEntry()

玩家进入房间

func (*Robot) SendHu

func (c *Robot) SendHu()

胡牌

func (*Robot) SendLeave

func (c *Robot) SendLeave()

离开

func (*Robot) SendLogin

func (c *Robot) SendLogin()

发送登录请求

func (*Robot) SendMaizi

func (c *Robot) SendMaizi()

玩家买子

func (*Robot) SendOperate

func (c *Robot) SendOperate(card uint32, value int64)

玩家碰杠操作

func (*Robot) SendReady

func (c *Robot) SendReady()

玩家准备

func (*Robot) SendRegist

func (c *Robot) SendRegist()

发送注册请求

func (*Robot) SendUserData

func (c *Robot) SendUserData()

获取玩家数据

func (*Robot) Sender

func (this *Robot) Sender(packet interfacer.IProto)

发送请求 TODO:concurrent write to websocket connection

type RobotData

type RobotData struct {
	Id        uint32 `csv:"id"`
	Kind      uint32 `csv:"kind"`
	Changci   uint32 `csv:"changci"`
	Nickname  string `csv:"nickname"`
	Sex       uint32 `csv:"sex"`
	Level     uint32 `csv:"level"`
	Coin      uint32 `csv:"coin"`
	Diamond   uint32 `csv:"diamond"`
	Cointime  uint32 `csv:"cointime"`
	Coinup    uint32 `csv:"coinup"`
	Vip       uint32 `csv:"vip"`
	Headframe uint32 `csv:"headframe"`
	Phone     string `csv:"phone"`
}

func GetRobotList

func GetRobotList() []RobotData

type Robots

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

机器人服务

func (*Robots) Run

func (r *Robots) Run()

处理

Jump to

Keyboard shortcuts

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