public void StopServer()
 {
     if (_serverListener != null)
     {
         _stop = true;
         _serverSync.RequestStop();
         _serverSync = null;
         _serverListener.RequestStop();
         _serverListener = null;
     }
 }
        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();
            }
        }
Ejemplo n.º 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();
            }
        }