12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- using Cysharp.Threading.Tasks;
- using KYFramework;
- using KYFramework.Network;
- using SimulationServer.Utils;
- namespace SimulationServer;
- [MessageHandler]
- public class C2S_GetReportMessageHandler : AMRpcHandler<C2S_GetReport,S2C_GetReport>
- {
- protected override UniTask Run(Session session, C2S_GetReport message, S2C_GetReport response, Action reply)
- {
- var taskSys = Game.Scene.GetComponent<TaskComponent>();
- foreach (MHRescueMission mission in taskSys.MHRescueMissions)
- {
- ResportWithTaskName end = new ResportWithTaskName();
- end.FirePointId = mission.FireGround.FirePointName;
- foreach (var kv in mission.singleReport)
- {
- EntitySheetReportValue aircraftValue = Util.GetSheetReportValue(kv.Key + "-灭火任务单机指标报告", kv.Value);
- end.EntitySheetReportValueArr.Add(aircraftValue);
- }
-
- // 总体数据
- EntitySheetReportValue totalValue = Util.GetSheetReportValue("灭火任务总体指标报告", mission.totalReport);
- end.EntitySheetReportValueArr.Add(totalValue);
-
- // 装备数据
- EntitySheetReportValue equipmentValue = Util.GetSheetReportValue("装备体系评估报告", mission.equipReport);
-
- end.EntitySheetReportValueArr.Add(equipmentValue);
- response.Reports.Add(end);
- }
- foreach (XHRescueMission mission in taskSys.XHRescueMissions)
- {
- ResportWithTaskName end = new ResportWithTaskName();
- end.FirePointId = mission.FireGround.FirePointName;
- // 所有飞机的数据
- foreach (var kv in mission.singleReport)
- {
- EntitySheetReportValue aircraftValue = Util.GetSheetReportValue(kv.Key + "-巡护任务单机指标报告", kv.Value);
- end.EntitySheetReportValueArr.Add(aircraftValue);
- }
-
- // 总体数据
- EntitySheetReportValue totalValue = Util.GetSheetReportValue("巡护任务总体指标报告", mission.totalXhReport);
- end.EntitySheetReportValueArr.Add(totalValue);
-
- // 装备数据
- EntitySheetReportValue equipmentValue = Util.GetSheetReportValue("装备体系评估报告", mission.equipReport);
- end.EntitySheetReportValueArr.Add(equipmentValue);
-
- response.Reports.Add(end);
- }
-
- reply();
- return UniTask.CompletedTask;
- }
- }
|