Exemplo n.º 1
0
        // ReSharper restore EventNeverSubscribedTo.Global
        #endregion

        public DissonanceComms()
        {
            _playbackPool    = new Pool <VoicePlayback>(6, CreatePlayback);
            _rooms           = new Rooms();
            _playerChannels  = new PlayerChannels(this);
            _roomChannels    = new RoomChannels(this);
            _text            = new TextChat(() => _net);
            _players         = new List <VoicePlayerState>();
            _playersReadOnly = new ReadOnlyCollection <VoicePlayerState>(_players);
            _playersLookup   = new Dictionary <string, VoicePlayerState>();

            _rooms.JoinedRoom += name => Log.Debug("Joined chat room '{0}'", name);
            _rooms.LeftRoom   += name => Log.Debug("Left chat room '{0}'", name);

            _playerChannels.OpenedChannel += OnChannelOpenedOrClosed;
            _roomChannels.OpenedChannel   += OnChannelOpenedOrClosed;
            _playerChannels.ClosedChannel += OnChannelOpenedOrClosed;
            _roomChannels.ClosedChannel   += OnChannelOpenedOrClosed;

            _playerChannels.OpenedChannel += (id, _) => {
                Log.Debug("Opened channel to player '{0}'", id);
            };

            _playerChannels.ClosedChannel += (id, _) => {
                Log.Debug("Closed channel to player '{0}'", id);
            };

            _roomChannels.OpenedChannel += (id, _) => {
                Log.Debug("Opened channel to room '{0}'", id);
            };

            _roomChannels.ClosedChannel += (id, _) => {
                Log.Debug("Closed channel to room '{0}'", id);
            };
        }
Exemplo n.º 2
0
        // ReSharper restore EventNeverSubscribedTo.Global
        #endregion

        public DissonanceComms()
        {
            _playbackPool            = new PlaybackPool(_codecSettings, (IPriorityManager)this, (IVolumeProvider)this);
            _playerChannels          = new PlayerChannels((IChannelPriorityProvider)this);
            _roomChannels            = new RoomChannels((IChannelPriorityProvider)this);
            _text                    = new TextChat(() => _net);
            _autoChannelDuck         = new OpenChannelVolumeDuck(_roomChannels, _playerChannels);
            _playerTrackers          = new PlayerTrackerManager(_players);
            _playbackPriorityManager = new PriorityManager(_players);
            _capture                 = new CapturePipelineManager(_codecSettings, _roomChannels, _playerChannels, Players);
        }