修改websocket bug
This commit is contained in:
parent
deeeacd6ac
commit
a2ecd518aa
@ -24,5 +24,6 @@ func (s *ClientService) onLogin(cMsg *pb.ClientMsg, msg *pb.S2CUserLogin) {
|
||||
}
|
||||
_ = cMsg
|
||||
s.userId = msg.UserId
|
||||
s.client.SetUid(msg.UserId)
|
||||
log.DebugF("user:%v id:%v login success", s.username, msg.UserId)
|
||||
}
|
||||
|
@ -61,7 +61,7 @@ func newClientService(serviceId int) *ClientService {
|
||||
|
||||
func (s *ClientService) loopLoginHour() {
|
||||
s.login()
|
||||
time.AfterFunc(time.Hour, s.loopLoginHour)
|
||||
time.AfterFunc(5*time.Minute, s.loopLoginHour)
|
||||
}
|
||||
|
||||
func (s *ClientService) OnInit() {
|
||||
|
@ -47,5 +47,5 @@ func (s *GateService) onUserLogout(iMsg *ipb.InternalMsg, conn ws.IConn, msg *pb
|
||||
}
|
||||
s.SendClientMsg(conn, iMsg.ServiceName, int32(pb.MsgId_S2CUserLogoutId), msg)
|
||||
// 登出的清理工作由WsOnDisconnect实现
|
||||
conn.NotifyClose()
|
||||
conn.Close()
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user