Exemple #1
0
        void serverStatusTimer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
        {
            try
            {
                if (!ServerOnline)
                {
                    serverStatusTimer.Start();
                    return;
                }

                JMMServerBinary.Contract_ServerStatus status = JMMServerVM.Instance.clientBinaryHTTP.GetServerStatus();

                HasherQueueCount = status.HashQueueCount;
                GeneralQueueCount = status.GeneralQueueCount;

                HasherQueueState = status.HashQueueState;
                GeneralQueueState = status.GeneralQueueState;

                IsBanned = status.IsBanned;
                BanReason = status.BanReason;

                HasherQueueRunning = !HasherQueueState.ToLower().Contains("pause");
                GeneralQueueRunning = !GeneralQueueState.ToLower().Contains("pause");

                ServerStatusEventArgs evt = new ServerStatusEventArgs();
                evt.BanReason = BanReason;
                evt.GeneralQueueCount = GeneralQueueCount;
                evt.GeneralQueueRunning = GeneralQueueRunning;
                evt.GeneralQueueState = GeneralQueueState;
                evt.HasherQueueCount = HasherQueueCount;
                evt.HasherQueueRunning = HasherQueueRunning;
                evt.HasherQueueState = HasherQueueState;

                evt.ImagesQueueCount = status.ImagesQueueCount;
                evt.ImagesQueueRunning = !status.ImagesQueueState.ToLower().Contains("pause");
                evt.ImagesQueueState = status.ImagesQueueState;

                evt.IsBanned = IsBanned;

                OnServerStatusEvent(evt);

                string msg = string.Format("JMM Server Status: {0}/{1} -- {2}/{3}", GeneralQueueState, GeneralQueueCount, HasherQueueState, HasherQueueCount);
                //BaseConfig.MyAnimeLog.Write(msg);
            }

            catch { }

            serverStatusTimer.Start();
        }
Exemple #2
0
 protected void OnServerStatusEvent(ServerStatusEventArgs ev)
 {
     if (ServerStatusEvent != null)
     {
         ServerStatusEvent(ev);
     }
 }