diff --git a/zinx_app_demo/mmo_game/server.go b/zinx_app_demo/mmo_game/server.go index 3158b14..d1a4631 100644 --- a/zinx_app_demo/mmo_game/server.go +++ b/zinx_app_demo/mmo_game/server.go @@ -41,7 +41,7 @@ func OnConnectionLost(conn ziface.IConnection) { player := core.WorldMgrObj.GetPlayerByPID(pID.(int32)) //触发玩家下线业务 - if pID != nil { + if player != nil { player.LostConnection() }