コード例 #1
0
ファイル: UtilMethod.cs プロジェクト: qingchen191/workspace
        public static void DealGame(string gameName, int rate)
        {
            WqgameBll gameBll = new WqgameBll();
            WqgameModel game = gameBll.GetModelByName(gameName);
            WqCore bll = new WqCore(new GameInfo(game));
            Random rand = new Random(DateTime.Now.Millisecond);

            int baseRate = GetBaseRateByHour();
            UtilMethod.SaveLog("timerElapsed", gameName + " timer is started. rate is " + rate + ".baseRate is " + baseRate);

            if (rand.Next(baseRate) <= 5)
            {
                //UtilMethod.SaveLog("view", gameName + " is viewed.");
                bll.viewWQ();
                Thread.Sleep(rand.Next(100, 1000));
                if (rand.Next(baseRate) <= 1)
                {
                    bll.viewWQ();
                }
            }

            // 点击频率为1/(baseRate + rate)
            if (rand.Next(baseRate + rate) == 1)
            {
                Thread.Sleep(rand.Next(500, 3000));
                bll.clickWQ();
            }
        }
コード例 #2
0
ファイル: UtilMethod.cs プロジェクト: qingchen191/workspace
        public static void DealGame(string gameName)
        {
            WqgameBll gameBll = new WqgameBll();
            WqgameModel game = gameBll.GetModelByName(gameName);
            WqCore bll = new WqCore(new GameInfo(game));
            Random rand = new Random(DateTime.Now.Millisecond);

            UtilMethod.SaveLog("manual", gameName + " manual click.");

            bll.viewWQ();
            Thread.Sleep(rand.Next(500, 3000));
            bll.clickWQ();
        }