Ejemplo n.º 1
0
        private void ClientDisconnected(object sender, ClientDisconnectedEventArgs e)
        {
            Player plr;

            _players.TryRemove(e.Session.Guid, out plr);
            if (plr == null || plr.Room == null)
            {
                return;
            }

            var room = plr.Room;

            room.Leave(plr);
            if (room.Players.Count == 0)
            {
                _rooms.TryRemove(room.TunnelID, out room);
            }
        }