| | |
| | | Debug.LogWarning($"连续空战斗片段封包次数:{continousEmptyCount}"); |
| | | if (continousEmptyCount >= MaxContinousEmptyCount) |
| | | { |
| | | Debug.LogError("连续多次没有战斗片段封包,自动回城休息!"); |
| | | BattleDebug.LogError("连续多次没有战斗片段封包,自动回城休息!"); |
| | | MainFightRequest(0); // 0-停止战斗回城 |
| | | continousEmptyCount = 0; |
| | | packQueue.Clear(); |
| | |
| | | { |
| | | if (packQueue.Count > 0) |
| | | { |
| | | GameNetPackBasic pack = packQueue.Dequeue(); |
| | | 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; |
| | | actionPack.Distribute(); |
| | | |
| | | 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; |
| | |
| | | |
| | | if (!battleReportDict.TryGetValue(guid, out queue)) |
| | | { |
| | | Debug.LogError("DistributeNextReportPackage could not find queue for guid : " + guid); |
| | | BattleDebug.LogError("DistributeNextReportPackage could not find queue for guid : " + guid); |
| | | return; |
| | | } |
| | | |
| | | PackageRegedit.Distribute(queue.Dequeue()); |
| | | var pack = queue.Dequeue(); |
| | | BattleDebug.LogError("distribute pack " + pack.GetType().Name); |
| | | |
| | | PackageRegedit.Distribute(pack); |
| | | |
| | | if (queue.Count <= 0) |
| | | { |
| | | battleReportDict.Remove(guid); |
| | | battlePackRelationList.Remove(guid); |
| | | } |
| | | |
| | | BattleDebug.LogError("BattlePackage count is " + queue.Count); |
| | | } |
| | | #endregion |
| | | |
| | |
| | | |
| | | if (battleFields.TryGetValue(guid, out battleField)) |
| | | { |
| | | Debug.LogError("战场已存在 先进行销毁"); |
| | | BattleDebug.LogError("战场已存在 先进行销毁"); |
| | | battleField.Destroy(); |
| | | } |
| | | |
| | |
| | | { |
| | | if (battleField == null) |
| | | { |
| | | Debug.LogError("DestroyBattleField called with null battleField"); |
| | | BattleDebug.LogError("DestroyBattleField called with null battleField"); |
| | | return; |
| | | } |
| | | |