Exemplo n.º 1
0
 public static void ProcessPaiHang(DBManager dbMgr, bool force = false)
 {
     if (force)
     {
         PaiHangManager.LoadPaiHangLists(dbMgr);
     }
     else
     {
         DateTime dateTime = DateTime.Now;
         long     nowTicks = dateTime.Ticks / 10000L;
         if (nowTicks - PaiHangManager.LastUpdatePaiHangTickTimer >= 1800000L)
         {
             PaiHangManager.LastUpdatePaiHangTickTimer = nowTicks;
             PaiHangManager.LoadPaiHangLists(dbMgr);
         }
         else
         {
             int dayID = dateTime.DayOfYear;
             if (dayID != PaiHangManager.LastCheckPaiHangDayID)
             {
                 PaiHangManager.LastCheckPaiHangDayID = dayID;
                 string gmCmdData = string.Format("-updatepaihangbang", new object[0]);
                 ChatMsgManager.AddGMCmdChatMsg(-1, gmCmdData);
             }
         }
     }
 }
Exemplo n.º 2
0
 private static void LoadPaiHangLists(DBManager dbMgr)
 {
     PaiHangManager.RoleEquipPaiHangList = DBQuery.GetRoleEquipPaiHang(dbMgr);
     if (GameDBManager.GameConfigMgr.GetGameConfigItemInt("paihang-jingmailevel", 0) > 0)
     {
         PaiHangManager.RoleXueWeiNumPaiHangList = DBQuery.GetRoleParamsTablePaiHang(dbMgr, "JingMaiLevel");
     }
     if (GameDBManager.GameConfigMgr.GetGameConfigItemInt("paihang-wuxuelevel", 0) > 0)
     {
         PaiHangManager.RoleSkillLevelPaiHangList = DBQuery.GetRoleParamsTablePaiHang(dbMgr, "WuXueLevel");
     }
     PaiHangManager.RoleHorseJiFenPaiHangList  = DBQuery.GetRoleHorseJiFenPaiHang(dbMgr);
     PaiHangManager.RoleLevelPaiHangList       = DBQuery.GetRoleLevelPaiHang(dbMgr);
     PaiHangManager.RoleYinLiangPaiHangList    = DBQuery.GetRoleYinLiangPaiHang(dbMgr);
     PaiHangManager.RoleLianZhanPaiHangList    = DBQuery.GetRoleLianZhanPaiHang(dbMgr);
     PaiHangManager.RoleKillBossPaiHangList    = DBQuery.GetRoleKillBossPaiHang(dbMgr);
     PaiHangManager.RoleBattleNumPaiHangList   = DBQuery.GetRoleBattleNumPaiHang(dbMgr);
     PaiHangManager.RoleHeroIndexPaiHangList   = DBQuery.GetRoleHeroIndexPaiHang(dbMgr);
     PaiHangManager.RoleGoldPaiHangList        = DBQuery.GetRoleGoldPaiHang(dbMgr);
     PaiHangManager.CombatForcePaiHangList     = DBQuery.GetRoleCombatForcePaiHang(dbMgr);
     PaiHangManager.UserMoneyPaiHangList       = DBQuery.GetUserMoneyPaiHang(dbMgr);
     PaiHangManager.RoleChengJiuPaiHangList    = DBQuery.GetRoleParamsTablePaiHang(dbMgr, "ChengJiuLevel");
     PaiHangManager.RoleShengWangPaiHangList   = DBQuery.GetRoleParamsTablePaiHang(dbMgr, "ShengWangLevel");
     PaiHangManager.RoleGuardStatuePaiHangList = DBQuery.GetRoleGuardStatuePaiHang(dbMgr);
     PaiHangManager.RoleHolyItemPaiHangList    = DBQuery.GetRoleHolyItemPaiHang(dbMgr);
     PaiHangManager.StorePaiHangForHuoDong(dbMgr);
 }
Exemplo n.º 3
0
 protected static void StorePaiHangForHuoDong(DBManager dbMgr)
 {
     PaiHangManager.StorePaiHangPos(dbMgr, 5, 5, 10);
     PaiHangManager.StorePaiHangPos(dbMgr, 8, 6, 10);
     PaiHangManager.StorePaiHangPos(dbMgr, 3, 7, 10);
     PaiHangManager.StorePaiHangPos(dbMgr, 2, 8, 10);
     PaiHangManager.StorePaiHangPos(dbMgr, 8, 36, 10);
     PaiHangManager.StorePaiHangPos(dbMgr, 5, 33, 10);
 }
Exemplo n.º 4
0
        public static Dictionary <int, int> CalcPaiHangPosDictRoleID(int roleID)
        {
            Dictionary <int, int> dict = new Dictionary <int, int>();

            for (int i = 1; i < 23; i++)
            {
                dict[i] = PaiHangManager.GetPaiHangPosByRoleID(i, roleID);
            }
            return(dict);
        }
Exemplo n.º 5
0
 public static void OnChangeName(int roleid, string oldName, string newName)
 {
     if (!string.IsNullOrEmpty(oldName) && !string.IsNullOrEmpty(newName))
     {
         Action <List <PaiHangItemData> > _nameUpdater = delegate(List <PaiHangItemData> _itemList)
         {
             if (_itemList != null)
             {
                 try
                 {
                     List <PaiHangItemData> items = _itemList.FindAll((PaiHangItemData _item) => _item.RoleID == roleid);
                     if (items != null)
                     {
                         foreach (PaiHangItemData item in items)
                         {
                             item.RoleName = newName;
                         }
                     }
                 }
                 catch (Exception)
                 {
                 }
             }
         };
         _nameUpdater(PaiHangManager.RoleEquipPaiHangList);
         _nameUpdater(PaiHangManager.RoleXueWeiNumPaiHangList);
         _nameUpdater(PaiHangManager.RoleSkillLevelPaiHangList);
         _nameUpdater(PaiHangManager.RoleHorseJiFenPaiHangList);
         _nameUpdater(PaiHangManager.RoleLevelPaiHangList);
         _nameUpdater(PaiHangManager.RoleYinLiangPaiHangList);
         _nameUpdater(PaiHangManager.RoleLianZhanPaiHangList);
         _nameUpdater(PaiHangManager.RoleKillBossPaiHangList);
         _nameUpdater(PaiHangManager.RoleBattleNumPaiHangList);
         _nameUpdater(PaiHangManager.RoleHeroIndexPaiHangList);
         _nameUpdater(PaiHangManager.RoleGoldPaiHangList);
         _nameUpdater(PaiHangManager.CombatForcePaiHangList);
         _nameUpdater(PaiHangManager.RoleChengJiuPaiHangList);
         _nameUpdater(PaiHangManager.RoleShengWangPaiHangList);
         PaiHangManager._UpdateName_t_huodongpaihang(roleid, oldName, newName);
         JingJiChangManager.getInstance().OnChangeName(roleid, oldName, newName);
         WanMoTaManager.getInstance().OnChangeName(roleid, oldName, newName);
         WingPaiHangManager.getInstance().OnChangeName(roleid, oldName, newName);
         RingPaiHangManager.getInstance().OnChangeName(roleid, oldName, newName);
         MerlinRankManager.getInstance().OnChangeName(roleid, oldName, newName);
     }
 }