Documentation ¶
Index ¶
- Constants
- type Chat
- type ChatPlayer
- type ChatRemote
- type ChatRoom
- func (self *ChatRoom) AddPlayer(p *ChatPlayer)
- func (self *ChatRoom) Destroy()
- func (self *ChatRoom) GetChannel() *channel.Channel
- func (self *ChatRoom) GetMembers() []string
- func (self *ChatRoom) GetPlayerNum() int
- func (self *ChatRoom) OnChat(p *ChatPlayer, content string)
- func (self *ChatRoom) PushMessage(p *ChatPlayer, content string)
- func (self *ChatRoom) RemovePlayer(uid string)
- type ChatService
- func (self *ChatService) CreateRoom() *ChatRoom
- func (self *ChatService) GetPlayerRoom(uid string) *ChatRoom
- func (self *ChatService) OnChat(uid, content string)
- func (self *ChatService) PlayerEnter(uid string, name string, frontId string, netId common.NetIdType)
- func (self *ChatService) PlayerLeave(uid string)
- func (self *ChatService) Start()
- type Gate
Constants ¶
View Source
const (
MaxPlayerInRoom = 3
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Chat ¶
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 ¶
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 (*ChatRoom) AddPlayer ¶
func (self *ChatRoom) AddPlayer(p *ChatPlayer)
func (*ChatRoom) GetChannel ¶
func (*ChatRoom) GetMembers ¶
func (*ChatRoom) GetPlayerNum ¶
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 ¶
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 (*ChatService) PlayerLeave ¶
func (self *ChatService) PlayerLeave(uid string)
func (*ChatService) Start ¶
func (self *ChatService) Start()
type Gate ¶
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
Click to show internal directories.
Click to hide internal directories.