예제 #1
0
		/// <summary> Initializes a new instance of the DiscordClient class. </summary>
		public DiscordWSClient(DiscordWSClientConfig config = null)
		{
			_config = config ?? new DiscordWSClientConfig();
			_config.Lock();

			_state = (int)DiscordClientState.Disconnected;
			_cancelToken = new CancellationToken(true);
			_disconnectedEvent = new ManualResetEvent(true);
			_connectedEvent = new ManualResetEventSlim(false);

			_dataSocket = CreateDataSocket();
			if (_config.EnableVoice)
				_voiceSocket = CreateVoiceSocket();
		}
예제 #2
0
        /// <summary> Initializes a new instance of the DiscordClient class. </summary>
        public DiscordWSClient(DiscordWSClientConfig config = null)
        {
            _config = config ?? new DiscordWSClientConfig();
            _config.Lock();

            _state             = (int)DiscordClientState.Disconnected;
            _cancelToken       = new CancellationToken(true);
            _disconnectedEvent = new ManualResetEvent(true);
            _connectedEvent    = new ManualResetEventSlim(false);

            _dataSocket = CreateDataSocket();
            if (_config.EnableVoice)
            {
                _voiceSocket = CreateVoiceSocket();
            }
        }
예제 #3
0
		internal DiscordWSClient(DiscordWSClientConfig config = null, string voiceServerId = null)
			: this(config)
		{
			_voiceServerId = voiceServerId;
		}
예제 #4
0
 internal DiscordWSClient(DiscordWSClientConfig config = null, string voiceServerId = null)
     : this(config)
 {
     _voiceServerId = voiceServerId;
 }