예제 #1
0
 public CrossLadderProcess(Dictionary <Guid, CrossladderMatchEntity> fightDic, CrossladderInfoEntity ladderInfo, int ladderProctiveScore)
 {
     _nbThreadPool             = new NBThreadPool(10);
     this._fightDic            = fightDic;
     this._ladderProctiveScore = ladderProctiveScore;
     _ladderInfo = ladderInfo;
 }
예제 #2
0
        void Initialize()
        {
            _hookListDic         = new ConcurrentDictionary <Guid, List <LadderHook> >();
            _ladderHookCD        = CacheFactory.AppsettingCache.GetAppSettingToInt(EnumAppsetting.LadderHookCD);
            _hookExpired         = CacheFactory.AppsettingCache.GetAppSettingToInt(EnumAppsetting.LadderHookExpired);
            _botName             = CacheFactory.AppsettingCache.GetAppSetting(EnumAppsetting.BotName);
            _ladderProctiveScore = CacheFactory.AppsettingCache.GetAppSettingToInt(EnumAppsetting.LadderProctiveScore);
            //初始化分组模板
            InitGroupTemplate();
            LadderCore.Instance.CreateLadder();
            #region Init Condition dic
            string condition = CacheFactory.AppsettingCache.GetAppSetting(EnumAppsetting.LadderMatchCondition);
            _conditions = new List <ArenaCondition>();
            if (!string.IsNullOrEmpty(condition))
            {
                string[] tempConditions = condition.Split('|');
                foreach (var s in tempConditions)
                {
                    string[] temp = s.Split(',');
                    _conditions.Add(new ArenaCondition(Convert.ToInt32(temp[0]), Convert.ToInt32(temp[1])));
                }
            }
            #endregion

            _nbThreadPool = new NBThreadPool(5);
            timer2        = new Timer {
                Interval = ClearFightdicTime
            };
            timer2.Elapsed += new ElapsedEventHandler(ClearFightDic);
            CreateHook();
        }
예제 #3
0
        //int winExp = 0;
        //int drawExp = 0;
        //int loseExp = 0;
        //int winCoin = 0;
        //int drawCoin = 0;
        //int loseCoin = 0;

        public LadderProcess(ConcurrentDictionary <Guid, LadderMatchEntity> fightDic, LadderInfoEntity ladderInfo, int ladderProctiveScore, bool isGuide = false)
        {
            _nbThreadPool             = new NBThreadPool(10);
            this._fightDic            = fightDic;
            this._ladderProctiveScore = ladderProctiveScore;
            _ladderInfo  = ladderInfo;
            this.isGuide = isGuide;
        }
예제 #4
0
        private void Initialize()
        {
            CrowdManagerDic      = new ConcurrentDictionary <Guid, int>();
            CompetitorDic        = new ConcurrentDictionary <Guid, CrosscrowdManagerEntity>();
            ManagerFightDic      = new Dictionary <Guid, CrowdHeartEntity>();
            _crowdResurrectionCd = CacheFactory.AppsettingCache.GetAppSettingToInt(EnumAppsetting.CrowdResurrectionCd);
            _crowdCd             = CacheFactory.AppsettingCache.GetAppSettingToInt(EnumAppsetting.CrowdCd);
            _crowdMaxPoint       = CacheFactory.AppsettingCache.GetAppSettingToInt(EnumAppsetting.CrowdMaxPoint);
            _crowdMaxLegendCount = CacheFactory.AppsettingCache.GetAppSettingToInt(EnumAppsetting.CrowdMaxLegendCount);
            _startTime           = DateTime.Now;
            //初始化分组模板
            InitGroupTemplate();

            #region Init Condition dic
            string condition = CacheFactory.AppsettingCache.GetAppSetting(EnumAppsetting.CrowdCondition);
            _conditions = new List <ArenaCondition>();
            if (!string.IsNullOrEmpty(condition))
            {
                string[] tempConditions = condition.Split('|');
                foreach (var s in tempConditions)
                {
                    string[] temp = s.Split(',');
                    _conditions.Add(new ArenaCondition(Convert.ToInt32(temp[0]), Convert.ToInt32(temp[1])));
                }
            }
            #endregion
            _nbThreadPool = new NBThreadPool(5);
            _clearTimer   = new Timer {
                Interval = ClearFightdicTime
            };
            _clearTimer.Elapsed += new ElapsedEventHandler(ClearFightDic);

            _timer = new Timer {
                Interval = 5000
            };
            _timer.Elapsed += new ElapsedEventHandler(CheckStatusJob);
            var      crowd   = CrosscrowdInfoMgr.GetCurrent(_domainId);
            DateTime curTime = DateTime.Now;
            if (crowd != null && crowd.EndTime > curTime)
            {
                _crowdInfo = crowd;
                _status    = EnumLadderStatus.Running;
                RobotCore.Instance.RunHook(EnumMatchType.CrossCrowd, _crowdInfo.EndTime);
            }
            else
            {
                _status = EnumLadderStatus.End;
            }
        }
