Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClientMgr ¶
type ClientMgr struct {
// contains filtered or unexported fields
}
func (*ClientMgr) AddClient ¶
func (p *ClientMgr) AddClient(userId int, client *UserProcessor)
说明一个 ClientProcessor 实例,就对应一个登录的用户
func (*ClientMgr) GetAllUsers ¶
func (p *ClientMgr) GetAllUsers() map[int]*UserProcessor
type UserProcessor ¶
type UserProcessor struct { Conn net.Conn Buf [8192]byte // contains filtered or unexported fields }
UserProcessor.go 相当于一个控制器,装用于处理与用户相关的 同时每登录一个用户,就对应一个UserProcessor的实例, 因此也可以看做是登录的用户
func (*UserProcessor) NotifyOthersUserOnline ¶
func (up *UserProcessor) NotifyOthersUserOnline(userId int)
func (*UserProcessor) NotifyUserOnline ¶
func (up *UserProcessor) NotifyUserOnline(userId int)
func (*UserProcessor) ServerProcessLogin ¶
func (up *UserProcessor) ServerProcessLogin(msg *common.Message) (err error)
func (*UserProcessor) ServerProcessRegister ¶
func (up *UserProcessor) ServerProcessRegister(msg *common.Message) (err error)
处理用户注册嘻嘻
Click to show internal directories.
Click to hide internal directories.