cg

package
v0.0.0-...-103f554 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CenterClient

type CenterClient struct {
	*ipc.Client
}

CenterClient 游戏中心客户端

func (CenterClient) AddPlayer

func (c CenterClient) AddPlayer(player *Player) error

AddPlayer 添加上线玩家

func (CenterClient) Broadcast

func (c CenterClient) Broadcast(message string) error

Broadcast 系统广播

func (CenterClient) ListPlayer

func (c CenterClient) ListPlayer(params string) (ps []*Player, err error)

ListPlayer 列举所有在线玩家

func (CenterClient) RemovePlayer

func (c CenterClient) RemovePlayer(name string) (err error)

RemovePlayer 删除在线玩家

type CenterServer

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

CenterServer 游戏中心服务器业务

func NewCenterServer

func NewCenterServer() *CenterServer

NewCenterServer 实例化服务

func (*CenterServer) Handle

func (server *CenterServer) Handle(method, params string) *ipc.Response

Handle 服务处理

func (*CenterServer) Name

func (server *CenterServer) Name() string

Name 服务名称

type Message

type Message struct {
	From    string `json:"from"`
	To      string `json:"to"`
	Content string `json:"content"`
}

Message 消息结构体

type Player

type Player struct {
	Name  string `json:"name"`
	Level int    `json:"level"`
	Exp   int    `json:"exp"`
	Room  int    `json:"room"`
	// contains filtered or unexported fields
}

Player 玩家

func NewPlayer

func NewPlayer() *Player

NewPlayer 实例化玩家结构体

type Room

type Room struct {
}

房间

Jump to

Keyboard shortcuts

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