"refactor(socket): 添加玩家断开连接时的登录状态标记并优化刷怪逻辑"
This commit is contained in:
@@ -50,6 +50,7 @@ func (s *Server) OnClose(c gnet.Conn, _ error) (action gnet.Action) {
|
||||
t := v.GetPlayer()
|
||||
if t != nil {
|
||||
glog.Debug(context.Background(), t.UserID, "断开连接")
|
||||
t.IsLogin = false
|
||||
cool.Mainplayer.Delete(t.UserID)
|
||||
share.ShareManager.DeleteUserOnline(t.UserID) //设置用户登录服务器
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user