Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SmsProcess ¶
type SmsProcess struct { }
func (*SmsProcess) SendGroupMes ¶
func (this *SmsProcess) SendGroupMes(mes *message.Message)
写方法转发消息
func (*SmsProcess) SendMesToEachOnlineUser ¶
func (this *SmsProcess) SendMesToEachOnlineUser(data []byte, conn net.Conn)
type UserMgr ¶
type UserMgr struct {
// contains filtered or unexported fields
}
func (*UserMgr) AddOnlineUser ¶
func (this *UserMgr) AddOnlineUser(up *UserProcess)
完成对onlineUsers添加
func (*UserMgr) GetAllOnlineUser ¶
func (this *UserMgr) GetAllOnlineUser() map[int]*UserProcess
返回当前所有在线的用户
func (*UserMgr) GetOnlineUserById ¶
func (this *UserMgr) GetOnlineUserById(userId int) (up *UserProcess, err error)
根据id返回对应的值
type UserProcess ¶
func (*UserProcess) NotifyMeOnline ¶
func (this *UserProcess) NotifyMeOnline(userId int)
func (*UserProcess) NotifyOthersOnlineUser ¶
func (this *UserProcess) NotifyOthersOnlineUser(userId int)
这里我们编写通知所有在线的用户的方法 userId 要通知其它的在线用户,我上线
func (*UserProcess) ServerProcessLogin ¶
func (this *UserProcess) ServerProcessLogin(mes *message.Message) (err error)
编写一个函数serverProcessLogin函数, 专门处理登录请求
func (*UserProcess) ServerProcessRegister ¶
func (this *UserProcess) ServerProcessRegister(mes *message.Message) (err error)
Click to show internal directories.
Click to hide internal directories.