|  |  | 
 |  |  |     //  同时只能有一场战斗在进行 guid, battlefield | 
 |  |  |     protected Dictionary<string, BattleField> battleFields = new Dictionary<string, BattleField>(); | 
 |  |  |  | 
 |  |  |     public float[] speedGear; //战斗倍数对应的实际速率 | 
 |  |  |     public int speedIndex | 
 |  |  |     { | 
 |  |  |         get | 
 |  |  |         { | 
 |  |  |             return QuickSetting.Instance.GetQuickSettingValue<int>(QuickSettingType.BattleSpeed, 0); | 
 |  |  |         } | 
 |  |  |         set | 
 |  |  |         { | 
 |  |  |             QuickSetting.Instance.SetQuickSetting(QuickSettingType.BattleSpeed, value); | 
 |  |  |             QuickSetting.Instance.SendPackage(); | 
 |  |  |         } | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     public Action<string, BattleField> onBattleFieldCreate; | 
 |  |  |  | 
 |  |  |     public Action<string, BattleField> onBattleFieldDestroy; | 
 |  |  |  | 
 |  |  |     public bool isWaitServerStory = false;  //主线等服务端回报 0425 | 
 |  |  |  | 
 |  |  |     public override void Init() | 
 |  |  |     { | 
 |  |  | 
 |  |  |  | 
 |  |  |         LogicEngine.Instance.OnUpdate += Run; | 
 |  |  |         DTC0403_tagPlayerLoginLoadOK.playerLoginOkEvent += OnPlayerLoginOk; | 
 |  |  |         DTC0102_tagCDBPlayer.beforePlayerDataInitializeEvent += BeforePlayerInit; | 
 |  |  |         ParseConfig(); | 
 |  |  |          | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     void ParseConfig() | 
 |  |  |     { | 
 |  |  |         var config = FuncConfigConfig.Get("AutoGuaji"); | 
 |  |  |         speedGear = JsonMapper.ToObject<float[]>(config.Numerical4); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |  | 
 |  |  |     public override void Release() | 
 |  |  |     { | 
 |  |  |         base.Release(); | 
 |  |  |         LogicEngine.Instance.OnUpdate -= Run; | 
 |  |  |         DTC0403_tagPlayerLoginLoadOK.playerLoginOkEvent -= OnPlayerLoginOk; | 
 |  |  |         DTC0102_tagCDBPlayer.beforePlayerDataInitializeEvent -= BeforePlayerInit; | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     protected void OnPlayerLoginOk() | 
 |  |  | 
 |  |  |         int FuncLineID = (int)exAttr2; | 
 |  |  |  | 
 |  |  |         CreateStoryBattle(MapID, FuncLineID, null, null); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     void BeforePlayerInit() | 
 |  |  |     { | 
 |  |  |         isWaitServerStory = false;  //后续考虑断线重连 | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     //  上游戏的时候 等战斗阵容更新完毕 创建主线副本 敌方的数据可以暂时不显示 己方表现为睡觉 | 
 |  |  | 
 |  |  |  | 
 |  |  |         List<GameNetPackBasic> packQueueSnapshot = new List<GameNetPackBasic>(packQueue); | 
 |  |  |  | 
 |  |  |         List<GameNetPackBasic> newPackList = new List<GameNetPackBasic>(); | 
 |  |  |         HashSet<int> skipIndexes = new HashSet<int>(); | 
 |  |  |         List<GameNetPackBasic> newPackList = ParseBattlePackList(string.Empty, packQueueSnapshot); | 
 |  |  |  | 
 |  |  |         // 这里已经是按照Dequeue的顺序了 | 
 |  |  |         for (int i = 0; i < packQueueSnapshot.Count; i++) | 
 |  |  |         Action printNewPack = () => | 
 |  |  |         { | 
 |  |  |             if (skipIndexes.Contains(i)) continue; | 
 |  |  |  | 
 |  |  |             GameNetPackBasic pack = packQueueSnapshot[i]; | 
 |  |  |  | 
 |  |  |             // 碰到B421 截断 往下收集b421里的全部内容 | 
 |  |  |             if (pack is HB421_tagMCTurnFightObjAction) | 
 |  |  |             string temp = "After AnalysisPackQueueAndDistribute newPackList count: " + newPackList.Count + "\n"; | 
 |  |  |             foreach (var pack in newPackList) | 
 |  |  |             { | 
 |  |  |                 HB421_tagMCTurnFightObjAction b421Pack = pack as HB421_tagMCTurnFightObjAction; | 
 |  |  |  | 
 |  |  |                 List<GameNetPackBasic> b421PackList = new List<GameNetPackBasic>(); | 
 |  |  |                 i++;    // 跳过当前的B421包 | 
 |  |  |  | 
 |  |  |                 for (; i < packQueueSnapshot.Count; i++) | 
 |  |  |                 if (pack is CustomHB426CombinePack b426Pack) | 
 |  |  |                 { | 
 |  |  |                     GameNetPackBasic nextPack = packQueueSnapshot[i]; | 
 |  |  |                     if (nextPack is HB421_tagMCTurnFightObjAction) | 
 |  |  |                     { | 
 |  |  |                         // 遇到了其他B421 启动角色的Action开始, | 
 |  |  |                         // B421后再碰到B421一定是有一个人的行动结束了 回退一个位置 | 
 |  |  |                         i--; | 
 |  |  |                         break; | 
 |  |  |                     } | 
 |  |  |                     else | 
 |  |  |                     { | 
 |  |  |                         b421PackList.Add(nextPack); | 
 |  |  |                         skipIndexes.Add(i); // 标记已被合包 | 
 |  |  |                     } | 
 |  |  |                     temp += "  pack type is " + pack.GetType().Name + " tag is " + (b426Pack.startTag != null ? b426Pack.startTag.Tag : "null") + "\n"; | 
 |  |  |                 } | 
 |  |  |  | 
 |  |  |                 // 可能没用了 主要就是利用一下skill的combine 暂留 看之后还有没有别的需求 | 
 |  |  |                 CustomB421ActionPack actionPack = CustomB421ActionPack.CreateB421ActionPack(GetGUID(b421Pack.packUID), b421PackList); | 
 |  |  |  | 
 |  |  |                 newPackList.Add(actionPack); | 
 |  |  |                 else if (pack is CustomB421ActionPack b421Pack) | 
 |  |  |                 { | 
 |  |  |                     temp += "  pack type is " + pack.GetType().Name + " guid is " + b421Pack.guid + "\n"; | 
 |  |  |                 } | 
 |  |  |                 else | 
 |  |  |                 { | 
 |  |  |                     temp += "  pack type is " + pack.GetType().Name + "\n"; | 
 |  |  |                 } | 
 |  |  |             } | 
 |  |  |             else | 
 |  |  |             { | 
 |  |  |                 newPackList.Add(pack); | 
 |  |  |             } | 
 |  |  |         } | 
 |  |  |             Debug.LogWarning(temp); | 
 |  |  |         }; | 
 |  |  |  | 
 |  |  |         printNewPack(); | 
 |  |  |  | 
 |  |  |         // HashSet<int> skipIndexes = new HashSet<int>(); | 
 |  |  |  | 
 |  |  |         // // 这里已经是按照Dequeue的顺序了 | 
 |  |  |         // for (int i = 0; i < packQueueSnapshot.Count; i++) | 
 |  |  |         // { | 
 |  |  |         //     if (skipIndexes.Contains(i)) continue; | 
 |  |  |  | 
 |  |  |         //     GameNetPackBasic pack = packQueueSnapshot[i]; | 
 |  |  |  | 
 |  |  |         //     // 碰到B421 截断 往下收集b421里的全部内容 | 
 |  |  |         //     if (pack is HB421_tagMCTurnFightObjAction) | 
 |  |  |         //     { | 
 |  |  |         //         HB421_tagMCTurnFightObjAction b421Pack = pack as HB421_tagMCTurnFightObjAction; | 
 |  |  |  | 
 |  |  |         //         List<GameNetPackBasic> b421PackList = new List<GameNetPackBasic>(); | 
 |  |  |         //         i++;    // 跳过当前的B421包 | 
 |  |  |  | 
 |  |  |         //         // 收集所有非B421包,直到遇到下一个B421或队列结束 | 
 |  |  |         //         for (; i < packQueueSnapshot.Count; i++) | 
 |  |  |         //         { | 
 |  |  |         //             GameNetPackBasic nextPack = packQueueSnapshot[i]; | 
 |  |  |         //             if (nextPack is HB421_tagMCTurnFightObjAction) | 
 |  |  |         //             { | 
 |  |  |         //                 i--; // 回退一个位置,留给外层循环处理 | 
 |  |  |         //                 break; | 
 |  |  |         //             } | 
 |  |  |         //             else | 
 |  |  |         //             { | 
 |  |  |         //                 b421PackList.Add(nextPack); | 
 |  |  |         //                 skipIndexes.Add(i); // 标记已被合包 | 
 |  |  |         //             } | 
 |  |  |         //         } | 
 |  |  |  | 
 |  |  |  | 
 |  |  |  | 
 |  |  |         //         // 合并所有相关包 | 
 |  |  |         //         CustomB421ActionPack actionPack = CustomB421ActionPack.CreateB421ActionPack(GetGUID(b421Pack.packUID), b421PackList); | 
 |  |  |  | 
 |  |  |         //         newPackList.Add(actionPack); | 
 |  |  |         //     } | 
 |  |  |         //     else | 
 |  |  |         //     { | 
 |  |  |         //         newPackList.Add(pack); | 
 |  |  |         //     } | 
 |  |  |         // } | 
 |  |  |  | 
 |  |  |         // 防范机制:连续多次没有战斗片段封包时自动回城 | 
 |  |  |         if (newPackList.Count == 0) | 
 |  |  | 
 |  |  |             Debug.LogWarning($"连续空战斗片段封包次数:{continousEmptyCount}"); | 
 |  |  |             if (continousEmptyCount >= MaxContinousEmptyCount) | 
 |  |  |             { | 
 |  |  |                 BattleDebug.LogError("连续多次没有战斗片段封包,自动回城休息!"); | 
 |  |  |                 Debug.LogError("连续多次没有战斗片段封包,自动回城休息!"); | 
 |  |  |                 MainFightRequest(0); // 0-停止战斗回城 | 
 |  |  |                 continousEmptyCount = 0; | 
 |  |  |                 packQueue.Clear(); | 
 |  |  | 
 |  |  |             continousEmptyCount = 0; // 有包就重置 | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |  | 
 |  |  |         // b421跟b426的包已经处理完了 | 
 |  |  |         packQueue = new Queue<GameNetPackBasic>(newPackList); | 
 |  |  |         packQueue.Clear(); | 
 |  |  |         for (int i = 0; i < newPackList.Count; i++) | 
 |  |  |         { | 
 |  |  |             var pack = newPackList[i]; | 
 |  |  |  | 
 |  |  |             packQueue.Enqueue(pack); | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |      | 
 |  |  |  | 
 |  |  |             // packQueue = new Queue<GameNetPackBasic>(newPackList); | 
 |  |  |  | 
 |  |  |         DistributeNextPackage(); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     public static List<GameNetPackBasic> ParseBattlePackList(string guid, List<GameNetPackBasic> packQueueSnapshot) | 
 |  |  |     { | 
 |  |  |         var list = CustomHB426CombinePack.CombineToSkillPackFromList(guid, packQueueSnapshot); | 
 |  |  |         string str = "ParseBattlePackList \n"; | 
 |  |  |         for (int i = 0; i < list.Count; i++) | 
 |  |  |         { | 
 |  |  |             str += "  " + list[i].GetType().Name + "\n"; | 
 |  |  |         } | 
 |  |  |         // BattleDebug.LogError(str); | 
 |  |  |         return list; | 
 |  |  |  | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     //  专属于主线战斗的派发 | 
 |  |  |     public bool DistributeNextPackage() | 
 |  |  |     { | 
 |  |  |         if (packQueue.Count > 0) | 
 |  |  |         if (packQueue == null) | 
 |  |  |         { | 
 |  |  |             GameNetPackBasic pack = packQueue.Peek(); | 
 |  |  |  | 
 |  |  |             bool dequeue = false; | 
 |  |  |  | 
 |  |  |             if (pack is CustomHB426CombinePack) | 
 |  |  |             { | 
 |  |  |                 CustomHB426CombinePack combinePack = pack as CustomHB426CombinePack; | 
 |  |  |                 packQueue.Dequeue(); | 
 |  |  |                 combinePack.Distribute(); | 
 |  |  |             } | 
 |  |  |             else if (pack is CustomB421ActionPack) | 
 |  |  |             { | 
 |  |  |                 CustomB421ActionPack actionPack = pack as CustomB421ActionPack; | 
 |  |  |  | 
 |  |  |                 dequeue = !actionPack.Distribute(); | 
 |  |  |             } | 
 |  |  |             else | 
 |  |  |             { | 
 |  |  |                 BattleDebug.LogError("distribute pack " + pack.GetType().Name); | 
 |  |  |                 packQueue.Dequeue(); | 
 |  |  |                 PackageRegedit.Distribute(pack); | 
 |  |  |             } | 
 |  |  |  | 
 |  |  |             if (dequeue && packQueue.Count > 0) | 
 |  |  |             { | 
 |  |  |                 packQueue.Dequeue(); | 
 |  |  |             } | 
 |  |  |  | 
 |  |  |             return true; | 
 |  |  |             Debug.LogWarning("DistributeNextPackage: packQueue为空或已处理完毕"); | 
 |  |  |             return false; | 
 |  |  |         } | 
 |  |  |         else | 
 |  |  |  | 
 |  |  |         if (packQueue.Count <= 0) | 
 |  |  |         { | 
 |  |  |             return false; | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |         GameNetPackBasic pack = null; | 
 |  |  |         try | 
 |  |  |         { | 
 |  |  |             pack = packQueue.Dequeue(); | 
 |  |  |         } | 
 |  |  |         catch (Exception ex) | 
 |  |  |         { | 
 |  |  |             Debug.LogError("DistributeNextPackage: Peek异常 " + ex); | 
 |  |  |             return false; | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |         try | 
 |  |  |         { | 
 |  |  |             if (pack is CustomHB426CombinePack combinePack) | 
 |  |  |             { | 
 |  |  |                 combinePack.Distribute(); | 
 |  |  |             } | 
 |  |  |             else if (pack is CustomB421ActionPack actionPack) | 
 |  |  |             { | 
 |  |  |                 actionPack.Distribute(); | 
 |  |  |             } | 
 |  |  |             else | 
 |  |  |             { | 
 |  |  |                 PackageRegedit.Distribute(pack); | 
 |  |  |             } | 
 |  |  |         } | 
 |  |  |         catch (Exception ex) | 
 |  |  |         { | 
 |  |  |             Debug.LogError("DistributeNextPackage: 分发包异常 " + ex); | 
 |  |  |             // 出错时主动移除当前包,防止死循环 | 
 |  |  |             if (packQueue.Count > 0) | 
 |  |  |             { | 
 |  |  |                 packQueue.Dequeue(); | 
 |  |  |             } | 
 |  |  |             return false; | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |         return packQueue.Count > 0; | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     public void OnConnected() | 
 |  |  | 
 |  |  |         if (!battleReportDict.TryGetValue(guid, out queue)) | 
 |  |  |         { | 
 |  |  |             queue = new Queue<GameNetPackBasic>(); | 
 |  |  |             battleReportDict.Add(guid, queue); | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |         queue.Enqueue(vNetPack); | 
 |  |  | 
 |  |  |             battlePackRelationList.Add(guid, uidList); | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |         uidList.Add(vNetPack.packUID); | 
 |  |  |         if (!uidList.Contains(vNetPack.packUID)) | 
 |  |  |         { | 
 |  |  |             uidList.Add(vNetPack.packUID); | 
 |  |  |         } | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     public void PushPackUID(string guid, ulong packUID) | 
 |  |  |     { | 
 |  |  |         List<ulong> uidList = null; | 
 |  |  |  | 
 |  |  |         if (!battlePackRelationList.TryGetValue(guid, out uidList)) | 
 |  |  |         { | 
 |  |  |             uidList = new List<ulong>(); | 
 |  |  |             battlePackRelationList.Add(guid, uidList); | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |         if (!uidList.Contains(packUID)) | 
 |  |  |         { | 
 |  |  |             uidList.Add(packUID); | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     public BattleField GetBattleField(ulong packUID) | 
 |  |  |     { | 
 |  |  |         return GetBattleField(GetGUID(packUID)); | 
 |  |  |         string guid = GetGUID(packUID); | 
 |  |  |         BattleField battleField = GetBattleField(GetGUID(packUID)); | 
 |  |  |         if (battleField == null || battleField.rejectNewPackage) | 
 |  |  |         { | 
 |  |  |             return null; | 
 |  |  |         } | 
 |  |  |         return battleField; | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     public BattleField GetBattleField(string guid) | 
 |  |  | 
 |  |  |     { | 
 |  |  |         Queue<GameNetPackBasic> queue = null; | 
 |  |  |  | 
 |  |  |  | 
 |  |  |         if (!battleReportDict.TryGetValue(guid, out queue)) | 
 |  |  |         { | 
 |  |  |             BattleDebug.LogError("DistributeNextReportPackage could not find queue for guid : " + guid); | 
 |  |  |             return; | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |         var pack = queue.Dequeue(); | 
 |  |  |         BattleDebug.LogError("distribute pack " + pack.GetType().Name); | 
 |  |  |  | 
 |  |  |         PackageRegedit.Distribute(pack); | 
 |  |  |  | 
 |  |  |         if (queue.Count <= 0) | 
 |  |  |         { | 
 |  |  |             battleReportDict.Remove(guid); | 
 |  |  |             battlePackRelationList.Remove(guid); | 
 |  |  |             return; | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |         BattleDebug.LogError("BattlePackage count is " + queue.Count); | 
 |  |  |         var pack = queue.Dequeue(); | 
 |  |  |  | 
 |  |  |         // Debug.LogError("DistributeNextReportPackage for guid : " + guid + " pack type : " + pack.GetType()); | 
 |  |  |  | 
 |  |  |         try | 
 |  |  |         { | 
 |  |  |             if (pack is CustomHB426CombinePack combinePack) | 
 |  |  |             { | 
 |  |  |                 combinePack.Distribute(); | 
 |  |  |             } | 
 |  |  |             else if (pack is CustomB421ActionPack actionPack) | 
 |  |  |             { | 
 |  |  |                 actionPack.Distribute(); | 
 |  |  |             } | 
 |  |  |             else | 
 |  |  |             { | 
 |  |  |                 PackageRegedit.Distribute(pack); | 
 |  |  |             } | 
 |  |  |         } | 
 |  |  |         catch (Exception ex) | 
 |  |  |         { | 
 |  |  |             Debug.LogError("DistributeNextPackage: 分发包异常 " + ex); | 
 |  |  |         } | 
 |  |  |     } | 
 |  |  |     #endregion | 
 |  |  |  | 
 |  |  | 
 |  |  |     { | 
 |  |  |         BattleField battleField = null; | 
 |  |  |  | 
 |  |  |         bool isCreate = true; | 
 |  |  |         if (battleFields.TryGetValue(guid, out battleField)) | 
 |  |  |         { | 
 |  |  |             BattleDebug.LogError("战场已存在 先进行销毁"); | 
 |  |  |             battleField.Destroy(); | 
 |  |  |             //主线战场需一直存在 | 
 |  |  |             if (string.IsNullOrEmpty(guid)) | 
 |  |  |             { | 
 |  |  |                 isCreate = false; | 
 |  |  |             } | 
 |  |  |             else | 
 |  |  |             {  | 
 |  |  |                 BattleDebug.LogError("战场已存在 先进行销毁"); | 
 |  |  |                 battleField.Destroy(); | 
 |  |  |             } | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |         battleField = BattleFieldFactory.CreateBattleField(guid, MapID, FuncLineID, extendData, redTeamList, blueTeamList); | 
 |  |  |         if (isCreate) | 
 |  |  |         {  | 
 |  |  |             battleField = BattleFieldFactory.CreateBattleField(guid, MapID, FuncLineID, extendData, redTeamList, blueTeamList); | 
 |  |  |  | 
 |  |  |         onBattleFieldCreate?.Invoke(guid, battleField); | 
 |  |  |  | 
 |  |  |         if (string.IsNullOrEmpty(guid)) | 
 |  |  |         { | 
 |  |  |             storyBattleField = (StoryBattleField)battleField; | 
 |  |  |             if (string.IsNullOrEmpty(guid)) | 
 |  |  |             { | 
 |  |  |                 storyBattleField = (StoryBattleField)battleField; | 
 |  |  |             } | 
 |  |  |             battleFields.Add(guid, battleField); | 
 |  |  |             onBattleFieldCreate?.Invoke(guid, battleField); | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |         battleFields.Add(guid, battleField); | 
 |  |  |  | 
 |  |  |  | 
 |  |  |         battleField.Init(MapID, FuncLineID, extendData, redTeamList, blueTeamList); | 
 |  |  |  | 
 |  |  | 
 |  |  |             return; | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |         onBattleFieldDestroy?.Invoke(battleField.guid, battleField); | 
 |  |  |         battleField.Release(); | 
 |  |  |  | 
 |  |  |         string guid = battleField.guid; | 
 |  |  |  | 
 |  |  |         if (battleFields.ContainsKey(guid)) | 
 |  |  |         { | 
 |  |  |             battleFields.Remove(guid); | 
 |  |  |         } | 
 |  |  |         battleFields.Remove(guid); | 
 |  |  |         battleReportDict.Remove(guid); | 
 |  |  |         battlePackRelationList.Remove(guid); | 
 |  |  |  | 
 |  |  |         if (storyBattleField == battleField) | 
 |  |  |         { | 
 |  |  | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |         GameObject.DestroyImmediate(battleField.battleRootNode.gameObject); | 
 |  |  |  | 
 |  |  |         onBattleFieldDestroy?.Invoke(battleField.guid, battleField); | 
 |  |  |  | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |  | 
 |  |  | 
 |  |  |     // 0-停止战斗回城   -  玩家主动点击回城时发送 | 
 |  |  |     // 1-设置消耗倍值   -  玩家设置消耗倍值,对应到玩家useHarmerCount的值 | 
 |  |  |     // 2-挑战关卡小怪   -  玩家点击开始战斗时发送,仅从休息状态到开始战斗时发送即可 | 
 |  |  |     // 3-挑战关卡boss   -  玩家请求挑战该关卡boss时发送 | 
 |  |  |     // 3-重定义暂未使用 | 
 |  |  |     // 4-继续战斗          -   玩家主线战斗中(包含主线小怪、主线boss),前端表现完后端同步的战斗片段后,可再回复该值,后端会根据战斗逻辑及流程自动回复下一段的战斗片段封包,一直循环 | 
 |  |  |     public void MainFightRequest(byte reqType, uint reqValue = 0) | 
 |  |  |     { | 
 |  |  |         // Debug.LogError("MainFightRequest reqType " + reqType + " reqValue " + reqValue); | 
 |  |  |         CB413_tagCSMainFightReq req = new CB413_tagCSMainFightReq(); | 
 |  |  |         req.ReqType = reqType; | 
 |  |  |         req.ReqValue = reqValue; | 
 |  |  |  | 
 |  |  |         GameNetSystem.Instance.SendInfo(req); | 
 |  |  |         if (reqType >= 2) | 
 |  |  |             isWaitServerStory = true; | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |  | 
 |  |  | 
 |  |  |     { | 
 |  |  |         try | 
 |  |  |         { | 
 |  |  |             foreach (var battleField in battleFields) | 
 |  |  |             List<string> keys = new List<string>(battleFields.Keys); | 
 |  |  |             for (int i = keys.Count - 1; i >= 0; i--) | 
 |  |  |             { | 
 |  |  |                 battleField.Value?.Run(); | 
 |  |  |                 var battleField = battleFields[keys[i]]; | 
 |  |  |                 battleField?.Run(); | 
 |  |  |             } | 
 |  |  |         } | 
 |  |  |         catch (System.Exception ex) | 
 |  |  | 
 |  |  |         } | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     public BattleField GetBattleFieldByMapID(int v) | 
 |  |  |     { | 
 |  |  |         foreach (var battleField in battleFields) | 
 |  |  |         { | 
 |  |  |             if (battleField.Value.MapID == v) | 
 |  |  |             { | 
 |  |  |                 return battleField.Value; | 
 |  |  |             } | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |         return null; | 
 |  |  |     } | 
 |  |  | } |