Esempio n. 1
0
 void OnMarkForClose(IMyEntity Entity)
 {
     try
     {
         RadarCore.SaveUnregister(PersistenceModule.Save);
         MarkerModule.RemoveGPSMarkers(true);
         RadarBlock.AppendingCustomInfo -= RadarBlock_AppendingCustomInfo;
         RadarBlock.OnMarkForClose      -= OnMarkForClose;
     }
     catch { }
 }
Esempio n. 2
0
 public override void UpdateBeforeSimulation10()
 {
     try
     {
         scanx++;
         if (scanx == 6)
         {
             scanx = 0;
             MarkerModule.RemoveGPSMarkers();
             DetectedEntities.Clear();
             if (RadarBlock.CubeGrid.Physics == null)
             {
                 return;
             }
             //System.Diagnostics.Stopwatch watch = new System.Diagnostics.Stopwatch();
             //watch.Start();
             PowerModule.MyRadarPowerSink.Update();
             if (IsWorking())
             {
                 OwnerPlayer = GetOwnerPlayer();
                 FindOwnerInRelayNetwork();
                 CalculateTotalPower();
                 RadarBlock.RefreshCustomInfo();
                 PerformScan();
             }
             else
             {
                 HasOwnerInRelay = false;
                 //if (RadarCore.Debug) TestNote.Hide();
             }
             //watch.Stop();
             //MyAPIGateway.Utilities.ShowMessage(RadarBlock.CustomName, $"Scan took {(Math.Round(watch.ElapsedTicks * 1000f / System.Diagnostics.Stopwatch.Frequency, 2))}");
         }
     }
     catch (Exception Scrap)
     {
         RadarCore.LogError(RadarBlock.CustomName, Scrap);
     }
 }