Esempio n. 1
0
 public FightBusinessRob(FightObject[] teamA, FightObject[] teamB, List<PlayerBusiness> players)
     : base(teamA, teamB, players)
 {
     m_lost = 0;
     m_protectTime = 0;
     m_rob = PartProxy.TryGetPart(Part.Rob) as RobBusiness;
 }
Esempio n. 2
0
 public FightBusinessRobApc(FightObject[] teamA, FightObject[] teamB, List<PlayerBusiness> players,
     string npcID, bool isEctype, SceneApc apc, int subID, RobBusiness rob)
     : base(teamA, teamB, players, npcID, isEctype, apc, subID)
 {
     m_rob = rob;
     //m_rob = PartProxy.TryGetPart(Part.Rob) as RobBusiness;
 }
Esempio n. 3
0
        /// <summary>
        /// 检查活动开始.
        /// </summary>
        /// <param name="part"></param>
        private static void CheckPartStart(Part part)
        {
            PartBusiness pb;
            if (m_parts.TryGetValue(part.ID, out pb))
            {
                return;
            }
            //必须使用本地时间
            DateTime checkTime = DateTime.Now;
            int early = part.Perpare;
            if (early > 0)
            {
                checkTime = DateTime.Now.AddMinutes(early);
            }
            Period period = part.Contains(checkTime);
            if (period == null)
            {
                return;
            }
            DateTime start = period.GetNearStart(checkTime).ToUniversalTime();
            DateTime end = period.GetNearEnd(checkTime).ToUniversalTime();
            //夺宝奇兵
            if (part.ID == Part.Rob)
            {
                pb = new RobBusiness(part);
            }
            //守护战争
            else if (part.ID == Part.Pro)
            {
                pb = new ProBusiness(part);
            }
            //日常打怪
            else if (part.SubType == Part.Hunt)
            {
                pb = new HuntBusiness(part);
            }
            //双倍经验
            else if (part.SubType == Part.DoubleExp)
            {
                pb = new ManyExpBusiness(part);
            }

            if (pb != null && m_parts.TryAdd(part.ID, pb))
            {
                //活动开始
                try
                {
                    pb.Start(start, end);
                    logger.Info("Part start:" + part.Name);
                }
                catch { }
            }
        }