底层修改
This commit is contained in:
@@ -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() //保存玩家数据
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user