Beispiel #1
0
        void AddUserPrizeDataRefreshExcuter()
        {
            string taskRefreshTime = "0 0 0 * * *";
            //DataLookupsCache.Instance.SearchDataByID<string>("userTaskStatus.refreshTaskTime", out taskRefreshTime);
            Hashtable rule = Johny.HashtablePool.Claim();

            rule.Add("regular", TimerScheduler.AmendCronFormat(taskRefreshTime));
            rule.Add("url", "/sign_in/getUserPrizeData");
            CronRefreshExcuter excuter = new CronRefreshExcuter("refreshUserPrizeData", false);

            excuter.Init(rule, delegate(Hashtable hash) {
                if (hash != null)
                {
                    DataLookupsCache.Instance.CacheData(hash);
                    GameDataSparxManager.Instance.ProcessIncomingData(hash, false);
                }
            });
            AddCronRefreshExcuter(excuter);
        }
Beispiel #2
0
        void AddTaskRefreshExcuter()
        {
            string taskRefreshTime;

            DataLookupsCache.Instance.SearchDataByID <string>("userTaskStatus.refreshTaskTime", out taskRefreshTime);
            Hashtable rule = Johny.HashtablePool.Claim();

            rule.Add("regular", TimerScheduler.AmendCronFormat(taskRefreshTime));
            rule.Add("url", "/mhjtasks/refreshTaskState");
            CronRefreshExcuter excuter = new CronRefreshExcuter("refreshTaskState");

            excuter.Init(rule, delegate(Hashtable hash) {
                string npcLocator;
                DataLookupsCache.Instance.SearchDataByID <string>(string.Format("tasks.{0}.event_count.locator", LTBountyTaskHudController.TaskID()), out npcLocator);
                LTBountyTaskHudController.DeleteMonster(npcLocator);
                DataLookupsCache.Instance.CacheData("user_prize_data.taskliveness_reward", string.Empty);      //重置任务完成情况
                DataLookupsCache.Instance.CacheData("user_prize_data.taskliveness.curr", 0);
                DataLookupsCache.Instance.CacheData("user_prize_data.taskliveness_week_reward", string.Empty); //重置任务完成情况
                DataLookupsCache.Instance.CacheData("user_prize_data.taskweekliveness.curr", 0);
                DataLookupsCache.Instance.CacheData("task_refresh", 1);
            });
            AddCronRefreshExcuter(excuter);
        }