public void SendVesselMessage(Vessel vessel, bool forceSend, bool forceReloadOnReceive) { if (vessel == null || (!forceSend && VesselCommon.IsSpectating) || vessel.state == Vessel.State.DEAD || VesselRemoveSystem.Singleton.VesselWillBeKilled(vessel.id)) { return; } if (!forceSend && !LockSystem.LockQuery.UnloadedUpdateLockBelongsToPlayer(vessel.id, SettingsSystem.CurrentSettings.PlayerName)) { return; } if (!forceSend && !LockSystem.LockQuery.UpdateLockBelongsToPlayer(vessel.id, SettingsSystem.CurrentSettings.PlayerName)) { return; } var vesselHasChanges = VesselToProtoRefresh.RefreshVesselProto(vessel); if (forceSend || vesselHasChanges || !VesselsProtoStore.AllPlayerVessels.ContainsKey(vessel.id)) { SendVesselMessage(vessel.BackupVessel(), forceReloadOnReceive); } if (!VesselsProtoStore.AllPlayerVessels.ContainsKey(vessel.id)) { VesselsProtoStore.AddOrUpdateVesselToDictionary(vessel); } }
public void SendVesselMessage(Vessel vessel, bool force) { if (vessel == null || VesselCommon.IsSpectating || vessel.state == Vessel.State.DEAD) { return; } VesselProtoSystem.CurrentlyUpdatingVesselId = vessel.id; var vesselHasChanges = VesselToProtoRefresh.RefreshVesselProto(vessel); VesselProtoSystem.CurrentlyUpdatingVesselId = Guid.Empty; if (force || vesselHasChanges || !VesselsProtoStore.AllPlayerVessels.ContainsKey(vessel.id)) { SendVesselMessage(vessel.protoVessel); } }
public void SendVesselMessage(Vessel vessel, bool force) { if (vessel == null || VesselCommon.IsSpectating || vessel.state == Vessel.State.DEAD || VesselRemoveSystem.Singleton.VesselWillBeKilled(vessel.id)) { return; } var vesselHasChanges = VesselToProtoRefresh.RefreshVesselProto(vessel); if (force || vesselHasChanges || !VesselsProtoStore.AllPlayerVessels.ContainsKey(vessel.id)) { SendVesselMessage(vessel.BackupVessel()); } if (!VesselsProtoStore.AllPlayerVessels.ContainsKey(vessel.id)) { VesselsProtoStore.AddOrUpdateVesselToDictionary(vessel); } }