zansimple 4 днів тому
батько
коміт
e510ca6ee2

+ 0 - 90
SimulationServer/Entity/Aircrafts/AircraftEntity.cs

@@ -118,95 +118,5 @@ public class AircraftEntity : Entity
             AircraftId = AircraftId,
             TurningPoints = TurningPoints
         });
-        // if (TaskComponent.SimulationStart)
-        // {
-        //     Game.EventSystem.Publish(new AircraftTurningPoints
-        //     {
-        //         AircraftId = AircraftId,
-        //         TurningPoints = TurningPoints
-        //     });
-        //     
-        //     SyncInfo();
-        // }
-        // else
-        // {
-        //     Game.EventSystem.Publish(new AircraftTurningPoints
-        //     {
-        //         AircraftId = AircraftId,
-        //         TurningPoints = TurningPoints
-        //     });
-        // }
     }
-
-    public virtual void StartAsync()
-    {
-        
-    }
-    
-    
-    
-    
-    // 同步信息
-    public virtual void SyncInfo()
-    {
-        if(Init.IsSingleServer)
-            return;
-
-        SyncAircraftInfo().Forget();
-    }
-    
-    
-    public virtual async UniTaskVoid SyncAircraftInfo()
-    {
-        var location = FXJHGenerate.GetAllCurrentLocation(TurningPoints, SimulationTime);
-        
-        SyncLocation(location.Item1, location.Item3);
-
-        if (location.Item2)
-        {
-            SyncOver = true;
-            SyncOverAction?.Invoke();
-
-            if ((mission is MHMission) == false)
-            {
-                mission.IsOver = true;
-            }
-            return;
-        }
-        
-        SimulationTime += Init.SimulationSpeed;
-        await Task.Delay(TimeSpan.FromSeconds(1f));
-        SyncAircraftInfo().Forget();
-    }
-    
-    public void SyncLocation(CurrentLocation location, int index)
-    {
-        // 同步信息到客户端
-        if (location != null)
-        {
-            // 同步信息到客户端
-            S2C_TurningPoint s2CTurningPointOutput = new S2C_TurningPoint();
-            s2CTurningPointOutput.AircraftID = AircraftId;
-            s2CTurningPointOutput.TaskId = TaskName;
-            //s2CTurningPointOutput.TurningPointName = fly.TurningPointName;
-
-            s2CTurningPointOutput.PresentMission = location.PresentMission;
-            
-            s2CTurningPointOutput.PresentLocation = new Point()
-            {
-                Altitude = location.CurrentHei,
-                Latitude = location.CurrentLat,
-                Longitude = location.CurrentLon
-            };
-            
-            s2CTurningPointOutput.NextTurningPointIndex = index;
-            s2CTurningPointOutput.PresentVelocity = location.Currentvelo;
-            SessionComponent.Instance.Session.Send(s2CTurningPointOutput); 
-            //Log.Info($"飞机{aircraft.Name} 当前位置: {location.ToJson()}");
-        }
-    }
-
-
-   
-   
 }

+ 32 - 34
SimulationServer/Entity/Aircrafts/AircraftMH.cs

@@ -111,8 +111,6 @@ public class AircraftMH : AircraftEntity
         
        base.End();
     }
-    
-    
 
     // 更新
     public override void Update(double time)
@@ -185,38 +183,38 @@ public class AircraftMH : AircraftEntity
 
 
     
-    public override async UniTaskVoid SyncAircraftInfo()
-    {
-        var location = FXJHGenerate.GetAllCurrentLocation(TurningPoints, SimulationTime);
-        
-        if (FireGrids.Count > 0 )
-        {
-            Fire.FireGrid fireGrid = FireGrids.First();
-            // 发送火焰数据
-            if (SimulationTime > fireGrid.Time)
-            {
-                //洒水了
-                S2C_FireSpread fireSpread = new S2C_FireSpread();
-                fireSpread.AircraftId = AircraftId;
-                fireSpread.FirePointId = mhRescueMission.FireGround.FirePointName;
-                fireSpread.FireGrids = fireGrid.FireGrids;
-                fireSpread.FiredGrids = fireGrid.FiredGrids;
-                SessionComponent.Instance.Session.Send(fireSpread);
-                FireGrids.RemoveAt(0);
-            }
-        }
-        SyncLocation(location.Item1, location.Item3);
-        
-        if (location.Item2)
-        {
-            SyncOver = true;
-            SyncOverAction?.Invoke();
-            return;
-        }
-        SimulationTime += Init.SimulationSpeed;
-        await Task.Delay(TimeSpan.FromSeconds(1f));
-        SyncAircraftInfo().Forget();
-    }
+    // public async UniTaskVoid SyncAircraftInfo()
+    // {
+    //     var location = FXJHGenerate.GetAllCurrentLocation(TurningPoints, SimulationTime);
+    //     
+    //     if (FireGrids.Count > 0 )
+    //     {
+    //         Fire.FireGrid fireGrid = FireGrids.First();
+    //         // 发送火焰数据
+    //         if (SimulationTime > fireGrid.Time)
+    //         {
+    //             //洒水了
+    //             S2C_FireSpread fireSpread = new S2C_FireSpread();
+    //             fireSpread.AircraftId = AircraftId;
+    //             fireSpread.FirePointId = mhRescueMission.FireGround.FirePointName;
+    //             fireSpread.FireGrids = fireGrid.FireGrids;
+    //             fireSpread.FiredGrids = fireGrid.FiredGrids;
+    //             SessionComponent.Instance.Session.Send(fireSpread);
+    //             FireGrids.RemoveAt(0);
+    //         }
+    //     }
+    //     SyncLocation(location.Item1, location.Item3);
+    //     
+    //     if (location.Item2)
+    //     {
+    //         SyncOver = true;
+    //         SyncOverAction?.Invoke();
+    //         return;
+    //     }
+    //     SimulationTime += Init.SimulationSpeed;
+    //     await Task.Delay(TimeSpan.FromSeconds(1f));
+    //     SyncAircraftInfo().Forget();
+    // }
 }
 
 [ObjectSystem]