コード例 #1
0
 public void StopServer()
 {
     if (_serverListener != null)
     {
         _stop = true;
         _serverSync.RequestStop();
         _serverSync = null;
         _serverListener.RequestStop();
         _serverListener = null;
     }
 }
コード例 #2
0
        private void StartServer()
        {
            if (_serverListener == null)
            {
                StartExport();

                PopulateBanList();

                _serverListener = new UDPVoiceRouter(_connectedClients, _eventAggregator);
                var listenerThread = new Thread(_serverListener.Listen);
                listenerThread.Start();

                _serverSync = new ServerSync(_connectedClients, _bannedIps, _eventAggregator);
                var serverSyncThread = new Thread(_serverSync.StartListening);
                serverSyncThread.Start();
            }
        }
コード例 #3
0
        private void StartServer()
        {
            if (_serverListener == null)
            {
                StartExport();

                PopulateBanList();

                if (!File.Exists(Path.Combine(GetCurrentDirectory(), @"client-whitelist.txt")))
                {
                    File.Create(Path.Combine(GetCurrentDirectory(), @"client-whitelist.txt"));
                }

                _serverListener = new UDPVoiceRouter(_connectedClients, _eventAggregator);
                var listenerThread = new Thread(_serverListener.Listen);
                listenerThread.Start();

                _serverSync = new ServerSync(_connectedClients, _bannedIps, _eventAggregator);
                var serverSyncThread = new Thread(_serverSync.StartListening);
                serverSyncThread.Start();
            }
        }