/// <summary> /// Here we send the vessel that do not have update locks to the server at a given interval. This will update the orbit information etc in the server. /// Bear in mind that the server cannot apply "VesselUpdateMessages" over vessel definitions therefore, to update the information of a vessel in the server /// we must send all the vessel data. /// </summary> private IEnumerator SendAbandonedVesselsToServer() { var seconds = new WaitForSeconds((float)TimeSpan.FromMilliseconds(SettingsSystem.ServerSettings.AbandonedVesselsUpdateMsInterval).TotalSeconds); while (true) { try { if (!Enabled) { break; } if (ProtoSystemBasicReady) { foreach (var vessel in VesselCommon.GetAbandonedVessels()) { MessageSender.SendVesselMessage(vessel); } } } catch (Exception e) { Debug.LogError($"[LMP]: Coroutine error in SendAbandonedVesselsToServer {e}"); } yield return(seconds); } }
/// <summary> /// Here we send the vessel that do not have update locks to the server at a given interval. This will update the orbit information etc in the server. /// Bear in mind that the server cannot apply "VesselUpdateMessages" over vessel definitions therefore, to update the information of a vessel in the server /// we must send all the vessel data. /// </summary> private void SendAbandonedVesselsToServer() { try { if (ProtoSystemBasicReady) { MessageSender.SendVesselMessage(VesselCommon.GetAbandonedVessels()); } } catch (Exception e) { LunaLog.LogError($"[LMP]: Error in SendAbandonedVesselsToServer {e}"); } }