Beispiel #1
0
 protected override void reattach()
 {
     if (reattached)
     {
         return;
     }
     Log.detail("HarpoonReconnector: re-attaching to the ground; part = {0}", part.name);
     KASAPI.tryAttachHarpoonImmediately(vessel);
     reattached = true;
 }
Beispiel #2
0
 protected override void reattach()
 {
     if (moduleKISItem != null)
     {
         Log.detail("KASReconnector: re-attaching pylon to the ground");
         KASAPI.groundAttach(moduleKISItem);
     }
     else
     {
         Log.detail("KASReconnector: module is null");
     }
 }
        public void Awake()
        {
            Log.dbg("Awake");

            instance = this;

            excludeVessels     = new List <string>();
            excludeParts       = new List <string>();
            excludePartModules = new List <string>();
            configure();

            KASAPI.initialize();
        }
        public void onVesselSwitching(Vessel from, Vessel to)
        {
            if (to == null || to.situation != Vessel.Situations.LANDED)               // FIXME: Do we need PRELAUNCH here?
            {
                return;
            }

            string fromString = from != null ? (from.name + "(packed=" + from.packed + ")") : "non-vessel";

            Log.info("{0} -> {1}(packed={2})", fromString, to.name, to.packed);

            this.tryDetachAnchor(to);              // If this vessel has anchors (from Hangar), detach them
            KASAPI.tryDetachPylon(to);             // Same with KAS pylons
            KASAPI.tryDetachHarpoon(to);
        }
        public void FixedUpdate()
        {
            if (count == 0)
            {
                return;
            }

            foreach (Vessel v in FlightGlobals.VesselsLoaded)
            {
                if (vesselTimer.ContainsKey(v.id) && vesselTimer[v.id] > 0)
                {
                    stabilize(v);

                    vesselTimer [v.id]--;
                    if (vesselTimer [v.id] == 0)
                    {
                        count--;
                        Log.detail("Stopping stabilizing {0}", v.name);

                        if (count == 0)
                        {
                            if (displayMessage)
                            {
                                ScreenMessages.PostScreenMessage("World has been stabilized");
                                Log.info("World has been stabilized");
                            }
                            onWorldStabilizedEvent.Fire();
                        }
                    }
                }
            }

//			KAS Harpoons are out of order in KAS 1.0
            if (!KASAPI.isNewKsp)
            {
                foreach (Rigidbody rb in KASAPI.harpoonsToHold)
                {
                    KASAPI.holdHarpoon(rb);
                }
            }
        }