コード例 #1
0
 public override void OnButtonPress()
 {
     Logging.Write("IsConnected: {0}", IsConnected);
     foreach (string name in HBRelogRemoteApi.GetProfileNames())
     {
         Logging.Write("{1}: GetProfileStatus: {0}", HBRelogRemoteApi.GetProfileStatus(name), name);
         HBRelogRemoteApi.SetProfileStatusText(HbProcId, TreeRoot.StatusText);
     }
 }
コード例 #2
0
        public static void MonitorTimerCb(object sender, EventArgs args)
        {
            try
            {
                if (!IsConnected)
                {
                    return;
                }
                if (!StyxWoW.IsInGame)
                {
                    return;
                }

                if (TreeRoot.StatusText != _lastStatus && !string.IsNullOrEmpty(TreeRoot.StatusText))
                {
                    HBRelogRemoteApi.SetProfileStatusText(HbProcId, TreeRoot.StatusText);
                    _lastStatus = TreeRoot.StatusText;
                }


                if (HeartbeatTimer.IsFinished)
                {
                    HBRelogRemoteApi.Heartbeat(HbProcId);
                    HeartbeatTimer.Reset();
                }

                if (GameStats.IsMeasuring)
                {
                    UpdateTooltip();
                }
            }
            catch (Exception ex)
            {
                if (ex is CommunicationObjectFaultedException)
                {
                    return;
                }
                if (ex is EndpointNotFoundException)
                {
                    Logging.Write("Unable to connect to HBRelog");
                }
                Logging.WriteException(ex);
            }
        }
コード例 #3
0
ファイル: HBRelogHelper.cs プロジェクト: ywjb/Honorbuddy-434
 public static void MonitorTimerCb(object sender, EventArgs args)
 {
     try
     {
         if (!IsConnected)
         {
             return;
         }
         if (!TreeRoot.IsRunning)
         {
             int profileStatus = HBRelogRemoteApi.GetProfileStatus(CurrentProfileName);
             // if HB isn't running after 30 seconds
             // and the HBRelog profile isn't paused then restart hb
             if (profileStatus != 1 && DateTime.Now - _runningTimeStamp >= TimeSpan.FromSeconds(50))
             {
                 HBRelogRemoteApi.RestartHB(HbProcId);
             }
         }
         else
         {
             _runningTimeStamp = DateTime.Now;
         }
         if (TreeRoot.StatusText != _lastStatus && !string.IsNullOrEmpty(TreeRoot.StatusText))
         {
             HBRelogRemoteApi.SetProfileStatusText(HbProcId, TreeRoot.StatusText);
             _lastStatus = TreeRoot.StatusText;
         }
         if (InfoPanel.IsMeasuring)
         {
             UpdateTooltip();
         }
     }
     catch (Exception ex)
     {
         Logging.WriteException(ex);
     }
 }
コード例 #4
0
 public static void SetProfileStatusText(string status)
 {
     HBRelogRemoteApi.SetProfileStatusText(HbProcID, status);
 }