services

package
v0.0.0-...-f03d92c Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2022 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MaxPlayerInRoom = 3
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Chat

type Chat struct {
	api.APIEntry
}

handler

func (*Chat) SendChat

func (self *Chat) SendChat(d api.IHandlerSession, msg *protos.ChatMsg, cbFunc api.HandlerCBFunc) error

type ChatPlayer

type ChatPlayer struct {
	UId     string
	Name    string
	FrontId string
	NetId   common.NetIdType
	RoomId  uint32
}

func NewPlayer

func NewPlayer() *ChatPlayer

func (*ChatPlayer) GetDetailName

func (self *ChatPlayer) GetDetailName() string

type ChatRemote

type ChatRemote struct {
	api.APIEntry
}

remote

func (*ChatRemote) Entry

func (self *ChatRemote) Entry(msg *protos.RoomEntry, cbFunc api.HandlerCBFunc) error

func (*ChatRemote) Leave

func (self *ChatRemote) Leave(msg *protos.RoomLeave, cbFunc api.HandlerCBFunc) error

type ChatRoom

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

func NewRoom

func NewRoom(id uint32) *ChatRoom

func (*ChatRoom) AddPlayer

func (self *ChatRoom) AddPlayer(p *ChatPlayer)

func (*ChatRoom) Destroy

func (self *ChatRoom) Destroy()

func (*ChatRoom) GetChannel

func (self *ChatRoom) GetChannel() *channel.Channel

func (*ChatRoom) GetMembers

func (self *ChatRoom) GetMembers() []string

func (*ChatRoom) GetPlayerNum

func (self *ChatRoom) GetPlayerNum() int

func (*ChatRoom) OnChat

func (self *ChatRoom) OnChat(p *ChatPlayer, content string)

func (*ChatRoom) PushMessage

func (self *ChatRoom) PushMessage(p *ChatPlayer, content string)

func (*ChatRoom) RemovePlayer

func (self *ChatRoom) RemovePlayer(uid string)

type ChatService

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

聊天具体的service 按登录 2人分一个房间 聊天房间内同步 输入roll,掷骰子 离开后,其他人可以加入

func GetChatService

func GetChatService() *ChatService

func NewChatService

func NewChatService() *ChatService

func (*ChatService) CreateRoom

func (self *ChatService) CreateRoom() *ChatRoom

func (*ChatService) GetPlayerRoom

func (self *ChatService) GetPlayerRoom(uid string) *ChatRoom

func (*ChatService) OnChat

func (self *ChatService) OnChat(uid, content string)

func (*ChatService) PlayerEnter

func (self *ChatService) PlayerEnter(uid string, name string,
	frontId string, netId common.NetIdType)

func (*ChatService) PlayerLeave

func (self *ChatService) PlayerLeave(uid string)

func (*ChatService) Start

func (self *ChatService) Start()

type Gate

type Gate struct {
	api.APIEntry
}

func (*Gate) Login

func (self *Gate) Login(d api.IHandlerSession, msg *protos.LoginReq, cbFunc api.HandlerCBFunc) error

登录 分配并绑定到某个chat服务器

func (*Gate) QueryGate

func (self *Gate) QueryGate(d api.IHandlerSession, msg *protos.EmptyArgReq, cbFunc api.HandlerCBFunc) error

分配一个具体连接的gate

Jump to

Keyboard shortcuts

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