Ejemplo n.º 1
0
        private void MenuItemCheckNpc_Click(object sender, RoutedEventArgs e)
        {
            var allarenaNpc = ConfigArenanpclinkMgr.GetAll();

            foreach (var item in allarenaNpc)
            {
                var info = DicNpcMgr.GetById(item.NpcId);
                var data = NpcDataHelper.GetMemberView(info);
                item.Kpi = data.Kpi;
                ConfigArenanpclinkMgr.Update(item);
            }
        }
Ejemplo n.º 2
0
        void InitCache()
        {
            try
            {
                LogHelper.Insert("npc dic cache init start", LogType.Info);
                List <DicNpcEntity> list = null;
                if (ShareUtil.IsCross)
                {
                    list = DicNpcMgr.GetAllForCross();
                }
                else
                {
                    list = DicNpcMgr.GetAll();
                }
                _dicNpc              = new Dictionary <Guid, DicNpcEntity>();
                _transferManagerDic  = new Dictionary <Guid, ManagerInput>(list.Count);
                _fightManagerinfoDic = new Dictionary <Guid, Match_FightManagerinfo>(list.Count);
                _dicBuffView         = new Dictionary <Guid, DTOBuffMemberView>(list.Count);
                foreach (var entity in list)
                {
                    var buffView = NpcDataHelper.GetMemberView(entity);
                    _dicNpc.Add(entity.Idx, entity);
                    _dicBuffView.Add(entity.Idx, buffView);
                    _transferManagerDic.Add(entity.Idx, MatchTransferUtil.BuildTransferNpc(entity, buffView));
                    _fightManagerinfoDic.Add(entity.Idx, MatchDataHelper.GetFightinfo(entity, buffView, true));
                }

                _guidePlayers = new List <PlayerInput>();
                var guideConfig = CacheFactory.AppsettingCache.GetAppSetting(EnumAppsetting.TourGuidePlayers);
                var ssss        = guideConfig.Split('|');
                foreach (var ss in ssss)
                {
                    var s = ss.Split(',');
                    _guidePlayers.Add(MatchTransferUtil.BuildPlayerInputForGuide(Convert.ToInt32(s[0]), Convert.ToInt32(s[1]), s[2]));
                }
                LogHelper.Insert("npc dic cache init end", LogType.Info);
            }
            catch (Exception ex)
            {
                LogHelper.Insert(ex);
            }
        }