コード例 #1
0
        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);
            }
        }
コード例 #2
0
        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);
            }
        }
コード例 #3
0
        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);
            }
        }