Class KiftServiceHandler
Inheritance
Implements
Inherited Members
Namespace: Kift.Server
Assembly: Kift.Server.dll
Syntax
public class KiftServiceHandler : KiftService.Iface, KiftService.ISync
Methods
| Improve this Doc View Sourceabort(String, Boolean)
Enable/Disable abort action.
Declaration
public void abort(string vesselId, bool enabled)
Parameters
Type | Name | Description |
---|---|---|
System.String | vesselId | The vessel's ID. |
System.Boolean | enabled | True == enable, false == disable. |
antennaCancelTransmit(Int64)
Cancel data transmission with part ID.
Declaration
public void antennaCancelTransmit(long partId)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | partId | The part's ID. |
antennaDeploy(Int64, Boolean)
Deploy/Retract an antenna with part ID.
Declaration
public void antennaDeploy(long partId, bool enabled)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | partId | The part's ID. |
System.Boolean | enabled | True == deploy, false == retract. |
antennaTransmit(Int64)
Start data transmission with part ID.
Declaration
public void antennaTransmit(long partId)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | partId | The part's ID. |
cargoBayClose(Int64)
Close a cargo bay with part ID.
Declaration
public void cargoBayClose(long partId)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | partId | The part's ID. |
cargoBayOpen(Int64)
Open a cargo bay with part ID.
Declaration
public void cargoBayOpen(long partId)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | partId | The part's ID. |
clearTarget()
Clear targets.
Declaration
public void clearTarget()
controlSurfaceAuthorityLimiter(Int64, Double)
Set authority limiter of a control surface.
Declaration
public void controlSurfaceAuthorityLimiter(long partId, double authorityLimiter)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | partId | The part's ID. |
System.Double | authorityLimiter | The range in which the control surface can move, from -100(full range in reverse direction) to 100(full range). |
controlSurfaceDeployed(Int64, Boolean)
Deploy/Undeploy a control surface.
Declaration
public void controlSurfaceDeployed(long partId, bool enabled)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | partId | The part's ID. |
System.Boolean | enabled | True == deploy, false == undeploy. |
controlSurfaceInverted(Int64, Boolean)
Set a control surface to move in reverse direction.
Declaration
public void controlSurfaceInverted(long partId, bool enabled)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | partId | The part's ID. |
System.Boolean | enabled | True == reverted, false == normal. |
controlSurfacePitchEnabled(Int64, Boolean)
Enable/Disable pitch of a control surface with part ID.
Declaration
public void controlSurfacePitchEnabled(long partId, bool enabled)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | partId | The part's ID. |
System.Boolean | enabled | True == enable, false == disable. |
controlSurfaceRollEnabled(Int64, Boolean)
Enable/Disable roll of a control surface with part ID.
Declaration
public void controlSurfaceRollEnabled(long partId, bool enabled)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | partId | The part's ID. |
System.Boolean | enabled | True == enable, false == disable. |
controlSurfaceYawEnabled(Int64, Boolean)
Enable/Disable yaw of a control surface with part ID.
Declaration
public void controlSurfaceYawEnabled(long partId, bool enabled)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | partId | The part's ID. |
System.Boolean | enabled | True == enable, false == disable. |
currentVessel()
Returns current vessel's basic info.
Declaration
public Vessel currentVessel()
Returns
Type | Description |
---|---|
Kift.Vessel | A Kift.Vessel object which presents current vessel. |
currentVesselFullInfo()
Returns current vessel with full info(orbit info).
Declaration
public Vessel currentVesselFullInfo()
Returns
Type | Description |
---|---|
Kift.Vessel | A Kift.Vessel object which presents current vessel. |
decouplerActivate(Int64)
Activate a decoupler.
Declaration
public void decouplerActivate(long partId)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | partId | The part's ID. |
decreaseTimeWarpRate()
Decrease time warp rate.
Declaration
public void decreaseTimeWarpRate()
dockingPortShieldClose(Int64)
Close the shield of a docking port.
Declaration
public void dockingPortShieldClose(long partId)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | partId | The part's ID. |
dockingPortShieldOpen(Int64)
Open the shield of a docking port.
Declaration
public void dockingPortShieldOpen(long partId)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | partId | The part's ID. |
dockingPortUndock(Int64)
Undock a docking port.
Declaration
public void dockingPortUndock(long partId)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | partId | The part's ID. |
engineActivate(Int64)
Activate an engine.
Declaration
public void engineActivate(long partId)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | partId | The part's ID. |
engineAutoSwitchMode(Int64, Boolean)
Enable/Disable engine Auto-Switch-Mode.
Declaration
public void engineAutoSwitchMode(long partId, bool enabled)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | partId | The part's ID. |
System.Boolean | enabled | True == enable, false == disable. |
engineGimbalLimit(Int64, Double)
Set engine gimbal limit.
Declaration
public void engineGimbalLimit(long partId, double limit)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | partId | The part's ID. |
System.Double | limit | Range from 0(locked) to 100(full range). |
engineGimbalLock(Int64, Boolean)
Enable/Disable engine gimbal lock.
Declaration
public void engineGimbalLock(long partId, bool locked)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | partId | The part's ID. |
System.Boolean | locked | True == locked, false == unlocked. |
engineReverseThrust(Int64, Boolean)
Enable/disable engine reverse thrust.
Declaration
public void engineReverseThrust(long partId, bool enabled)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | partId | The part's ID. |
System.Boolean | enabled | true=reverse thrust, false=normal. |
engineShutDown(Int64)
Shut down an engine.
Declaration
public void engineShutDown(long partId)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | partId | The part's ID. |
engineSwitchMode(Int64, String)
Set engine mode.
Declaration
public void engineSwitchMode(long partId, string mode)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | partId | The part's ID. |
System.String | mode | Mode name, mode names can be queried from API getVesselPartsById(String, List<Int64>). |
engineThrustPercentage(Int64, Int32)
Set engine thrust limit.
Declaration
public void engineThrustPercentage(long partId, int limit)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | partId | The part's ID. |
System.Int32 | limit | Thrust limit, range from 0(cut off) to 100(full throttle). |
engineToggleMode(Int64)
Toggle engine mode.
Declaration
public void engineToggleMode(long partId)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | partId | The part's ID. |
fairingJettison(Int64)
Jettison the fairing.
Declaration
public void fairingJettison(long partId)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | partId | The part's ID. |
forward(String, Double)
Command a vessel to move forward in doking mode.
Declaration
public void forward(string vesselId, double value)
Parameters
Type | Name | Description |
---|---|---|
System.String | vesselId | The controlled vessel's ID. |
System.Double | value | Throttle rate, from -1(forward) to 1(backward). |
Remarks
Controling a vessel via API will overwrite related control input from game, for example, SAS. call resetControl(String) to release control, then the vessel can be controlled by game input again.
getCelestialBody(String)
Returns the celestial body with specific name. The partIds can be from different vessels.
Declaration
public CelestialBody getCelestialBody(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Name of a celestial body. Case sensitive, querying with "Mun" will return corresponding result, while "mun" will not. |
Returns
Type | Description |
---|---|
Kift.CelestialBody | A Kift.CelestialBody object. |
getFlightSceneStartTime()
Declaration
public long getFlightSceneStartTime()
Returns
Type | Description |
---|---|
System.Int64 |
getManeuverNode(String, Double)
Query for a maneuver node at given UT.
Declaration
public ManeuverNode getManeuverNode(string vesselId, double ut)
Parameters
Type | Name | Description |
---|---|---|
System.String | vesselId | The vessel's ID. |
System.Double | ut | UT at which the maneuver node will be added. |
Returns
Type | Description |
---|---|
Kift.ManeuverNode | A Kift.ManeuverNode object which presents a maneuver node. |
getManeuverNodeInfo()
Returns info about reentry.
Declaration
public GetManeuverNodeInfoResponse getManeuverNodeInfo()
Returns
Type | Description |
---|---|
Kift.GetManeuverNodeInfoResponse |
getPartAttitudeInfo(Int64)
Returns info about a part's attitude.
Declaration
public AttitudeInfo getPartAttitudeInfo(long partId)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | partId | The partId's ID. |
Returns
Type | Description |
---|---|
Kift.AttitudeInfo | A Kift.AttitudeInfo object which contains part attitude info. |
getPartsById(List<Int64>)
Returns a list of parts with specific partIds. The partIds can be from different vessels.
Declaration
public List<Part> getPartsById(List<long> partIds)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.List<System.Int64> | partIds | The part IDs. |
Returns
Type | Description |
---|---|
System.Collections.Generic.List<Kift.Part> | A list of Kift.Part. |
getReentryInfo()
Returns info about reentry.
Declaration
public GetReentryInfoResponse getReentryInfo()
Returns
Type | Description |
---|---|
Kift.GetReentryInfoResponse |
getRunwayLandingInfo(Double, Double, Double, Double, Double)
Returns info about landing to a runway.
Declaration
public GetRunwayLandingInfoResponse getRunwayLandingInfo(double inLong, double inLat, double outLong, double outLat, double altitude)
Parameters
Type | Name | Description |
---|---|---|
System.Double | inLong | Longitude of runway entry point. |
System.Double | inLat | Latitude of runway entry point. |
System.Double | outLong | Longitude of runway exit point. |
System.Double | outLat | Latitude of runway exit point. |
System.Double | altitude |
Returns
Type | Description |
---|---|
Kift.GetRunwayLandingInfoResponse |
getTargetBodyOrbitInfo(String, String)
Returns target body's orbit info, and the relationship between specific vessel and target body.
Declaration
public GetTargetBodyOrbitInfoResponse getTargetBodyOrbitInfo(string vesselId, string targetBodyName)
Parameters
Type | Name | Description |
---|---|---|
System.String | vesselId | The vesselId. |
System.String | targetBodyName | Case sensitive, the name of target body. |
Returns
Type | Description |
---|---|
Kift.GetTargetBodyOrbitInfoResponse | A response object with two fields: targetOrbit - a Kift.Orbit object which presents target body's orbit. targetOrbitInfo - a Kift.TargetOrbitInfo object which presents relationships between the two orbits. |
getTargetBodyOrbitInfoFromManeuverNode(String, Double, String)
Returns the relationship between target body's orbit and the orbit derived from a vessel's maneuver node. A KiftException is thrown if the maneuver node does not exist.
Declaration
public GetTargetBodyOrbitInfoFromManeuverNodeResponse getTargetBodyOrbitInfoFromManeuverNode(string vesselId, double ut, string targetBodyName)
Parameters
Type | Name | Description |
---|---|---|
System.String | vesselId | The vesselId. |
System.Double | ut | The universal time at which there's a maneuver node. |
System.String | targetBodyName | Case sensitive, the name of target body. |
Returns
Type | Description |
---|---|
Kift.GetTargetBodyOrbitInfoFromManeuverNodeResponse | A response object with two fields: targetOrbit - a Kift.Orbit object which presents target body's orbit. targetOrbitInfo - a Kift.TargetOrbitInfo object which presents relationships between the two orbits. |
getTargetDockingPortInfo()
Declaration
public GetTargetDockingPortInfoResponse getTargetDockingPortInfo()
Returns
Type | Description |
---|---|
Kift.GetTargetDockingPortInfoResponse |
getTargetVesselOrbitInfo(String, String)
Returns target vessel's orbit info, and the relationship between specific vessel and target vessel.
Declaration
public GetTargetVesselOrbitInfoResponse getTargetVesselOrbitInfo(string vesselId, string targetVesselId)
Parameters
Type | Name | Description |
---|---|---|
System.String | vesselId | The vesselId. |
System.String | targetVesselId | The target vessel's ID. |
Returns
Type | Description |
---|---|
Kift.GetTargetVesselOrbitInfoResponse | A response object with two fields: targetOrbit - a Kift.Orbit object which presents target vessel's orbit. targetOrbitInfo - a Kift.TargetOrbitInfo object which presents relationships between the two orbits. |
getTargetVesselOrbitInfoFromManeuverNode(String, Double, String)
Returns the relationship between target vessel's orbit and the orbit derived from a vessel's maneuver node. A KiftException is thrown if the maneuver node does not exist.
Declaration
public GetTargetVesselOrbitInfoFromManeuverNodeResponse getTargetVesselOrbitInfoFromManeuverNode(string vesselId, double ut, string targetVesselId)
Parameters
Type | Name | Description |
---|---|---|
System.String | vesselId | The vesselId. |
System.Double | ut | The universal time at which there's a maneuver node. |
System.String | targetVesselId | The target vessel's ID. |
Returns
Type | Description |
---|---|
Kift.GetTargetVesselOrbitInfoFromManeuverNodeResponse | A response object with two fields: targetOrbit - a Kift.Orbit object which presents target vessel's orbit. targetOrbitInfo - a Kift.TargetOrbitInfo object which presents relationships between the two orbits. |
getTimeWarpRate()
Get current timewarp rate.
Declaration
public int getTimeWarpRate()
Returns
Type | Description |
---|---|
System.Int32 | Current timewarp rate. |
getVerticalLandingInfo()
Returns info about vertical landing.
Declaration
public GetVerticalLandingInfoResponse getVerticalLandingInfo()
Returns
Type | Description |
---|---|
Kift.GetVerticalLandingInfoResponse |
getVessel(String)
Returns the vessel with specific vesselId.
Declaration
public Vessel getVessel(string vesselId)
Parameters
Type | Name | Description |
---|---|---|
System.String | vesselId | The vesselId. |
Returns
Type | Description |
---|---|
Kift.Vessel | A Kift.Vessel object. |
getVesselAttitudeInfo(String)
Returns info about a vessel's attitude.
Declaration
public AttitudeInfo getVesselAttitudeInfo(string vesselId)
Parameters
Type | Name | Description |
---|---|---|
System.String | vesselId | The vessel's ID. |
Returns
Type | Description |
---|---|
Kift.AttitudeInfo | A Kift.AttitudeInfo object which contains vessel attitude info. |
getVesselParts(String)
Returns a list of a vessel's parts .
Declaration
public List<Part> getVesselParts(string vesselId)
Parameters
Type | Name | Description |
---|---|---|
System.String | vesselId | The vesselId. |
Returns
Type | Description |
---|---|
System.Collections.Generic.List<Kift.Part> | A list of Kift.Part. |
getVesselPartsById(String, List<Int64>)
Returns a list of parts, with specific partIds and vesselId. If any partId doesn't exist or belong to that vessel, it won't be in the returned list.
Declaration
public List<Part> getVesselPartsById(string vesselId, List<long> partIds)
Parameters
Type | Name | Description |
---|---|---|
System.String | vesselId | The vesselId. |
System.Collections.Generic.List<System.Int64> | partIds | The IDs of parts from vessel. |
Returns
Type | Description |
---|---|
System.Collections.Generic.List<Kift.Part> | A list of Kift.Part. |
getVesselPartsByType(String, PartType)
Returns a list of parts, with specific Kift.PartType.
Declaration
public List<Part> getVesselPartsByType(string vesselId, PartType type)
Parameters
Type | Name | Description |
---|---|---|
System.String | vesselId | The vesselId. |
Kift.PartType | type | The part type to be queried. |
Returns
Type | Description |
---|---|
System.Collections.Generic.List<Kift.Part> | A list of Kift.Part. |
getVesselPartsByTypes(String, List<PartType>)
Returns a list of parts, filtered by a list of Kift.PartType.
Declaration
public List<Part> getVesselPartsByTypes(string vesselId, List<PartType> types)
Parameters
Type | Name | Description |
---|---|---|
System.String | vesselId | The vesselId. |
System.Collections.Generic.List<Kift.PartType> | types |
Returns
Type | Description |
---|---|
System.Collections.Generic.List<Kift.Part> | A list of Kift.Part. |
increaseTimeWarpRate()
Increase time warp rate.
Declaration
public void increaseTimeWarpRate()
intakeClose(Int64)
Close the air intake.
Declaration
public void intakeClose(long partId)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | partId | The part's ID. |
intakeOpen(Int64)
Open the air intake.
Declaration
public void intakeOpen(long partId)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | partId | The part's ID. |
launchClampRelease(Int64)
Release the launch clamp.
Declaration
public void launchClampRelease(long partId)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | partId | The part's ID. |
legExtend(Int64)
Extend a leg.
Declaration
public void legExtend(long partId)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | partId | The part's ID. |
legRetract(Int64)
Retract a leg.
Declaration
public void legRetract(long partId)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | partId | The part's ID. |
lightOff(Int64)
Turn off the light.
Declaration
public void lightOff(long partId)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | partId | The part's ID. |
lightOn(Int64)
Turn on the light.
Declaration
public void lightOn(long partId)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | partId | The part's ID. |
listCelestialBody()
Returns a list of all the celestial bodies in current game.
Declaration
public List<CelestialBody> listCelestialBody()
Returns
Type | Description |
---|---|
System.Collections.Generic.List<Kift.CelestialBody> | A list of Kift.CelestialBody. |
listLoadedVessel()
Returns all the loaded vessels in current game.
Declaration
public List<Vessel> listLoadedVessel()
Returns
Type | Description |
---|---|
System.Collections.Generic.List<Kift.Vessel> | A list of Kift.Vessel. |
listManeuverNodes(String)
Get a list of maneuver nodes of a vessel.
Declaration
public List<ManeuverNode> listManeuverNodes(string vesselId)
Parameters
Type | Name | Description |
---|---|---|
System.String | vesselId | The vessel's ID. |
Returns
Type | Description |
---|---|
System.Collections.Generic.List<Kift.ManeuverNode> | A Kift.ManeuverNode list which contains maneuver nodes. |
listVessel()
Returns all the vessels in current game.
Declaration
public List<Vessel> listVessel()
Returns
Type | Description |
---|---|
System.Collections.Generic.List<Kift.Vessel> | A list of Kift.Vessel. |
parachuteCut(Int64)
Cut the parachute.
Declaration
public void parachuteCut(long partId)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | partId | The part's ID. |
parachuteDeploy(Int64)
Deploy the parachute.
Declaration
public void parachuteDeploy(long partId)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | partId | The part's ID. |
parachuteDeployAltitude(Int64, Double)
Set deloy altitude of a parachute, in meters.
Declaration
public void parachuteDeployAltitude(long partId, double altitude)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | partId | The part's ID. |
System.Double | altitude | Deploy altitude, in meters. |
parachuteDisarm(Int64)
Disarm the parachute.
Declaration
public void parachuteDisarm(long partId)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | partId | The part's ID. |
parachuteMinPressure(Int64, Double)
Set the minimum deloy pressure at which the parachute will semi-deploy, in atmospheres.
Declaration
public void parachuteMinPressure(long partId, double pressure)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | partId | The part's ID. |
System.Double | pressure | Minimum deloy pressure, in atmospheres, for example, 0.3 . |
ping()
Declaration
public void ping()
pitch(String, Double)
Pitch a vessel.
Declaration
public void pitch(string vesselId, double value)
Parameters
Type | Name | Description |
---|---|---|
System.String | vesselId | The controlled vessel's ID. |
System.Double | value | Throttle rate, from -1(nose down) to 1(nose up). |
Remarks
Controling a vessel via API will overwrite related control input from game, for example, SAS. call resetControl(String) to release control, then the vessel can be controlled by game input again.
radiatorActivate(Int64)
Activate a radiator.
Declaration
public void radiatorActivate(long partId)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | partId | The part's ID. |
radiatorDeactivate(Int64)
Deactivate a radiator.
Declaration
public void radiatorDeactivate(long partId)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | partId | The part's ID. |
radiatorExtend(Int64)
Extend a radiator.
Declaration
public void radiatorExtend(long partId)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | partId | The part's ID. |
radiatorRetract(Int64)
Retract a radiator.
Declaration
public void radiatorRetract(long partId)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | partId | The part's ID. |
RCSEnabled(Int64, Boolean)
Enable/Disable RCS.
Declaration
public void RCSEnabled(long partId, bool enabled)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | partId | The part's ID. |
System.Boolean | enabled | True == enabled, false == disabled. |
RCSForwardEnabled(Int64, Boolean)
Enable/Disable RCS forward.
Declaration
public void RCSForwardEnabled(long partId, bool enabled)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | partId | The part's ID. |
System.Boolean | enabled | True == enabled, false == disabled. |
RCSPitchEnabled(Int64, Boolean)
Enable/Disable RCS pitch.
Declaration
public void RCSPitchEnabled(long partId, bool enabled)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | partId | The part's ID. |
System.Boolean | enabled | True == enabled, false == disabled. |
RCSRightEnabled(Int64, Boolean)
Enable/Disable RCS right.
Declaration
public void RCSRightEnabled(long partId, bool enabled)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | partId | The part's ID. |
System.Boolean | enabled | True == enabled, false == disabled. |
RCSRollEnabled(Int64, Boolean)
Enable/Disable RCS roll.
Declaration
public void RCSRollEnabled(long partId, bool enabled)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | partId | The part's ID. |
System.Boolean | enabled | True == enabled, false == disabled. |
RCSThrustPercentage(Int64, Int32)
Set RCS thrust limit.
Declaration
public void RCSThrustPercentage(long partId, int limit)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | partId | The part's ID. |
System.Int32 | limit | Range from 0(disabled) to 100(full throttle). |
RCSUpEnabled(Int64, Boolean)
Enable/Disable RCS up.
Declaration
public void RCSUpEnabled(long partId, bool enabled)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | partId | The part's ID. |
System.Boolean | enabled | True == enabled, false == disabled. |
RCSYawEnabled(Int64, Boolean)
Enable/Disable RCS yaw.
Declaration
public void RCSYawEnabled(long partId, bool enabled)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | partId | The part's ID. |
System.Boolean | enabled | True == enabled, false == disabled. |
reactionWheelEnabled(Int64, Boolean)
Enable/Disable a reaction wheel.
Declaration
public void reactionWheelEnabled(long partId, bool enabled)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | partId | The part's ID. |
System.Boolean | enabled | True == enabled, false == disabled. |
releaseControl(String)
Release vessel control, reset vessel control input to 0, then manual input is available.
Declaration
public void releaseControl(string vesselId)
Parameters
Type | Name | Description |
---|---|---|
System.String | vesselId | The controlled vessel's ID. |
removeManeuverNode(String, Double)
Remove the maneuver node at given UT.
Declaration
public void removeManeuverNode(string vesselId, double ut)
Parameters
Type | Name | Description |
---|---|---|
System.String | vesselId | The vessel's ID. |
System.Double | ut | Universal time, the maneuver node at given UT will be removed. |
resetControl(String)
Reset vessel control input(pitch/yaw/roll/up/left/forward) to 0, manual input is overwritten.
Declaration
public void resetControl(string vesselId)
Parameters
Type | Name | Description |
---|---|---|
System.String | vesselId | The controlled vessel's ID. |
resourceConverterStart(Int64, Int32)
Start the resource converter with index. Get the resource converter list from Kift.Part.ResourceConverter.
Declaration
public void resourceConverterStart(long partId, int index)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | partId | The part's ID. |
System.Int32 | index | The converter index. |
resourceConverterStop(Int64, Int32)
Stop the resource converter with index. Get the resource converter list from Kift.Part.ResourceConverter.
Declaration
public void resourceConverterStop(long partId, int index)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | partId | The part's ID. |
System.Int32 | index | The converter index. |
resourceHarvesterDeploy(Int64)
Deploy a resource harvester.
Declaration
public void resourceHarvesterDeploy(long partId)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | partId | The part's ID. |
resourceHarvesterRetract(Int64)
Retract a resource harvester.
Declaration
public void resourceHarvesterRetract(long partId)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | partId | The part's ID. |
resourceHarvesterStart(Int64)
Start a resource harvester.
Declaration
public void resourceHarvesterStart(long partId)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | partId | The part's ID. |
resourceHarvesterStop(Int64)
Stop a resource harvester.
Declaration
public void resourceHarvesterStop(long partId)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | partId | The part's ID. |
right(String, Double)
Command a vessel to move right in doking mode.
Declaration
public void right(string vesselId, double value)
Parameters
Type | Name | Description |
---|---|---|
System.String | vesselId | The controlled vessel's ID. |
System.Double | value | Throttle rate, from -1(left) to 1(right). |
Remarks
Controling a vessel via API will overwrite related control input from game, for example, SAS. call resetControl(String) to release control, then the vessel can be controlled by game input again.
roll(String, Double)
Roll a vessel.
Declaration
public void roll(string vesselId, double value)
Parameters
Type | Name | Description |
---|---|---|
System.String | vesselId | The controlled vessel's ID. |
System.Double | value | Throttle rate, from -1(anticlockwise) to 1(clockwise). |
Remarks
Controling a vessel via API will overwrite related control input from game, for example, SAS. call resetControl(String) to release control, then the vessel can be controlled by game input again.
sensorActivate(Int64)
Activate a sensor.
Declaration
public void sensorActivate(long partId)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | partId | The part's ID. |
sensorDeactivate(Int64)
Deactivate a sensor.
Declaration
public void sensorDeactivate(long partId)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | partId | The part's ID. |
setActionGroup(String, Int32, Boolean)
Enable/Disable action group with groupId.
Declaration
public void setActionGroup(string vesselId, int groupId, bool enabled)
Parameters
Type | Name | Description |
---|---|---|
System.String | vesselId | The vessel's ID. |
System.Int32 | groupId | Action group ID. |
System.Boolean | enabled | True == enable, false == disable. |
setAntennas(String, Boolean)
Deploy/Retract antennas.
Declaration
public void setAntennas(string vesselId, bool enabled)
Parameters
Type | Name | Description |
---|---|---|
System.String | vesselId | The vessel's ID. |
System.Boolean | enabled | True == deploy, false == retract. |
setBrakes(String, Boolean)
Engage/Disengage brakes.
Declaration
public void setBrakes(string vesselId, bool enabled)
Parameters
Type | Name | Description |
---|---|---|
System.String | vesselId | The vessel's ID. |
System.Boolean | enabled | True == engage. |
setCameraFocussedVessel(String)
Focus the camera on a vessel.
Declaration
public void setCameraFocussedVessel(string vesselId)
Parameters
Type | Name | Description |
---|---|---|
System.String | vesselId | Set the camera focused on given vessel. |
setCameraMode(CameraMode)
Focus the camera on a vessel.
Declaration
public void setCameraMode(CameraMode mode)
Parameters
Type | Name | Description |
---|---|---|
Kift.CameraMode | mode |
setCargoBays(String, Boolean)
Open/Close cargo bays.
Declaration
public void setCargoBays(string vesselId, bool enabled)
Parameters
Type | Name | Description |
---|---|---|
System.String | vesselId | The vessel's ID. |
System.Boolean | enabled | True == open, false == close. |
setControlFrom(String, Int64)
Control from the Part with specific Id.
Declaration
public void setControlFrom(string vesselId, long partId)
Parameters
Type | Name | Description |
---|---|---|
System.String | vesselId | The vessel's ID. |
System.Int64 | partId | Id of the Part from which the vessel is controlled. |
setGear(String, Boolean)
Deploy/Retract gears, including landing legs, deployable wheels.
Declaration
public void setGear(string vesselId, bool enabled)
Parameters
Type | Name | Description |
---|---|---|
System.String | vesselId | The vessel's ID. |
System.Boolean | enabled | True == deploy. |
setIntakes(String, Boolean)
Open/Close air intakes.
Declaration
public void setIntakes(string vesselId, bool enabled)
Parameters
Type | Name | Description |
---|---|---|
System.String | vesselId | The vessel's ID. |
System.Boolean | enabled | True == open, false == close. |
setLegs(String, Boolean)
Deploy/Retract legs.
Declaration
public void setLegs(string vesselId, bool enabled)
Parameters
Type | Name | Description |
---|---|---|
System.String | vesselId | The vessel's ID. |
System.Boolean | enabled | True == deploy. |
setLights(String, Boolean)
Turn on/off lights.
Declaration
public void setLights(string vesselId, bool enabled)
Parameters
Type | Name | Description |
---|---|---|
System.String | vesselId | The vessel's ID. |
System.Boolean | enabled | True == on. |
setManeuverNode(String, Double, Double, Double, Double)
Create a maneuver node at given UT for a vessel. If there is already a maneuver node at that UT, it'll be deleted first.
Declaration
public ManeuverNode setManeuverNode(string vesselId, double ut, double prograde, double normal, double radial)
Parameters
Type | Name | Description |
---|---|---|
System.String | vesselId | The vessel's ID. |
System.Double | ut | UT at which the maneuver node will be added. |
System.Double | prograde | DeltaV in prograde direction, in m/s. |
System.Double | normal | DeltaV in nomal direction, in m/s. |
System.Double | radial | DeltaV in radial direction, in m/s. |
Returns
Type | Description |
---|---|
Kift.ManeuverNode | A Kift.ManeuverNode object which presents the created maneuver node. |
setParachutes(String, Boolean)
Deploy/Undeploy parachutes.
Declaration
public void setParachutes(string vesselId, bool enabled)
Parameters
Type | Name | Description |
---|---|---|
System.String | vesselId | The vessel's ID. |
System.Boolean | enabled | True == deploy, false == undeploy. |
setRadiators(String, Boolean)
Deploy/Retract radiators.
Declaration
public void setRadiators(string vesselId, bool enabled)
Parameters
Type | Name | Description |
---|---|---|
System.String | vesselId | The vessel's ID. |
System.Boolean | enabled | True == deploy, false == retract. |
setRCS(String, Boolean)
Enable/Disable RCS.
Declaration
public void setRCS(string vesselId, bool enabled)
Parameters
Type | Name | Description |
---|---|---|
System.String | vesselId | The vessel's ID. |
System.Boolean | enabled | True == enable. |
setReactionWheels(String, Boolean)
Enable/Disable reaction wheels.
Declaration
public void setReactionWheels(string vesselId, bool enabled)
Parameters
Type | Name | Description |
---|---|---|
System.String | vesselId | The vessel's ID. |
System.Boolean | enabled | True == enable. |
setResourceHarvestersActive(String, Boolean)
Activate/Deactivate resource harvesters.
Declaration
public void setResourceHarvestersActive(string vesselId, bool enabled)
Parameters
Type | Name | Description |
---|---|---|
System.String | vesselId | The vessel's ID. |
System.Boolean | enabled | True == activate, false == deactivate. |
setResourceHarvestersDeploy(String, Boolean)
Deploy/Retract resource harvesters.
Declaration
public void setResourceHarvestersDeploy(string vesselId, bool enabled)
Parameters
Type | Name | Description |
---|---|---|
System.String | vesselId | The vessel's ID. |
System.Boolean | enabled | True == deploy, false == retract. |
setSAS(String, Boolean)
Enable/Disable SAS.
Declaration
public void setSAS(string vesselId, bool enabled)
Parameters
Type | Name | Description |
---|---|---|
System.String | vesselId | The vessel's ID. |
System.Boolean | enabled | True == enable. |
setSASMode(String, SASMode)
Set vessel's SAS mode.
Declaration
public void setSASMode(string vesselId, SASMode sasMode)
Parameters
Type | Name | Description |
---|---|---|
System.String | vesselId | The vessel's ID. |
Kift.SASMode | sasMode | Available modes: |
setSolarPanels(String, Boolean)
Deploy/Retract solar panels.
Declaration
public void setSolarPanels(string vesselId, bool enabled)
Parameters
Type | Name | Description |
---|---|---|
System.String | vesselId | The vessel's ID. |
System.Boolean | enabled | True == deploy, false == retract. |
setWheels(String, Boolean)
Deploy/Retract wheels, if deployable.
Declaration
public void setWheels(string vesselId, bool enabled)
Parameters
Type | Name | Description |
---|---|---|
System.String | vesselId | The vessel's ID. |
System.Boolean | enabled | True == deploy. |
snapshot(SnapshotRequest)
Monitor vessel data in real time, for example, altitude, pitch angle, speed, etc.
Declaration
public SnapshotResponse snapshot(SnapshotRequest snapshotRequest)
Parameters
Type | Name | Description |
---|---|---|
Kift.SnapshotRequest | snapshotRequest | The ID of the vessel you want to monitor, and the keys of data to be monitored. The keys are devided into 4 categories: Vessel, Flight, Orbit, Part. |
Returns
Type | Description |
---|---|
Kift.SnapshotResponse | A Kift.SnapshotResponse object which contains the data monitored. |
Remarks
Achieved by making requests continuously from the client, because Thrift v0.12.0 doesn't support streaming. I tried to use GRPC at first, but it appears that GRPC requires .NET Framework 4.5+, and unfortunately, KSP is built on .NET Framework 3.5 .
Examples
// Monitor current vessel's orbit apoapsis, surface speed, total mass and engine throttle percentage in C#.
KiftService.Client client = new Client("localhost", 9090).Connect(); // connect to server
Vessel currentVessel = client.currentVessel(); // get current vessel
VesselObservor vo = new VesselObservor(currentVessel.Id, client); // VesselObservor is from KiftClient.CSharp
vo.WatchVessel(OVessel.Mass);
vo.WatchOrbit(OOrbit.Apoapsis);
vo.WatchFlight(OFlight.SurfaceSpeed);
List <Part> engines = client.getVesselPartsByType(currentVessel.Id, PartType.Engine); // get the engine part
long engineId = engines[0].id;
vo.WatchPart(engineId, OPart.EngineThrottle);
// VesselObservor provides two ways to fetch data from the game:
// 1, fetch once, then the data won't be updated until the next "Capture()" action is done.
vo.Capture(); // send a request to server, and update the data held by VesselObservor
double mass = vo.Snapshot.Vessel.mass; // get current total mass
double apoapsis = vo.Snapshot.Orbit.apoapsis; // get current orbit apoapsis
double surfaceSpeed = vo.Snapshot.Flight.surfaceSpeed; // get current surface speed
double throttle = vo.Snapshot.Parts[engineId].Engine.throttle; // get current engine throttle level
// 2, update automatically, with an interval(in milliseconds).
vo.SyncInterval = 200; // send a request every 200 milliseconds, and update the data held by VesselObservor
vo.StartStream(); // start the loop
...
double mass = vo.Snapshot.Vessel.mass; // data held by VesselObservor is always up to date.
...
vo.StopStream(); // stop the loop
|
Improve this Doc
View Source
solarPanelExtend(Int64)
Extend a solar panel.
Declaration
public void solarPanelExtend(long partId)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | partId | The part's ID. |
solarPanelRetract(Int64)
Retract a solar panel.
Declaration
public void solarPanelRetract(long partId)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | partId | The part's ID. |
stage()
Activate the next stage.
Declaration
public void stage()
switchActiveVessel(String)
Declaration
public void switchActiveVessel(string vesselId)
Parameters
Type | Name | Description |
---|---|---|
System.String | vesselId |
targetCelestialBody(String, String)
Set vessel's target to a celestial body.
Declaration
public void targetCelestialBody(string vesselId, string targetName)
Parameters
Type | Name | Description |
---|---|---|
System.String | vesselId | The vessel's ID. |
System.String | targetName | Case sensitive, name of target celestial body. |
targetDockingPort(String, Int64)
Set vessel's target to a docking port.
Declaration
public void targetDockingPort(string vesselId, long dockingPortId)
Parameters
Type | Name | Description |
---|---|---|
System.String | vesselId | The vessel's ID. |
System.Int64 | dockingPortId | The target docking port's ID. |
targetVessel(String, String)
Set vessel's target to another vessel.
Declaration
public void targetVessel(string vesselId, string targetVesselId)
Parameters
Type | Name | Description |
---|---|---|
System.String | vesselId | The vessel's ID. |
System.String | targetVesselId | The target vessel's ID. |
throttle(String, Double)
Set vessel's main engine throttle rate.
Declaration
public void throttle(string vesselId, double value)
Parameters
Type | Name | Description |
---|---|---|
System.String | vesselId | The controlled vessel's ID. |
System.Double | value | Main engine throttle rate, from 0(0%) to 1(100%). |
toggleActionGroup(String, Int32)
Toggle action group state with groupId.
Declaration
public void toggleActionGroup(string vesselId, int groupId)
Parameters
Type | Name | Description |
---|---|---|
System.String | vesselId | The vessel's ID. |
System.Int32 | groupId | Action group ID. |
universalTime()
Get current universal time in game.
Declaration
public double universalTime()
Returns
Type | Description |
---|---|
System.Double | Current universal time in game. |
up(String, Double)
Command a vessel to move up in doking mode.
Declaration
public void up(string vesselId, double value)
Parameters
Type | Name | Description |
---|---|---|
System.String | vesselId | The controlled vessel's ID. |
System.Double | value | Throttle rate, from -1(up) to 1(down). |
Remarks
Controling a vessel via API will overwrite related control input from game, for example, SAS. call resetControl(String) to release control, then the vessel can be controlled by game input again.
warpTo(Double)
Timewarp to universal time "ut".
Declaration
public void warpTo(double ut)
Parameters
Type | Name | Description |
---|---|---|
System.Double | ut | The target universal time. |
wheelAutoFrictionControlEnabled(Int64, Boolean)
Enable/Disable wheel auto friction control.
Declaration
public void wheelAutoFrictionControlEnabled(long partId, bool enabled)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | partId | The part's ID. |
System.Boolean | enabled | True == enabled, false == disabled. |
wheelBrakeEngage(Int64)
Engage the brake of a wheel.
Declaration
public void wheelBrakeEngage(long partId)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | partId | The part's ID. |
wheelBrakeForce(Int64, Double)
Set wheel brake's force in percentage.
Declaration
public void wheelBrakeForce(long partId, double percentage)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | partId | The part's ID. |
System.Double | percentage | Range from 0 to 100. |
wheelBrakeRelease(Int64)
Release the brake of a wheel.
Declaration
public void wheelBrakeRelease(long partId)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | partId | The part's ID. |
wheelDeploy(Int64)
Deploy a wheel, if the wheel is deployable.
Declaration
public void wheelDeploy(long partId)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | partId | The part's ID. |
wheelDriveLimiter(Int64, Double)
Set motor drive limiter, if traction control is disabled.
Declaration
public void wheelDriveLimiter(long partId, double limit)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | partId | The part's ID. |
System.Double | limit |
wheelManualFrictionControl(Int64, Double)
Set wheel friction control manually, if auto friction control is disabled.
Declaration
public void wheelManualFrictionControl(long partId, double value)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | partId | The part's ID. |
System.Double | value | Range from 0 to 5. |
wheelMotorEnabled(Int64, Boolean)
Enable/Disable wheel traction control.
Declaration
public void wheelMotorEnabled(long partId, bool enabled)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | partId | The part's ID. |
System.Boolean | enabled | True == enabled, false == disabled. |
wheelMotorInverted(Int64, Boolean)
Set a wheel running in reverse direction(roll backwards when the forward key is pressed).
Declaration
public void wheelMotorInverted(long partId, bool inverted)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | partId | The part's ID. |
System.Boolean | inverted | True == inverted, false == normal. |
wheelRetract(Int64)
Deploy a wheel, if the wheel is deployable.
Declaration
public void wheelRetract(long partId)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | partId | The part's ID. |
wheelSteer(String, Double)
Steer the wheels with a throttle rate.
Declaration
public void wheelSteer(string vesselId, double value)
Parameters
Type | Name | Description |
---|---|---|
System.String | vesselId | The controlled vessel's ID. |
System.Double | value | Throttle rate, from -1(steer left) to 1(steer right). |
Remarks
Controling a vessel via API will overwrite related control input from game, for example, SAS. call resetControl(String) to release control, then the vessel can be controlled by game input again.
wheelSteeringEnabled(Int64, Boolean)
Enable/Disable wheel steering.
Declaration
public void wheelSteeringEnabled(long partId, bool enabled)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | partId | The part's ID. |
System.Boolean | enabled |
wheelSteeringInverted(Int64, Boolean)
Set a wheel steering in reverse direction(turn left when the right key is pressed).
Declaration
public void wheelSteeringInverted(long partId, bool inverted)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | partId | The part's ID. |
System.Boolean | inverted | True == inverted, false == normal. |
wheelThrottle(String, Double)
Set wheel motor throttle rate.
Declaration
public void wheelThrottle(string vesselId, double value)
Parameters
Type | Name | Description |
---|---|---|
System.String | vesselId | The controlled vessel's ID. |
System.Double | value | Throttle rate, from -1(move backword) to 1(move forward). |
Remarks
Controling a vessel via API will overwrite related control input from game, for example, SAS. call resetControl(String) to release control, then the vessel can be controlled by game input again.
wheelTractionControl(Int64, Double)
Set wheel traction control.
Declaration
public void wheelTractionControl(long partId, double value)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | partId | The part's ID. |
System.Double | value | Range from 0 to 5. |
wheelTractionControlEnabled(Int64, Boolean)
Enable/Disable wheel traction control.
Declaration
public void wheelTractionControlEnabled(long partId, bool enabled)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | partId | The part's ID. |
System.Boolean | enabled | True == enabled, false == disabled. |
yaw(String, Double)
Yaw a vessel.
Declaration
public void yaw(string vesselId, double value)
Parameters
Type | Name | Description |
---|---|---|
System.String | vesselId | The controlled vessel's ID. |
System.Double | value | Throttle rate, from -1(left) to 1(right). |
Remarks
Controling a vessel via API will overwrite related control input from game, for example, SAS. call resetControl(String) to release control, then the vessel can be controlled by game input again.