proto

package
v0.0.0-...-faa7bd5 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2019 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RPC_METHOD_UPDATE_SERVER_INFO = "update server info"

	CMD_CENTER_UPDATE_GAME_LIST_NOTIFY uint32 = 1
)
View Source
const (
	CMD_PLAZA_LOGIN_REQ        uint32 = 1001 // 登录请求
	CMD_PLAZA_LOGIN_RSP        uint32 = 1002 // 登录响应
	CMD_PLAZA_GAME_LIST_NOTIFY uint32 = 1003 // 游戏服务列表通知
)

Variables

View Source
var (
	SERVER_TYPE_PLAZA = "plaza"
	SERVER_TYPE_GAME  = "game"
)

Functions

func Marshal

func Marshal(v interface{}) ([]byte, error)

func MarshalToString

func MarshalToString(v interface{}) (string, error)

func NewMessage

func NewMessage(cmd uint32, v interface{}) *net.Message

func SetCodec

func SetCodec(c ICodec)

func Unmarshal

func Unmarshal(data []byte, v interface{}) error

func UnmarshalFromString

func UnmarshalFromString(s string, v interface{}) error

Types

type BroadcastNotify

type BroadcastNotify struct {
	Msg string `json:"msg"`
}

type CenterUpdateServerInfoReq

type CenterUpdateServerInfoReq struct {
	ServerInfo
}

type CenterUpdateServerInfoRsp

type CenterUpdateServerInfoRsp struct {
	Code int
	Msg  string
}

type ICodec

type ICodec interface {
	Marshal(v interface{}) ([]byte, error)
	Unmarshal(data []byte, v interface{}) error

	MarshalToString(v interface{}) (string, error)
	UnmarshalFromString(s string, v interface{}) error
}
var (
	Empty *struct{} = nil

	DefaultCodec ICodec = json
)

type PlazaLoginReq

type PlazaLoginReq struct {
}

type PlazaLoginRsp

type PlazaLoginRsp struct {
	Code int    `json:"code"`
	Msg  string `json:"msg"`
	Name string `json:"name"`
}

type ServerInfo

type ServerInfo struct {
	Id   string
	Type string
	Info interface{}
}

Jump to

Keyboard shortcuts

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