Example #1
0
        public static List <ActiveAwardInfo> GetAwardInfo(DateTime lastDate, int playerGrade)
        {
            string text = null;
            int    num  = (DateTime.Now - lastDate).Days;

            if (DateTime.Now.DayOfYear > lastDate.DayOfYear)
            {
                num++;
            }
            List <ActiveAwardInfo> list = new List <ActiveAwardInfo>();

            foreach (List <ActiveConditionInfo> current in ActiveMgr.m_ActiveConditionInfo.Values)
            {
                foreach (ActiveConditionInfo current2 in current)
                {
                    if (ActiveMgr.IsValid(current2) && ActiveMgr.IsInGrade(current2.LimitGrade, playerGrade) && current2.Condition <= num)
                    {
                        text = current2.AwardId;
                        int arg_98_0 = current2.ActiveID;
                    }
                }
            }
            if (!string.IsNullOrEmpty(text))
            {
                string[] array = text.Split(new char[]
                {
                    ','
                });
                string[] array2 = array;
                for (int i = 0; i < array2.Length; i++)
                {
                    string value = array2[i];
                    if (!string.IsNullOrEmpty(value) && ActiveMgr.m_ActiveAwardInfo.ContainsKey(Convert.ToInt32(value)))
                    {
                        list.Add(ActiveMgr.m_ActiveAwardInfo[Convert.ToInt32(value)]);
                    }
                }
            }
            return(list);
        }
Example #2
0
        public static List <ActiveAwardInfo> GetAwardInfo(DateTime lastDate, int playerGrade)
        {
            string itemIds = null;
            int    days    = (DateTime.Now - lastDate).Days;

            if (DateTime.Now.DayOfYear > lastDate.DayOfYear)
            {
                days++;
            }
            List <ActiveAwardInfo> list = new List <ActiveAwardInfo>();

            foreach (List <ActiveConditionInfo> infos in ActiveMgr.m_ActiveConditionInfo.Values)
            {
                foreach (ActiveConditionInfo info in infos)
                {
                    if (ActiveMgr.IsValid(info) && ActiveMgr.IsInGrade(info.LimitGrade, playerGrade) && info.Condition <= days)
                    {
                        itemIds = info.AwardId;
                        int activeId = info.ActiveID;
                    }
                }
            }
            if (!string.IsNullOrEmpty(itemIds))
            {
                string[] itemArray = itemIds.Split(new char[]
                {
                    ','
                });
                string[] array = itemArray;
                for (int i = 0; i < array.Length; i++)
                {
                    string item = array[i];
                    if (!string.IsNullOrEmpty(item))
                    {
                        list.Add(ActiveMgr.m_ActiveAwardInfo[Convert.ToInt32(item)]);
                    }
                }
            }
            return(list);
        }
Example #3
0
        public static List <ActiveAwardInfo> GetAwardInfo(DateTime lastDate, int playerGrade)
        {
            string str1 = (string)null;
            int    days = (DateTime.Now - lastDate).Days;

            if (DateTime.Now.DayOfYear > lastDate.DayOfYear)
            {
                ++days;
            }
            List <ActiveAwardInfo> list1 = new List <ActiveAwardInfo>();

            foreach (List <ActiveConditionInfo> list2 in ActiveMgr.m_ActiveConditionInfo.Values)
            {
                foreach (ActiveConditionInfo info in list2)
                {
                    if (ActiveMgr.IsValid(info) && ActiveMgr.IsInGrade(info.LimitGrade, playerGrade) && info.Condition <= days)
                    {
                        str1 = info.AwardId;
                        int activeId = info.ActiveID;
                    }
                }
            }
            if (!string.IsNullOrEmpty(str1))
            {
                string str2    = str1;
                char[] chArray = new char[1]
                {
                    ','
                };
                foreach (string str3 in str2.Split(chArray))
                {
                    if (!string.IsNullOrEmpty(str3) && ActiveMgr.m_ActiveAwardInfo.ContainsKey(Convert.ToInt32(str3)))
                    {
                        list1.Add(ActiveMgr.m_ActiveAwardInfo[Convert.ToInt32(str3)]);
                    }
                }
            }
            return(list1);
        }