|
@@ -1,6 +1,7 @@
|
|
using Cysharp.Threading.Tasks;
|
|
using Cysharp.Threading.Tasks;
|
|
using KYFramework;
|
|
using KYFramework;
|
|
using Model;
|
|
using Model;
|
|
|
|
+using MongoDB.Bson;
|
|
using Newtonsoft.Json;
|
|
using Newtonsoft.Json;
|
|
using SimulationServer.Utils;
|
|
using SimulationServer.Utils;
|
|
|
|
|
|
@@ -132,6 +133,7 @@ public class ServerStartEventHandler : AEvent<ServerStart>
|
|
|
|
|
|
foreach (SHJTask shjTask in mHTaskConfig.sHJTask)
|
|
foreach (SHJTask shjTask in mHTaskConfig.sHJTask)
|
|
{
|
|
{
|
|
|
|
+ Log.Info(shjTask.ToJson());
|
|
if(shjTask.missionInformation.AircraftInfos == null) continue;
|
|
if(shjTask.missionInformation.AircraftInfos == null) continue;
|
|
for (int i = 0; i < shjTask.missionInformation.AircraftInfos.Length; i++)
|
|
for (int i = 0; i < shjTask.missionInformation.AircraftInfos.Length; i++)
|
|
{
|
|
{
|
|
@@ -149,9 +151,8 @@ public class ServerStartEventHandler : AEvent<ServerStart>
|
|
flightPlanEditor.cruisesegment = editorConfig.cruiseSegment;
|
|
flightPlanEditor.cruisesegment = editorConfig.cruiseSegment;
|
|
flightPlanEditor.cityweather = editorConfig.cityWeather;
|
|
flightPlanEditor.cityweather = editorConfig.cityWeather;
|
|
|
|
|
|
- AircraftSHJ aircraftSHJ = ComponentFactory.Create<AircraftSHJ, FlightPlanEditor>( flightPlanEditor);
|
|
|
|
|
|
+ AircraftSHJ aircraftSHJ = ComponentFactory.Create<AircraftSHJ, FlightPlanEditor,SHJTask>( flightPlanEditor, shjTask);
|
|
mission.End += aircraftSHJ.End;
|
|
mission.End += aircraftSHJ.End;
|
|
- aircraftSHJ.content = shjTask;
|
|
|
|
mission.AircraftSHJs.Add(aircraftSHJ);
|
|
mission.AircraftSHJs.Add(aircraftSHJ);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -191,19 +192,19 @@ public class ServerStartEventHandler : AEvent<ServerStart>
|
|
flightPlanEditor.cruisesegment = editorConfig.cruiseSegment;
|
|
flightPlanEditor.cruisesegment = editorConfig.cruiseSegment;
|
|
flightPlanEditor.cityweather = editorConfig.cityWeather;
|
|
flightPlanEditor.cityweather = editorConfig.cityWeather;
|
|
|
|
|
|
- AircraftZC aircraft = ComponentFactory.Create<AircraftZC, FlightPlanEditor>( flightPlanEditor);
|
|
|
|
|
|
+ AircraftZC aircraft = ComponentFactory.Create<AircraftZC, FlightPlanEditor,ZCTask>( flightPlanEditor, zcTask);
|
|
//aircraft.Name = zcTask.missionInformation.AircraftInfos[i];
|
|
//aircraft.Name = zcTask.missionInformation.AircraftInfos[i];
|
|
//aircraft.NextMissionId = zcTask.NextTaskId;
|
|
//aircraft.NextMissionId = zcTask.NextTaskId;
|
|
mission.End += aircraft.End;
|
|
mission.End += aircraft.End;
|
|
- aircraft.content = zcTask;
|
|
|
|
mission.AircraftZCs.Add(aircraft);
|
|
mission.AircraftZCs.Add(aircraft);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
foreach (XHTask xhTask in taskConfig.xHTask)
|
|
foreach (XHTask xhTask in taskConfig.xHTask)
|
|
{
|
|
{
|
|
|
|
+ if(xhTask.MissionPoints == null) continue;
|
|
RescueMission mission = ComponentFactory.Create<RescueMission>();
|
|
RescueMission mission = ComponentFactory.Create<RescueMission>();
|
|
- mission.AddComponent<EquipmentComponent>();
|
|
|
|
|
|
+ mission.AddComponent<XHEconomicalComponent>();
|
|
mission.AddComponent<XHTotalTaskPerformanceComponent>();
|
|
mission.AddComponent<XHTotalTaskPerformanceComponent>();
|
|
mission.MissionId = $"巡护任务 {xhTask.missionInformation.MissionId}";
|
|
mission.MissionId = $"巡护任务 {xhTask.missionInformation.MissionId}";
|
|
taskSys.RescueMissions.Add(mission);
|
|
taskSys.RescueMissions.Add(mission);
|
|
@@ -219,12 +220,13 @@ public class ServerStartEventHandler : AEvent<ServerStart>
|
|
if(xhTask.missionInformation.AircraftInfos == null) continue;
|
|
if(xhTask.missionInformation.AircraftInfos == null) continue;
|
|
for (int i = 0; i < xhTask.missionInformation.AircraftInfos.Length; i++)
|
|
for (int i = 0; i < xhTask.missionInformation.AircraftInfos.Length; i++)
|
|
{
|
|
{
|
|
|
|
+
|
|
FlightPlanEditor? flightPlanEditor = new FlightPlanEditor();
|
|
FlightPlanEditor? flightPlanEditor = new FlightPlanEditor();
|
|
-
|
|
|
|
flightPlanEditor.aircraftparameter = editorConfig.aircraftParameters.Find(a =>
|
|
flightPlanEditor.aircraftparameter = editorConfig.aircraftParameters.Find(a =>
|
|
a.AircraftID == xhTask.missionInformation.AircraftInfos[i]);
|
|
a.AircraftID == xhTask.missionInformation.AircraftInfos[i]);
|
|
flightPlanEditor.firepoint = new FirePoint[1];
|
|
flightPlanEditor.firepoint = new FirePoint[1];
|
|
flightPlanEditor.firepoint[0] = editorConfig.firePoints[xhTask.FirePointId - 1];
|
|
flightPlanEditor.firepoint[0] = editorConfig.firePoints[xhTask.FirePointId - 1];
|
|
|
|
+ Log.Info("==============================" + xhTask.ToJson());
|
|
flightPlanEditor.missionpoint = xhTask.MissionPoints[0];
|
|
flightPlanEditor.missionpoint = xhTask.MissionPoints[0];
|
|
flightPlanEditor.originbase =
|
|
flightPlanEditor.originbase =
|
|
editorConfig.bases.Find(b => b.BaseId == flightPlanEditor.aircraftparameter.AirportId);
|
|
editorConfig.bases.Find(b => b.BaseId == flightPlanEditor.aircraftparameter.AirportId);
|