"refactor(socket): 添加玩家断开连接时的登录状态标记并优化刷怪逻辑"

This commit is contained in:
1
2025-08-25 18:10:45 +00:00
parent cd229c1ca7
commit be5a0e144f
3 changed files with 38 additions and 367 deletions

View File

@@ -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) //设置用户登录服务器
}