示例#1
0
        public void Start()
        {
            var settings = GlobalSettings.Load();

            channel_parser.Init();

            if (settings == null)
            {
                return;
            }

            VersionCheckState.Execute(new CancellationToken());

            StartNet(settings.Port);

            PollRarePokemonRepositories(settings);

            var discordWebReader = new DiscordWebReader();

            while (true)
            {
                try
                {
                    pollDiscordFeed(discordWebReader.stream);
                }
                catch (WebException)
                {
                    Log.Warn($"Experiencing connection issues. Throttling...");
                    Thread.Sleep(30 * 1000);
                    discordWebReader.InitializeWebClient();
                }
                catch (Exception e)
                {
                    Log.Warn($"Unknown exception", e);
                    break;
                }
                finally
                {
                    Thread.Sleep(20 * 1000);
                }
            }

            Console.ReadKey(true);
        }
示例#2
0
        public void Start()
        {
            var settings = GlobalSettings.Load();

            _channelParser.LoadChannelSettings();

            if (settings == null)
            {
                return;
            }

            VersionCheckState.Execute(new CancellationToken());

            _clientWriter.StartNet(settings.Port);

            WebSourcesManager(settings);

            Console.Read();
        }
示例#3
0
        public void Start()
        {
            var settings = GlobalSettings.Load();

            _channelParser.LoadChannelSettings();

            if (settings == null)
            {
                return;
            }
            GlobalSettings.Output?.SetStatus("Connecting...");

            VersionCheckState.Execute(new CancellationToken());
            if (GlobalSettings.IsServer)
            {
                Task.Run(() =>
                {
                    _server.Start();
                });
            }
            else
            {
                ClientWriter.Instance.StartNet(GlobalSettings.Port);
                Log.Info($"Starting with Port: {GlobalSettings.Port}");
            }
            if (GlobalSettings.IsManaged)
            {
                Task.Run(() =>
                {
                    _pogoClient.Start(_channelParser.Settings);
                });
                StartBotListeners();
            }
            else if (GlobalSettings.VerifyOnSkiplagged)
            {
                SkipLaggedPokemonLocationValidator.Instance.StartVerifierThread();
            }
            WebSourcesManager(settings);

            Console.Read();
        }