| | |
| | | // 同时只能有一场战斗在进行 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; |
| | | |
| | |
| | | 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() |
| | | { |
| | |
| | | { |
| | | str += " " + list[i].GetType().Name + "\n"; |
| | | } |
| | | BattleDebug.LogError(str); |
| | | // BattleDebug.LogError(str); |
| | | return list; |
| | | |
| | | } |
| | |
| | | { |
| | | 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) |
| | |
| | | return; |
| | | } |
| | | |
| | | if (queue.Count <= 0) |
| | | { |
| | | return; |
| | | } |
| | | |
| | | var pack = queue.Dequeue(); |
| | | |
| | | // Debug.LogError("DistributeNextReportPackage for guid : " + guid + " pack type : " + pack.GetType()); |
| | |
| | | catch (Exception ex) |
| | | { |
| | | Debug.LogError("DistributeNextPackage: 分发包异常 " + ex); |
| | | // 出错时主动移除当前包,防止死循环 |
| | | if (packQueue.Count > 0) |
| | | { |
| | | packQueue.Dequeue(); |
| | | } |
| | | } |
| | | |
| | | if (queue.Count <= 0) |
| | | { |
| | | battleReportDict.Remove(guid); |
| | | battlePackRelationList.Remove(guid); |
| | | } |
| | | |
| | | } |
| | | #endregion |
| | | |