| | |
| | | protected Dictionary<string, Queue<GameNetPackBasic>> battleReportDict = new Dictionary<string, Queue<GameNetPackBasic>>(); |
| | | |
| | | protected Dictionary<string, List<ulong>> battlePackRelationList = new Dictionary<string, List<ulong>>(); |
| | | |
| | | // 存储每个 guid 对应的结束状态包(HB420 State==4 等) |
| | | protected Dictionary<string, HB420_tagMCTurnFightState> battleEndPackDict = new Dictionary<string, HB420_tagMCTurnFightState>(); |
| | | |
| | | public void PushPackage(string guid, GameNetPackBasic vNetPack) |
| | | { |
| | |
| | | battleFields.Remove(guid); |
| | | battleReportDict.Remove(guid); |
| | | battlePackRelationList.Remove(guid); |
| | | |
| | | // 清理结束包字典中的记录,防止内存泄漏或旧数据残留 |
| | | if (battleEndPackDict != null && battleEndPackDict.ContainsKey(guid)) |
| | | battleEndPackDict.Remove(guid); |
| | | |
| | | if (storyBattleField == battleField) |
| | | { |
| | |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public void SetEndPack(string guid, HB420_tagMCTurnFightState endPack) |
| | | { |
| | | if (string.IsNullOrEmpty(guid)) |
| | | return; |
| | | |
| | | if (endPack == null) |
| | | { |
| | | if (battleEndPackDict.ContainsKey(guid)) |
| | | battleEndPackDict.Remove(guid); |
| | | return; |
| | | } |
| | | |
| | | // 存储或更新结束包 |
| | | battleEndPackDict[guid] = endPack; |
| | | } |
| | | |
| | | public HB420_tagMCTurnFightState GetEndPack(string guid) |
| | | { |
| | | if (string.IsNullOrEmpty(guid)) return null; |
| | | if (battleEndPackDict.TryGetValue(guid, out var pack)) |
| | | return pack; |
| | | return null; |
| | | } |
| | | } |