Exemple #1
0
 private void Sweeping(object source, ElapsedEventArgs e)
 {
     lock (this.sweepClient)
     {
         WanMotaCopySceneManager.GetWanmotaSweepReward(this.sweepClient, WanMotaCopySceneManager.nWanMoTaFirstFuBenOrder + this.nSweepingOrder - 1);
         this.nSweepingOrder++;
         if (this.nSweepingOrder > this.nSweepingMaxOrder)
         {
             this.StopSweeping();
             List <SingleLayerRewardData> listRewardData         = SweepWanMotaManager.SummarySweepRewardInfo(this.sweepClient);
             List <SingleLayerRewardData> WanMoTaLayerRewardList = this.sweepClient.ClientData.LayerRewardData.WanMoTaLayerRewardList;
             this.sweepClient.ClientData.LayerRewardData.WanMoTaLayerRewardList = listRewardData;
             if (-1 == WanMoTaDBCommandManager.UpdateSweepAwardDBCommand(this.sweepClient, 0))
             {
                 LogManager.WriteLog(LogTypes.Error, "扫荡奖励汇总后,写到数据库失败", null, true);
                 this.sweepClient.ClientData.LayerRewardData.WanMoTaLayerRewardList = WanMoTaLayerRewardList;
             }
             else
             {
                 this.sweepClient.ClientData.WanMoTaProp.nSweepLayer = 0;
                 SweepWanMotaManager.UpdataSweepInfo(this.sweepClient, listRewardData);
             }
         }
         else
         {
             this.sweepClient.ClientData.WanMoTaProp.nSweepLayer = this.nSweepingOrder;
             WanMoTaDBCommandManager.UpdateSweepAwardDBCommand(this.sweepClient, this.sweepClient.ClientData.WanMoTaProp.nSweepLayer);
         }
     }
 }
 public static void SweepBegin(GameClient client)
 {
     if (client.ClientData.WanMoTaProp.nPassLayerCount >= SweepWanMotaManager.nSweepReqMinLayerOrder)
     {
         if (null == client.ClientData.WanMoTaSweeping)
         {
             client.ClientData.WanMoTaSweeping = new SweepWanmota(client);
         }
         client.ClientData.WanMoTaSweeping.nSweepingOrder    = 1;
         client.ClientData.WanMoTaSweeping.nSweepingMaxOrder = client.ClientData.WanMoTaProp.nPassLayerCount;
         client.ClientData.WanMoTaProp.lFlushTime            = TimeUtil.NOW();
         client.ClientData.WanMoTaSweeping.BeginSweeping();
         if (-1 != WanMoTaDBCommandManager.SweepBeginDBCommand(client, 1))
         {
             Global.UpdateFuBenData(client, SweepWanMotaManager.nWanMoTaSweepFuBenOrder, 1, 1);
         }
     }
 }
Exemple #3
0
        /// <summary>
        /// 每2秒扫荡一层万魔塔
        /// </summary>
        private void Sweeping(object source, ElapsedEventArgs e)
        {
            lock (sweepClient)
            {
                WanMotaCopySceneManager.GetWanmotaSweepReward(sweepClient, WanMotaCopySceneManager.nWanMoTaFirstFuBenOrder + nSweepingOrder - 1);
                nSweepingOrder++;

                if (nSweepingOrder > nSweepingMaxOrder)
                {
                    // 扫荡完成
                    StopSweeping();

                    // 将奖励汇总
                    List <SingleLayerRewardData> listRewardData         = SweepWanMotaManager.SummarySweepRewardInfo(sweepClient);
                    List <SingleLayerRewardData> WanMoTaLayerRewardList = sweepClient.ClientData.LayerRewardData.WanMoTaLayerRewardList;

                    // 汇总后用汇总奖励代替各层奖励
                    sweepClient.ClientData.LayerRewardData.WanMoTaLayerRewardList = listRewardData;

                    // 如果更新失败,还原
                    if (-1 == WanMoTaDBCommandManager.UpdateSweepAwardDBCommand(sweepClient, 0))
                    {
                        // 扫荡奖励汇总后,写到数据库失败
                        LogManager.WriteLog(LogTypes.Error, "扫荡奖励汇总后,写到数据库失败");

                        sweepClient.ClientData.LayerRewardData.WanMoTaLayerRewardList = WanMoTaLayerRewardList;
                    }
                    // 成功,发送到客户端
                    else
                    {
                        sweepClient.ClientData.WanMoTaProp.nSweepLayer = 0;
                        SweepWanMotaManager.UpdataSweepInfo(sweepClient, listRewardData);
                        WanMoTaLayerRewardList = null;
                    }
                }
                else
                {
                    sweepClient.ClientData.WanMoTaProp.nSweepLayer = nSweepingOrder;
                    WanMoTaDBCommandManager.UpdateSweepAwardDBCommand(sweepClient, sweepClient.ClientData.WanMoTaProp.nSweepLayer);
                }
            }
        }
