コード例 #1
0
ファイル: Server.cs プロジェクト: devforgood/engine
        public void HandleLostClient(ClientProxy inClientProxy)
        {
            //kill client's actor
            //remove client from scoreboard
            int playerId = inClientProxy.GetPlayerId();

            GameMode.sInstance.RemoveEntry((uint32_t)playerId);
            SActor actor = GetActorForPlayer(playerId, inClientProxy.GetWorldId());

            if (actor != null)
            {
                actor.Unpossess();
                actor.SetDoesWantToDie(true);
            }

            if (ServerMonitor.sInstance.DelUser(inClientProxy.GetWorldId()) == 0)
            {
                Log.Information(string.Format("Close World {0}", inClientProxy.GetWorldId()));
                NetworkManagerServer.sInstance.Clear(inClientProxy.GetWorldId());
                World.Instance(inClientProxy.GetWorldId()).Clear();
            }
        }