예제 #5
0
 void Initialize()
 {
     if (_isInit == false)
     {
         lock (_lockRoot)
         {
             if (_isInit == false)
             {
                 _matchClient    = new MatchClient();
                 this._poolMatch = new NBThreadPool(MATCHConcurrency);
                 InitMatchPool();
                 _isInit = true;
             }
         }
     }
 }
예제 #6
0
        void PushMatch(BaseMatchData matchData, MatchStateCallback callback, object matchState = null)
        {
            EnumMatchType castMatchType = EnumMatchType.None;

            switch ((EnumMatchType)matchData.MatchType)
            {
            case EnumMatchType.Tour:
            case EnumMatchType.TourElite:
            case EnumMatchType.WorldChallenge:
                castMatchType = EnumMatchType.Tour;
                break;

            case EnumMatchType.Ladder:
            case EnumMatchType.Dailycup:
            case EnumMatchType.League:
            case EnumMatchType.Champion:
                castMatchType = (EnumMatchType)matchData.MatchType;
                break;

            case EnumMatchType.Crowd:
            case EnumMatchType.CrossCrowd:
            case EnumMatchType.Peak:
            case EnumMatchType.CrossPeak:
            case EnumMatchType.GuildWar:
                castMatchType = EnumMatchType.Crowd;
                break;

            default:
                castMatchType = EnumMatchType.None;
                break;
            }
            NBThreadPool pool = null;

            if (!s_dicMatchPool.TryGetValue(castMatchType, out pool) || null == pool)
            {
                pool = _poolMatch;
            }
            pool.Add(() => Handle(matchData, callback, matchState));
        }
예제 #7
0
        private void Initialize()
        {
            _botName             = CacheFactory.AppsettingCache.GetAppSetting(EnumAppsetting.BotName);
            _ladderProctiveScore = CacheFactory.AppsettingCache.GetAppSettingToInt(EnumAppsetting.LadderProctiveScore);
            _ladderRegisterScore = CacheFactory.AppsettingCache.GetAppSettingToInt(EnumAppsetting.RegisterLadderScore);
            //初始化分组模板
            InitGroupTemplate();
            CreateLadder();

            #region Init Condition dic

            string condition = CacheFactory.AppsettingCache.GetAppSetting(EnumAppsetting.CrossLadderCondition);
            _conditions = new List <ArenaCondition>();
            if (!string.IsNullOrEmpty(condition))
            {
                string[] tempConditions = condition.Split('|');
                foreach (var s in tempConditions)
                {
                    string[] temp = s.Split(',');
                    _conditions.Add(new ArenaCondition(Convert.ToInt32(temp[0]), Convert.ToInt32(temp[1])));
                }
            }

            #endregion

            _nbThreadPool = new NBThreadPool(5);
            _timer        = new Timer {
                Interval = 5000
            };
            _timer.Elapsed += new ElapsedEventHandler(CheckStatusJob);
            _timer.Start();
            timer2 = new Timer {
                Interval = ClearFightdicTime
            };
            timer2.Elapsed += new ElapsedEventHandler(ClearFightDic);
        }
예제 #8
0
 public ScheduleThread(int p)
 {
     _threadPool = new NBThreadPool(10);
 }
예제 #9
0
 public TaskHandler(int p)
     : base(p)
 {
     _nbThreadPool = new NBThreadPool(10);
 }
예제 #10
0
 private BuffSyncThreadProvider()
 {
     s_tpBuffMember = new NBThreadPool(10);
     s_tpBuffPool   = new NBThreadPool(10);
 }
예제 #11
0
 public KpiHandler(int p)
 {
     this._threadPool = new NBThreadPool(5);
 }