mirror of
https://github.com/bufanyun/hotgo.git
synced 2025-08-28 15:05:01 +08:00
发布v2.13.1版本,更新内容请查看:https://github.com/bufanyun/hotgo/blob/v2.0/docs/guide-zh-CN/start-update-log.md
This commit is contained in:
@@ -158,10 +158,19 @@ func (manager *ClientManager) GetUsersLen() (userLen int) {
|
||||
|
||||
// EventRegister 用户建立连接事件
|
||||
func (manager *ClientManager) EventRegister(client *Client) {
|
||||
if client == nil {
|
||||
g.Log().Warningf(mctx, "EventRegister client == nil.")
|
||||
return
|
||||
}
|
||||
manager.AddClients(client)
|
||||
|
||||
var userId int64
|
||||
if client.User != nil {
|
||||
userId = client.User.Id
|
||||
}
|
||||
// 用户登录
|
||||
manager.EventLogin(&login{
|
||||
UserId: client.User.Id,
|
||||
UserId: userId,
|
||||
Client: client,
|
||||
})
|
||||
// 发送当前客户端标识
|
||||
|
Reference in New Issue
Block a user