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); } } }
/// <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); } } }