public void Initialize()
        {
            Answer ans = Database.SendGetAnswer("INFO");

            if (ans.Info != Inf.OK)
            {
                PermissionDenied.Visible = true;
                PermissionDenied.Text    = ans.Message;
                return;
            }
            PermissionDenied.Visible = false;
            TimerUpdate.Stop();
            CPUChart.Series[0].Points.Clear();
            RAMChart.Series[0].Points.Clear();
            QueryChart.Series[0].Points.Clear();
            if (MainForm.ServerInformation.Count != 0)
            {
                info = MainForm.ServerInformation.Last();
                RAMChart.ChartAreas[0].AxisY.Maximum = info.TotalMemory;
                TimeStart.Text = DateTime.Now.AddSeconds(-info.UpTime).ToString("yyyy/MM/dd hh:mm:ss");
            }
            TimerUpdate.Start();
            foreach (InfoClass inf in MainForm.ServerInformation)
            {
                AddToCharts(inf);
                if (inf.TotalMemory > RAMChart.ChartAreas[0].AxisY.Maximum)
                {
                    RAMChart.ChartAreas[0].AxisY.Maximum = inf.TotalMemory;
                }
            }
        }
Exemplo n.º 2
0
 void TimerStart(float duration, TimerUpdate update, UnityAction final)
 {
     time          = Time.time;
     timerOn       = true;
     this.duration = duration;
     this.update   = update;
     this.final    = final;
 }
        private void TimerUpdate_Tick(object sender, EventArgs e)
        {
            if (MainForm.ServerInformation.Count == 0)
            {
                TimerUpdate.Stop();
                return;
            }

            AddToCharts(MainForm.ServerInformation.Last());
        }
Exemplo n.º 4
0
 /// <summary>
 /// Setup the timer
 /// </summary>
 public void Setup(float elapsedTime, bool isPaused, TimeSpan timePlaying, TMP_Text timer, TimerType timerType, TimerUpdate timerUpdate, string text)
 {
     this.elapsedTime = defaultTime = elapsedTime;
     this.isPaused    = isPaused;
     this.timePlaying = timePlaying;
     this.timer       = timer;
     this.timerType   = timerType;
     this.timerUpdate = timerUpdate;
     timer.text       = text;
 }
Exemplo n.º 5
0
        private void progStart()
        {
            TimerVerif.Stop();
            writeAllowed = true;
            UpdateNumBox();
            TimerUpdate.Start();

            if (doBeep)
            {
                sndGameFound.PlaySync();
            }
        }
Exemplo n.º 6
0
        public void Stop()
        {
            TimerUpdate.Stop();
            TimerPing.Stop();

            WvsLogin.Stop();
            WvsShop.Stop();

            for (int i = 0; i < WvsGames.Length; i++)
            {
                WvsGames[i].Stop();
            }

            Log.Info("[WvsCenter] Stopped");
        }
Exemplo n.º 7
0
        private void progStop()
        {
            SetFoV(-1);
            if (proc != null && isRunning(false) && writeAllowed)
            {
                mem = null;
            }
            proc = null;
            if (writeAllowed && doBeep)
            {
                sndGameLost.PlaySync();
            }
            writeAllowed = false;
            TimerUpdate.Stop();

            if (!btnStartGame.Enabled)
            {
                ToggleButton(true);
            }
        }
Exemplo n.º 8
0
        //-----------------------------------------------------------------------------

        public void Start()
        {
            if (StartupHealthCheck())
            {
                MasterManager.Load(0);
                //EmojiManager.Instance.LoadAll();

                WvsLogin.Start();
                WvsGames.ToList().ForEach(x => x.Start());

                MasterManager.SetEventManager(WvsGames[0]);

                WvsShop.Start();

                TimerUpdate          = WvsLogin.CreateTimer();        //Temp
                TimerUpdate.Interval = Constants.GlobalUpdateDelay;
                TimerUpdate.Elapsed  = GlobalUpdater;
                TimerUpdate.Start();

                TimerPing          = WvsLogin.CreateTimer();        //Temp
                TimerPing.Interval = Constants.KeepAliveDelay;
                TimerPing.Elapsed  = PingUpdater;
                TimerPing.Start();

                //FetchLastDailyQuestRecordReset();

                Log.Info("[WvsCenter] Started");

                if (Constants.AllowAccountLoginOverride)
                {
                    Log.Info("[WARNING] Be advised, account login override is enabled.");
                }
            }
            else
            {
                Log.Error("[WvsCenter] Failed startup health check.");
            }
        }
Exemplo n.º 9
0
        /// <summary>
        /// Setup the timer
        /// </summary>
        /// <param name="container">TMPro object that will contain the timer</param>
        /// <param name="timerType">What type of timer will it be (Countdown, Stopwatch, Clock)</param>
        /// <param name="countdownTime">The time that will have in case it is a countdown timer</param>
        /// <returns></returns>
        public static Timer SetupTimer(this TMP_Text container, TimerType timerType, TimerUpdate timerUpdate, float countdownTime = 60f)
        {
            Timer    t           = container.gameObject.AddComponent <Timer>();
            float    elapsedTime = 0f;
            string   text        = string.Empty;
            TimeSpan timePlaying = TimeSpan.Zero;

            switch (timerType)
            {
            case TimerType.Countdown:
                elapsedTime = countdownTime;
                timePlaying = TimeSpan.FromSeconds(elapsedTime);
                text        = timePlaying.ToString("m':'ss'.'ff");
                break;

            case TimerType.Clock:
                text = DateTime.Now.ToString("HH:mm:ss");
                break;
            }
            t.Setup(elapsedTime, true, timePlaying, container, timerType, timerUpdate, text);

            return(t);
        }
Exemplo n.º 10
0
 public void AddTimerUpdateListener(TimerUpdate timerUpdate)
 {
     timerUpdateListeners += timerUpdate;
 }