底层修改

This commit is contained in:
1
2025-10-06 07:29:49 +00:00
parent 99ee6c2a7f
commit b1f185d519

View File

@@ -42,12 +42,8 @@ func (s *Server) OnClose(c gnet.Conn, _ error) (action gnet.Action) {
atomic.AddInt64(&s.connected, -1)
//logging.Infof("conn[%v] disconnected", c.RemoteAddr().String())
v, ok := c.Context().(*player.ClientData)
if !ok {
return
}
if v.Player != nil {
if ok && v.Player != nil {
v.Player.Save() //保存玩家数据
}