Esempio n. 1
0
        /// <summary>
        /// Unload or kills the vessels in the queue
        /// </summary>
        private void RemoveQueuedVessels()
        {
            while (VesselsToRemove.TryDequeue(out var vesselRemoveEntry))
            {
                KillVessel(vesselRemoveEntry.VesselId, vesselRemoveEntry.Reason);

                //Always add to the killed list even if it exists that vessel or not.
                RemovedVessels.TryAdd(vesselRemoveEntry.VesselId, LunaNetworkTime.UtcNow);
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Unload or kills the vessels in the queue
        /// </summary>
        private void RemoveQueuedVessels()
        {
            while (VesselsToRemove.TryDequeue(out var vesselId))
            {
                KillVessel(vesselId);

                //Always add to the killed list even if it exists that vessel or not.
                RemovedVessels.TryAdd(vesselId, LunaTime.Now);
            }
        }
        /// <summary>
        /// Kills a vessel.
        /// </summary>
        public void KillVessel(Guid vesselId, bool addToKilledList, string reason)
        {
            VesselCommon.RemoveVesselFromSystems(vesselId);

            if (addToKilledList)
            {
                //Always add to the killed list even if it exists that vessel or not.
                RemovedVessels.TryAdd(vesselId, LunaNetworkTime.UtcNow);
            }

            KillVessel(FlightGlobals.fetch.LmpFindVessel(vesselId), reason);
        }
        /// <summary>
        /// Unload or kills the vessels in the queue
        /// </summary>
        private void RemoveQueuedVessels()
        {
            if (HighLogic.LoadedScene < GameScenes.SPACECENTER)
            {
                return;
            }

            while (VesselsToRemove.TryDequeue(out var vesselRemoveEntry))
            {
                //Always add to the killed list even if it exists that vessel or not.
                RemovedVessels.TryAdd(vesselRemoveEntry.Vessel.id, LunaNetworkTime.UtcNow);

                KillVessel(vesselRemoveEntry.Vessel, vesselRemoveEntry.Reason);
            }
        }