예제 #1
0
        public static void Initialize(int port, int update_timeout)
        {
            DBManager             = new ChatbotSmackdownDb();
            UpdateTimer           = new System.Timers.Timer(update_timeout);
            Api                   = new PlatformAPI();
            UpdateTimer.Elapsed  += OnTimedEvent;
            UpdateTimer.AutoReset = true;
            UpdateTimer.Enabled   = true;

            Service = new HttpService(port);
            Load();
            Chatbots = new List <Chatbot>();
            ReloadBots();
            TournamentManager.Initialize();
            TournamentManager.Reload();
        }
예제 #2
0
        public string ReloadCompetitions()
        {
            try
            {
                Platform.LogEvent("Reload Competitions ", ConsoleColor.DarkCyan);

                Platform.Synchronize();
                TournamentManager.Reload();


                return(JsonConvert.SerializeObject(new GoodResponse("OK", "The competitions has been successfully reloaded")));
            }
            catch (Exception ex)
            {
                return(JsonConvert.SerializeObject(new ErrorResponse("FAILED", ex.Message)));
            }
        }