Exemple #4
0
        /// <summary>
        /// 开始扫荡
        /// </summary>
        public static void SweepBegin(GameClient client)
        {
            if (client.ClientData.WanMoTaProp.nPassLayerCount < nSweepReqMinLayerOrder)
            {
                return;
            }

            // 每2秒扫荡一层
            if (null == client.ClientData.WanMoTaSweeping)
            {
                client.ClientData.WanMoTaSweeping = new SweepWanmota(client);
            }

            client.ClientData.WanMoTaSweeping.nSweepingOrder    = 1;
            client.ClientData.WanMoTaSweeping.nSweepingMaxOrder = client.ClientData.WanMoTaProp.nPassLayerCount;// ((int)((client.ClientData.WanMoTaProp.nPassLayerCount) / 10)) * 10;
            client.ClientData.WanMoTaProp.lFlushTime            = TimeUtil.NOW();
            client.ClientData.WanMoTaSweeping.BeginSweeping();

            // 利用副本19999进行扫荡次数更新
            if (-1 != WanMoTaDBCommandManager.SweepBeginDBCommand(client, 1))
            {
                Global.UpdateFuBenData(client, nWanMoTaSweepFuBenOrder, 1, 1);
            }
        }
        public static FuBenTongGuanData GiveCopyMapGiftNoScore(GameClient client, FuBenMapItem fuBenMapItem, bool bFirstPass)
        {
            FuBenTongGuanData result;

            if (null == fuBenMapItem)
            {
                result = null;
            }
            else
            {
                List <GoodsData> goodNormal = new List <GoodsData>();
                List <int>       goodsID    = new List <int>();
                WanMotaCopySceneManager.GetFubenItemReward(client, fuBenMapItem, bFirstPass, goodNormal, goodsID);
                if (bFirstPass)
                {
                    WanMotaCopySceneManager.GetFubenItemReward(client, fuBenMapItem, false, goodNormal, goodsID);
                }
                FuBenTongGuanData fuBenTongGuanData = new FuBenTongGuanData();
                fuBenTongGuanData.FuBenID      = fuBenMapItem.FuBenID;
                fuBenTongGuanData.TotalScore   = 0;
                fuBenTongGuanData.KillNum      = 0;
                fuBenTongGuanData.KillScore    = 0;
                fuBenTongGuanData.MaxKillScore = 0;
                fuBenTongGuanData.UsedSecs     = 0;
                fuBenTongGuanData.TimeScore    = 0;
                fuBenTongGuanData.MaxTimeScore = 0;
                fuBenTongGuanData.DieCount     = 0;
                fuBenTongGuanData.DieScore     = 0;
                fuBenTongGuanData.MaxDieScore  = 0;
                fuBenTongGuanData.GoodsIDList  = goodsID;
                string strTitle;
                if (bFirstPass)
                {
                    strTitle = string.Format(GLang.GetLang(570, new object[0]), client.ClientData.WanMoTaNextLayerOrder + 1);
                }
                else
                {
                    strTitle = string.Format(GLang.GetLang(571, new object[0]), client.ClientData.WanMoTaNextLayerOrder + 1);
                }
                if (bFirstPass)
                {
                    fuBenTongGuanData.AwardExp     = fuBenMapItem.nFirstExp + fuBenMapItem.Experience;
                    fuBenTongGuanData.AwardJinBi   = fuBenMapItem.nFirstGold + fuBenMapItem.Money1;
                    fuBenTongGuanData.AwardXingHun = fuBenMapItem.nFirstXingHunAward + fuBenMapItem.nXingHunAward;
                }
                else
                {
                    fuBenTongGuanData.AwardExp     = fuBenMapItem.Experience;
                    fuBenTongGuanData.AwardJinBi   = fuBenMapItem.Money1;
                    fuBenTongGuanData.AwardXingHun = fuBenMapItem.nXingHunAward;
                }
                WanMotaCopySceneManager.AddRewardToClient(client, goodNormal, fuBenTongGuanData.AwardExp, fuBenTongGuanData.AwardJinBi, fuBenTongGuanData.AwardXingHun, strTitle);
                int nWanMoTaNextLayerOrder = GameManager.ClientMgr.GetWanMoTaPassLayerValue(client) + 1;
                GameManager.ClientMgr.SaveWanMoTaPassLayerValue(client, nWanMoTaNextLayerOrder, false);
                client.ClientData.WanMoTaNextLayerOrder = nWanMoTaNextLayerOrder;
                SingletonTemplate <WanMoTaTopLayerManager> .Instance().OnClientPass(client, nWanMoTaNextLayerOrder);

                GameManager.ClientMgr.NotifySelfParamsValueChange(client, RoleCommonUseIntParamsIndexs.WanMoTaCurrLayerOrder, 0);
                WanMoTaDBCommandManager.LayerChangeDBCommand(client, nWanMoTaNextLayerOrder);
                ProcessTask.ProcessRoleTaskVal(client, TaskTypes.WanMoTa, -1);
                result = fuBenTongGuanData;
            }
            return(result);
        }
        /// <summary>
        /// 给玩家副本的奖励 -- 无视评分
        /// </summary>
        /// <param name="client"></param>
        public static FuBenTongGuanData GiveCopyMapGiftNoScore(GameClient client, FuBenMapItem fuBenMapItem, bool bFirstPass)
        {
            if (null == fuBenMapItem)
            {
                return(null);
            }

            List <GoodsData> goodNormal = new List <GoodsData>();
            List <int>       goodsID    = new List <int>();

            // 获取副本的物品奖励
            GetFubenItemReward(client, fuBenMapItem, bFirstPass, goodNormal, goodsID);
            if (bFirstPass)
            {
                GetFubenItemReward(client, fuBenMapItem, false, goodNormal, goodsID);
            }

            FuBenTongGuanData fuBenTongGuanData = new FuBenTongGuanData();

            fuBenTongGuanData.FuBenID      = fuBenMapItem.FuBenID;
            fuBenTongGuanData.TotalScore   = 0;
            fuBenTongGuanData.KillNum      = 0;
            fuBenTongGuanData.KillScore    = 0;
            fuBenTongGuanData.MaxKillScore = 0;             //击杀数=最大击杀数
            fuBenTongGuanData.UsedSecs     = 0;
            fuBenTongGuanData.TimeScore    = 0;
            fuBenTongGuanData.MaxTimeScore = 0;
            fuBenTongGuanData.DieCount     = 0;
            fuBenTongGuanData.DieScore     = 0;
            fuBenTongGuanData.MaxDieScore  = 0;
            fuBenTongGuanData.GoodsIDList  = goodsID;

            string strTitle = "";

            if (bFirstPass)
            {
                strTitle = string.Format("万魔塔首次通关【{0}层】奖励", client.ClientData.WanMoTaNextLayerOrder);
            }
            else
            {
                strTitle = string.Format("万魔塔通关【{0}层】奖励", client.ClientData.WanMoTaNextLayerOrder);
            }

            // 金币、经验奖励
            if (bFirstPass)
            {
                // 首次通关
                fuBenTongGuanData.AwardExp     = fuBenMapItem.nFirstExp + fuBenMapItem.Experience;
                fuBenTongGuanData.AwardJinBi   = fuBenMapItem.nFirstGold + fuBenMapItem.Money1;
                fuBenTongGuanData.AwardXingHun = fuBenMapItem.nFirstXingHunAward;
            }
            else
            {
                fuBenTongGuanData.AwardExp     = fuBenMapItem.Experience;
                fuBenTongGuanData.AwardJinBi   = fuBenMapItem.Money1;
                fuBenTongGuanData.AwardXingHun = fuBenMapItem.nXingHunAward;
            }

            // 给奖励用专门的函数
            AddRewardToClient(client, goodNormal, fuBenTongGuanData.AwardExp, fuBenTongGuanData.AwardJinBi, fuBenTongGuanData.AwardXingHun, strTitle);

            // 保存万魔塔通关层数(角色参数)
            int nWanMoTaNextLayerOrder = GameManager.ClientMgr.GetWanMoTaPassLayerValue(client) + 1;

            GameManager.ClientMgr.SaveWanMoTaPassLayerValue(client, nWanMoTaNextLayerOrder);
            client.ClientData.WanMoTaNextLayerOrder = nWanMoTaNextLayerOrder;

            // 当用户首次通关30层开始,每通关10层万魔塔副本,显示游戏公告
            if (nWanMoTaNextLayerOrder >= 30 && nWanMoTaNextLayerOrder % 10 == 0)
            {
                // 玩家【用户名字】勇往直前,勇不可挡,通过了万魔塔第XX层!
                string broadCastMsg = StringUtil.substitute(Global.GetLang("玩家【{0}】勇往直前,勇不可挡,通过了万魔塔第{1}层!"),
                                                            Global.FormatRoleName(client, client.ClientData.RoleName), nWanMoTaNextLayerOrder);

                //播放用户行为消息
                Global.BroadcastRoleActionMsg(client, RoleActionsMsgTypes.HintMsg, broadCastMsg, true, GameInfoTypeIndexes.Hot, ShowGameInfoTypes.OnlySysHint);
            }

            // 当用户通关超过30层,成功成为万魔塔第一名的角色时,显示游戏公告
            if (nWanMoTaNextLayerOrder >= 30)
            {
                if ((nWanMoTaNextLayerOrder - 1) > GetWanMoTaDetailCmdProcessor.getInstance().WanMoTaTopLayer)
                {
                    string broadCastMsg = StringUtil.substitute(Global.GetLang("玩家【{0}】已势如破竹,雄霸万魔榜首!"),
                                                                Global.FormatRoleName(client, client.ClientData.RoleName));

                    //播放用户行为消息
                    Global.BroadcastRoleActionMsg(client, RoleActionsMsgTypes.HintMsg, broadCastMsg, true, GameInfoTypeIndexes.Hot, ShowGameInfoTypes.OnlySysHint);
                }
            }

            // 通知客户端万魔塔通关层数改变
            GameManager.ClientMgr.NotifySelfParamsValueChange(client, RoleCommonUseIntParamsIndexs.WanMoTaCurrLayerOrder, 0);

            // 保存万魔塔通关层数到万魔塔数据库表
            WanMoTaDBCommandManager.LayerChangeDBCommand(client, nWanMoTaNextLayerOrder);
            return(fuBenTongGuanData);
        }