Exemple #1
0
        public void CheckFailTooMuch()
        {
            if (IsVoteTask())
            {
                int succ = 0;
                if (TaskName.Equals(TASK_VOTE_JIUTIAN))
                {
                    TimerChecked++;
                    succ = JiuTian.GetSucc();
                }
                else if (TaskName.Equals(TASK_VOTE_MM))
                {
                    TimerChecked++;
                    succ = MM.GetSucc();
                }
                else if (TaskName.Equals(TASK_VOTE_YUANQIU))
                {
                    TimerChecked++;
                    succ = YuanQiu.GetSucc();
                }

                if (succ - SuccCount < 2 && TimerChecked >= 2)
                {
                    FailTooMuch = true;
                }

                LogCore.Write("success:" + succ + " last:" + SuccCount);
                SuccCount = succ;
            }
        }
Exemple #2
0
        public static void CheckSucc()
        {
            TaskCore taskCore = MonitorCore.GetTaskCore();
            string   taskName = taskCore.TaskName;

            if (taskCore.IsVoteTask())
            {
                var succ = 0;
                if (taskName.Equals(TaskCore.TASK_VOTE_JIUTIAN))
                {
                    succ = JiuTian.GetSucc();
                }
                else if (taskName.Equals(TaskCore.TASK_VOTE_MM))
                {
                    succ = MM.GetSucc();
                }
                else if (taskName.Equals(TaskCore.TASK_VOTE_YUANQIU))
                {
                    succ = YuanQiu.GetSucc();
                }

                if (succ == 0)
                {
                    succ = succCount;
                }

                double price = 0;
                try
                {
                    price = double.Parse(ConfigCore.GetAutoVote("Price"));
                }
                catch (Exception)
                {
                }

                var name       = ConfigCore.GetAutoVote("ProjectName");
                var validCount = price >= 1 ? 1 : 2;
                var diff       = succ - succCount;
                if (diff < validCount)
                {
                    timerChecked++;
                    if (timerChecked >= 2)
                    {
                        FailTooMuch = true;
                    }
                }
                else
                {
                    timerChecked = 0;
                }

                if (diff > 0)
                {
                    Statistics.Add(name, price, diff);
                }
                LogCore.Write("成功:" + succ + " 上次成功:" + succCount);
                succCount = succ;
            }
        }
Exemple #3
0
        //获取 是否需要传票关闭
        private bool GetStopIndicator()
        {
            if (TaskName == null)
            {
                TaskName = ConfigCore.GetTaskName();
            }
            if (TaskName.Equals(TASK_VOTE_JIUTIAN))
            {
                return(JiuTian.GetSucc() > 0);
            }

            if (TaskName.Equals(TASK_VOTE_MM))
            {
                return(MM.GetSucc() > 0);
            }

            if (TaskName.Equals(TASK_VOTE_YUANQIU))
            {
                return(YuanQiu.GetSucc() > 0);
            }

            return(true);
        }