Repository navigation
kRPC v0.7.0
- Web Documentation
- PDF Documentation - available to download from assets
- Forum release thread
- Forum development thread
Client libraries:
Changes
Core
- Server side functions
- Extend
KRPC.Expressionto build server side functions, which the server evaluates (#503, #517, #521, #1124) - Allow a function to declare local variables, loop, branch, assign, return early, raise and handle exceptions, and call a procedure that returns no value (#1124)
- Allow a function to work on strings, nullable values, and lists, sets and dictionaries, including changing them (#1124)
- Add
KRPC.RunFunction, which runs a function once within a single physics tick, andKRPC.CompileFunctionandKRPC.AddFunctionStream(#1124) - Add
KRPC.Expression.StateVariable, a variable that keeps its value between evaluations of a function (#1124) - Add
KRPC.Expression.CallWithArguments,CreateStruct,GetField,IsNull,Negate,Conditional,ConditionalAnd,ConditionalOr, the empty collections and a constant for every type (#1124) - Add
KRPC.Expression.ReturnTypeandHasReturnType(#1124) - Add
KRPC.TypeCodeand theCode,Service,Name,TypesandNullableproperties ofKRPC.Type, which names every type a procedure takes or returns (#1124) - Add the
StdLibservice, of scalar mathematics and vector and quaternion operations, withStdLib.Printfor debugging a function (#1125) - Widen numbers, tuples and collections to a common type in
KRPC.Expression.Invoke,Cast,CreateList,CreateSet,CreateDictionaryandConcat(#1124) - Fix
KRPC.Expression.Counton a returned collection, andOrderByordering strings by the system locale (#1124) - Fix
KRPC.Expression.Equal,NotEqual,Contains,ToSetandCreateSetcomparing objects, tuples, bytes and collections by reference (#1124) - Fix the integer arithmetic of
KRPC.Expressionfor mixed operand types, on overflow and for the smallest integer divided by -1 (#1124) - Breaking: Rename
KRPC.Expression.FunctiontoLambda, and the parameter ofKRPC.AddEventfromexpressiontofunction(#1124) - Breaking: Renumber the procedures of the
KRPCservice, so a client that calls them by id must use stubs generated for this version (#1124) - Breaking: Type
KRPC.Expression.Powerby both operands, require a constant index inGet, limitCreateTupleto seven elements, and reject calls toKRPCprocedures (#1124)
- Extend
- Errors
- Add
KRPC.NullReferenceException,KeyNotFoundException,IndexOutOfRangeException,DivideByZeroException,NotSupportedException,TimeoutExceptionandOverflowException, raised by any service and by a function (#1124) - Add
KRPC.Error, a general error a function can raise (#1124) - Add
KRPC.ObjectDestroyedException, for an object whose game object is gone, andKRPC.ObjectNotLoadedException, for one that is not loaded (#1051, #1120) - Breaking: Throw
KRPC.UnsupportedSceneExceptionfor a procedure called outside its game scenes (#1119)
- Add
- Streams and events
- Breaking: Start a stream when it is added, removing
KRPC.StartStreamand thestartargument ofKRPC.AddStream(#1122) - Breaking: Create a new stream for every
KRPC.AddStream, so removing one leaves the others for the same call (#1122, #902) - Hold a stream or event over an unloaded object, or a procedure unavailable in the game scene, until it is available (#1122, #877)
- Add
KRPC.StreamRemovedException, the final result of a stream the server ends (#1122) - Throw an exception when streaming a procedure that returns a stream or event, and from
KRPC.RemoveStreamfor an unknown stream id (#1122) - Fix a failing stream or event stopping the others, and the server keeping memory for every stream sent on a connection (#1122)
- Breaking: Start a stream when it is added, removing
- Types and protocol
- Breaking: Support null for any nullable type, signaled by an
is_nullfield. Class-typed arguments are not implicitly nullable (#1017) - Breaking: Carry nullability in
Type.nullableat every position, replacingParameter.nullableandProcedure.return_is_nullable(#1091) - Breaking: Return
KRPC.Clientsas a list ofKRPC.ClientInfostructures (#1148) - Allow a structure field, list element, tuple item and dictionary value to be nullable, declared with
Nullable<T>orKRPCNullable(#1091) - Add structure types, a compound value with named fields, declared with
KRPCStructon a C#struct(#1066) - Add
StdLib.ColorRGBandStdLib.ColorRGBA, the colors of the SpaceCenter, Drawing and UI services (#1148) - Add extension members, which a service declares on another service's class as C# extension methods (#1077)
- Add a communication protocol over a unix domain socket, for clients on the same machine as the game (#1065)
- Fix a serial connection freezing the game while it carries an RPC (#1035)
- Add a protocol version to the connection handshake, sent over WebSockets as the subprotocol
krpc.Nand reported byKRPC.GetStatus(#1162) - Fix an exception on a serial connection request that carries no
ConnectionRequest(#1162) - Encode and decode values without reflection, cutting the server cost of a call that passes or returns an object by about three quarters (#1091)
- Breaking: Support null for any nullable type, signaled by an
- Game state
- Breaking: Remove
KRPC.CurrentGameScene, replaced byKRPC.GameScene(#1140) - Add
KRPC.HoldTick,KRPC.ReleaseTickandKRPC.NextTick, which hold the game on one physics tick so a control loop can read, compute and write within it (#1070) - Add
KRPC.GameStateLoads, the number of game states that have finished loading (#1121) - Remove objects whose game objects are gone from the object store when a game state loads (#1051)
- Fix one server stopping emptying the object store that every server shares (#1020)
- Fix a request naming an object the server no longer has leaving the connection stuck (#1019)
- Breaking: Remove
Server
- Breaking: KSP 1.12.5 is the minimum supported version, matching the maximum (#1048)
- Add the local socket protocol to the server window. It opens no network port (#1065)
- Add the
TickHoldTimeoutsetting, which bounds how long a client may hold the game on one physics tick (#1070) - Update the server before the game collects control inputs, so a control input takes effect on the tick of its call (#1070)
- Stop the server whenever no game is loaded, disconnecting clients when the player quits to the main menu (#1041)
- Save the game when setting
KRPC.GameSceneleaves flight, unless the game cannot be saved (#1117) - Remove objects whose game objects are gone from the object store when the game loads, changes scene or destroys a part or vessel (#1051)
- Fix setting
KRPC.GameScenefrom one editor to the other, or back to flight, breaking the flight camera or failing with a null reference (#1038, #1117) - Fix the error from a call that waits on the game being reported as
Exception has been thrown by the target of an invocation(#1083) - Fix the end of a long serial port name being hidden in the server window (#1065)
SpaceCenter service
- Object lifetime
- Look up the game object behind a vessel, crew member, part, part module, orbit, alarm, contract, waypoint or communication link on every call, so it keeps working across a quickload (#1051, #764, #885)
- Raise
KRPC.ObjectDestroyedExceptionfor an object whose game object is gone, andKRPC.ObjectNotLoadedExceptionfor a part of an unloaded vessel (#1051, #885) - Renaming a kerbal destroys its objects, and loading a game replaces a vessel's maneuver nodes (#1051)
- Fix decoupler, maneuver node and force objects accumulating for the rest of the session (#1051, #771)
- Add
Orbit.Remove,ReferenceFrame.RemoveandResourceTransfer.Remove, which free the memory the server holds for an object (#1072) - Breaking: Return a new frame from each call to
ReferenceFrame.CreateRelativeandCreateHybrid, owned by the calling client (#1072) - Throw an exception from
ReferenceFrame.CreateRelativeandCreateHybridwhen given no frame (#1072)
- Structures
- Breaking: Return the available torque, force and acceleration members of
Vessel,ReactionWheel,ControlSurface,EngineandRCSasAxisRangestructures (#1148) - Breaking: Return
Vessel.BoundingBox,Part.BoundingBox,Flight.SimulateAerodynamicWrenchAtandRoboticController.AxesasBoundingBox,WrenchandRoboticAxisstructures (#1148) - Breaking: Return and set
Part.HighlightColorandLight.ColorasStdLib.ColorRGBstructures (#1148) - Breaking: Make
LaunchSite,ScienceSubject,ScienceData,ActionGroupActionandCommNodestructures (#1148, #1132) - Breaking: Replace
CareerLogFlights,CareerLogTypesandCareerLogTargetswithCrewMember.CareerLog, a list ofFlightLogEntrystructures (#1148) - Add
ScienceSubject.Id(#1148)
- Breaking: Return the available torque, force and acceleration members of
- Space center
- Breaking: Make the
crewparameter ofSpaceCenter.LaunchVesseloptional and exact.nulluses the craft's default crew, an empty list none, and a list seats the named Kerbals in order (#1017) - Breaking: Remove
SpaceCenter.LoadSpaceCenter, replaced by settingKRPC.GameScene(#1140) - Add
SpaceCenter.CanSave, whether the game can be saved (#1117) - Return from
SpaceCenter.RevertToLaunchonce the scene has reloaded, asSpaceCenter.Loaddoes (#1097) - Allow the time warp RPCs, apart from
PhysicsWarpFactor, in the space center and tracking station (#1145) - Throw an exception from
SpaceCenter.WarpToif the game scene changes during the warp (#1145) - Fix
SpaceCenter.MaximumRailsWarpFactorreturning 0 when only warp factor 1 is allowed (#1145) - Fix setting
SpaceCenter.ActiveVesselfrom the space center or tracking station clearing the game's contracts (#1102) - Fix the offset of an apoapsis, periapsis, SOI or maneuver node alarm, and
Alarm.EventOffset, leaving the alarm time unchanged (#1114) - Fix many stages, vessel resources, communication links, resource converters or hybrid reference frames slowing the server down (#1071)
- Breaking: Make the
- Editor
- Add
SpaceCenter.Editor, for the vessel under construction in the vehicle assembly building and space plane hangar, withEditor.LoadVesselandEditor.LaunchVessel(#1038) - Add
EditorVessel.Parts,Resources,Stages,StageAt,DecoupleStagesandDecoupleStageAt, with the figures they give in flight (#1038) - Add
EditorVessel.DeltaV,VacuumDeltaV,SeaLevelDeltaV,BurnTimeandDeltaVReady, for a situation set withEditor.DeltaVBody,DeltaVAltitudeandDeltaVSituation(#1038) - Add
EditorVessel.Position,MomentOfInertia,InertiaTensor,ReferenceFrame,SurfaceReferenceFrame,BoundingBox,RotationandDirection, as onVessel(#1059, #1153) - Make the position, orientation, mass and inertia members of
Partavailable in the editor (#1059, #1064, #1153) - Add
EditorVessel.Flight, aSimulatedFlightfor the vessel in a simulated attitude (#1153)
- Add
- Vessels and crew
- Add
Vessel.Terminate, which removes a vessel without recovering it (#1034) - Recover a vessel other than the active one with
Vessel.Recoverwithout switching to the space center, and close the mission completion dialog (#1021) - Add
Vessel.OrbitSpeedReferenceFrame,SurfaceSpeedReferenceFrameandTargetSpeedReferenceFrame, one per navball speed mode (#1029) - Restrict
Vessel.InertiaTensorto flight, asVessel.MomentOfInertiais (#1059)
- Add
- EVA
- Add
CrewMember.EVA, which sends a Kerbal out through the hatch and returns its vessel (#319) - Drive a Kerbal on EVA with
Vessel.Control. The translation inputs walk and fly the jetpack,Control.RCSdeploys it, andControl.Lightsswitches the helmet lamp (#319) - Add
Control.Board,Airlock,GrabLadder,ReleaseLadderandLadder, for a Kerbal on EVA (#319)
- Add
- Staging
- Breaking: Remove
Parts.InStage,Parts.InDecoupleStageandVessel.ResourcesInDecoupleStage, replaced byVessel.StageAtandVessel.DecoupleStageAt(#1140) - Calculate the delta-v figures of
VesselandStagewithout the game's delta-v app open (#1076) - Add
Vessel.RecalculateDeltaVandVessel.DeltaVReady(#1076) - Fix stages breaking after a revert to launch (#1023)
- Document that the
Stagemass figures include all later stages (#1112)
- Breaking: Remove
- Autopilot
- Keep the target roll when setting
AutoPilot.TargetDirection(#1054) - Fly a target set during a tick on that tick, at the point in the update that
AutoPilot.UpdateModechooses (#1070) - Fix an engaged auto-pilot failing on every physics tick once the object its reference frame is defined against is gone (#1070)
- Keep the target roll when setting
- Orbits and bodies
- Breaking: Fix
CelestialBody.BiomeAttreating its latitude and longitude as radians. It takes degrees, as documented (#1099) - Breaking: Take a universal time
utinOrbit.OrbitalSpeedAt, and deprecate it in favor ofOrbit.SpeedAt(#1086) - Breaking: Remove
Orbit.TimeOfClosestApproach,DistanceAtClosestApproachandListClosestApproaches, replaced byOrbit.NextClosestApproachandOrbit.ClosestApproaches(#1140) - Breaking: Follow the two orbits in a
ClosestApproachas the game runs, and return the same object for the same approach (#1072) - Deprecated:
Orbit.OrbitalSpeedandOrbit.OrbitalEnergy, superseded byOrbit.SpeedandOrbit.SpecificEnergy, and fixOrbitalSpeedreporting a stale value (#1086) - Add
Orbit.CreateFromPositionAndVelocityandOrbit.CreateFromOrbitalElements, for an orbit with no object in the game (#1046) - Add
Orbit.Position,Velocity,Altitude,MeanMotion,SemiLatusRectum,SpecificAngularMomentum,SpecificEnergy,ReferenceFrameandOrbitalReferenceFrame(#1046, #1086, #1087) - Add
Orbit.VelocityAt,SpeedAt,PositionAtTrueAnomaly,VelocityAtTrueAnomaly,SpeedAtTrueAnomalyandSpeedAtRadius, and a reference frame toOrbit.PositionAt(#1046, #1086, #1087) - Document
Orbit.Epochas the universal time of the mean anomaly at epoch (#1046) - Add
CelestialBody.SurfaceNormal,BedrockNormalandMSLNormal, andFlight.SurfaceNormal, the slope of the terrain (#1030) - Add
CelestialBody.SurfaceReferenceFrame, fixed to the surface at a latitude and longitude (#1116) - Fix
ClosestApproach.VelocityandTargetVelocitybeing offset by the velocity of the reference body's frame (#1047)
- Breaking: Fix
- Flight and aerodynamics
- Add
Flight.SideForce, the aerodynamic force across the air stream (#1032) - Fix
Flight.LiftandLiftAccelerationbeing scaled by the cosine squared of the sideslip angle (#1032) - Fix
Flight.StallFractionreturningNaNfor a vessel with no lifting surfaces (#1032) - Fix
Flight.AerodynamicForce,AerodynamicAcceleration,AerodynamicTorqueand theFlight.Simulatemethods with Ferram Aerospace Research installed (#1032)
- Add
- Buoyancy
- Add the buoyancy of boats and submarines to
Flight, such asDisplacement,CenterOfBuoyancy,BuoyantForce,DepthandBuoyantForceAt(#1103) - Add the buoyancy of a part to
Part, such asSplashed,Displacement,BuoyantForce,SubmergedPortionand the water drag multipliers (#1103) - Add
SimulatedFlight.Displacement,FullySubmergedCenterOfBuoyancy,BuoyantForceAtandBuoyantTorqueAt, for trimming a hull before launch (#1103) - Add
CelestialBody.HasOcean,CelestialBody.OceanDensity,SpaceCenter.BuoyancyScalar,Part.StaticPressureandPart.MaxPressure(#1103) - Fix
Flight.StaticPressureandCelestialBody.PressureAtleaving out the water pressure below sea level (#1103)
- Add the buoyancy of boats and submarines to
- Control and communications
- Breaking: Return
nullfromParts.Controllingwhen the vessel has no control point (#1043) - Breaking: Return
nullfromCommNode.Vesselfor a node that is not a vessel (#1132) - Take
Control.StateandControl.Sourcefrom the control level KSP gates a vessel's control on (#1043) - Report no control and no communications from
ControlandCommsfor a vessel outside the communication network (#1043) - Add
Control.PrecisionMode(#1082) - Keep the Alt+L shortcut in step with
Control.StageLock(#1022) - Fix control inputs being applied twice each tick with a RemoteTech flight computer, and apply
Control.Throttleregardless of signal delay (#1093)
- Breaking: Return
- Engines and RCS
- Breaking: Thrust
RCS.TranslationOverridealong the right, up and forward axes it documents (#1080) - Add
RCS.Force,RCS.Torque,RCS.OverrideWrenchandThruster.Thrust(#1080) - Account for precision mode in the available force and torque of
RCSandVessel, keeping a block driven byRCS.InputOverrideat full thrust (#1082) - Count only the nozzles of an RCS part's selected variant (#1079)
- Fix
Engine.ThrustersandRCS.Thrusterson a part with both modules, and after a multi-mode engine switches mode (#1096) - Fix
ReactionWheel.AvailableTorquebeing scaled by the square of the authority limiter with KSPCommunityFixes installed (#1042) - Add support for RealFuels, with ignition, ullage and feed pressure members on
Engineand boil-off onPart(#1039)
- Breaking: Thrust
- Parts
- Breaking: Remove kRPC's own name tag part module.
Part.Tagneeds KSPCommunityPartModules 0.5 or later, or kOS, to provide one (#1155) - Breaking: Remove the string-dictionary
Modulemembers, replaced byModule.FieldList,Module.EventListandModule.ActionList(#1140) - Deprecated:
Part.AddForceandPart.InstantaneousForce, superseded byDebug.AddForceandDebug.InstantaneousForce(#1146) - Warn in game when a save or craft has name tags the installed mods cannot load (#1155)
- Add
ControlSurface.DeployAngle,MinDeployAngleandMaxDeployAngle(#1088) - Fix
ControlSurface.DeflectionOverrideleaving the deploy angle set when released, and throw an exception from settingDeployedduring an override (#1088) - Measure only a part's own meshes in
Part.BoundingBoxandVessel.BoundingBox, with animated meshes in their current pose (#1024, #1153) - Fix computing a bounding box duplicating the meshes of every part it measures (#1024)
- Fix
Decoupler.IsOmniDecouplerbeing false for every decoupler (#1048) - Return the separated vessel from
Decoupler.Decouplefor an omni-decoupler such as a stack separator (#1043) - Make
ModuleRefpublic, for a mod that exposes a part module in its own service (#1077)
- Breaking: Remove kRPC's own name tag part module.
- Resources and camera
- Add
ResourceTransfer.Cancel(#1028) - Fix a resource transfer never completing once one of its parts is destroyed (#1051)
- Move the IVA view between crew with
Camera.NextCameraandCamera.PreviousCamera(#1031) - Return
nullfromCamera.FocussedCrewMemberwhen no crew member is in view (#1031) - Fix setting
Camera.FocussedCrewMemberto the crew member in view switching to the flight camera (#1031)
- Add
Drawing service
- Breaking: Return and set colors as a
StdLib.ColorRGBstructure, in place of a tuple (#1148) - Breaking: Removing a drawing object another client created, or one the server no longer holds, reports that it is not among those this client created (#1072)
- Add
Drawing.AddPolyline,AddCircle,AddArc,AddBox,AddSphere,AddPoint,AddAxesandAddOrbit(#1116) - Add
StartArrow,EndArrow,ArrowSize,Colors,DashedandLabelto lines, polygons and paths, andText.FaceCamera(#1116) - Add
Drawing.AddMapMarker, which draws one of the game's map icons in the map view, andDrawing.AddImagefor custom marker images (#1116) - Add
Drawing.AddNavballMarker, which draws a marker on the navball pointing in a given direction (#1037) - Draw lines, polygons and text in the map view, the editor and the tracking station (#1115)
- Raise
KRPC.ObjectDestroyedExceptionfrom a drawing object once the object it draws is gone, and skip drawing one whose reference frame is gone (#1051)
User Interface service
- Breaking changes
- Breaking: Return and set colors as a
StdLib.ColorRGBAstructure with an alpha component, forText.Colorand the color of aUI.Message(#1040, #1148) - Breaking: Draw user interface elements with the game's own skin, so
Textstarts out with the game's size and color (#1040) - Breaking: Make
Visiblethe element's own setting. An element is drawn when everything it is inside is visible too (#1040) - Breaking: Set
InputField.Changedonly when the user types in the field (#1040) - Breaking: Removing an element another client created, or one the server no longer holds, reports that it is not among those this client created (#1072)
- Breaking: Return and set colors as a
- Elements
- Add
Toggle, a check box, andToggleGroup, which makes a set of toggles behave as radio buttons (#1040) - Add
Slider, horizontal or vertical, andDropdown(#1040) - Add
Image, showing a PNG or JPEG file, a plain colored rectangle, or raw pixels fromImage.SetPixelsandImage.UpdatePixels(#1040) - Add
ScrollView, a view onto a panel larger than the space available for it (#1040) - Add
Layoutto arrange the contents of aPanelin a row, column or grid, withLayoutElementandPanel.SizeFitterfor sizing (#1040)
- Add
- Properties and behavior
- Create user interface elements in every game scene, and remove them when the scene changes (#1040)
- Add
Interactable,ColorandTooltipto every control (#1040) - Add
Panel.Style,Panel.Color,Panel.DraggableandPanel.BringToFront, to use a panel as a movable window (#1040) - Add
InputField.Placeholder,ContentType,CharacterLimitandReadOnly(#1040) - Add
Button.Pressed, true while the user holds the button down, andText.WordWrap(#1040) - Scale a canvas added with
UI.AddCanvasby the player's interface scale, as the stock canvas is (#1040) - Compare two user interface objects for the same element equal (#1040)
- Raise
KRPC.ObjectDestroyedExceptionfrom a user interface object,RectTransform,Layout,LayoutElementorSizeFitteronce its element is gone (#1051) - Fix
Text.Fontcreating a font on every set and leaking it (#1040) - Fix
RectTransformobjects accumulating for the rest of the session (#1051)
InfernalRobotics service
- Look up a servo and a servo group on every call, so they keep working across a quickload and raise
KRPC.ObjectDestroyedExceptiononce their part or vessel is gone (#1051) - Renaming a servo group destroys its objects, which must be obtained again under the new name (#1051)
- Fix
ServoandServoGroupobjects accumulating for the rest of the session, and comparing unequal for the same servo or group (#1051) - Return the vessel the group was obtained for from
ServoGroup.Vessel(#1051) - Fix a servo being listed more than once in a
ServoGroupafter switching to and from its vessel (#1154)
KerbalAlarmClock service
- An alarm keeps working across a quickload, and raises
KRPC.ObjectDestroyedExceptiononce the mod no longer has an alarm with its id (#1051)
RemoteTech service
- An
Antennawhose part is destroyed, or that is no longer an antenna, and aCommswhose vessel is gone, raiseKRPC.ObjectDestroyedException(#1051)
LIDAR service
- Breaking: Rename the service from
LiDARtoLIDAR(#1149) - A
Laserwhose part is destroyed, or that is no longer a laser, raisesKRPC.ObjectDestroyedException(#1051)
DockingCamera service
- A
Camerawhose part is destroyed, or that is no longer a camera, raisesKRPC.ObjectDestroyedException(#1051)
C-nano client
- Breaking: Support null for any nullable type. A nullable non-class return adds a
bool* returnValueIsNullout-parameter, and a nullable argument is a pointer (#1017) - Breaking: Renumber the
KRPCservice's procedures, so a program built against an earlier version must be rebuilt (#1124) - Breaking: Rename
dockingcamera.htodocking_camera.h(#1149) - Breaking: Send protocol version 1 when connecting, and fail to connect to a server from before 0.7 (#1162)
- Support structure types, as a C struct with a member per field, and nullable structure fields and collection elements, as the value beside a
boolpresence flag (#1066, #1091) - Add
KRPC_COMMUNICATION_TCPandKRPC_COMMUNICATION_LOCALSOCKET, withtcpandlocalsocketvcpkg features, to communicate over TCP/IP or a unix domain socket (#1055, #1065) - Add
KRPC_SINGLE_CONNECTION, for aKRPC_COMMUNICATION_CUSTOMmechanism that opens its own connection to each server (#1055) - Reduce a remote procedure call from tens of reads and writes to one write and two reads (#1056)
- Add
KRPC_BUFFER_SIZE, how much of a message to hold in memory while it is sent or received, 1024 bytes by default and 128 on Arduino (#1056) - Include the header of every service a service header uses, so service headers can be included in any order (#1150)
- Update to protobuf v36.2 and nanopb 0.4.9.2 (#1139)
C# client
- Streams and events
- Breaking: Start a stream when it is added, removing
Stream.StartandEvent.Start(#1122) - Breaking: Return
truefromStream.WaitandEvent.Waiton an update, andfalseon a timeout (#1122) - Breaking: Add an
IConnection.Invokeoverload taking the return type, which a class implementingIConnectionmust provide (#1122) - Wait for a stream's first value in
Stream.Get(#1122) - End a stream on an error from the server, and every stream with
ConnectionExceptionwhen the connection closes or fails (#1122) - Throw
InvalidOperationExceptionwhen reading or waiting on a removed stream or event, and fromAddStreamon a connection with no stream server (#1122) - Add
AddEndCallbackto streams and events, called with the exception that ends the stream (#1122) - Call a callback added to a stream or event straight away for a value or firing already received (#1122)
- Fix
Event.Waitmissing an earlier firing, and waking only one of two waiting threads (#1122) - Fix the stream update thread ending the process on a value it cannot decode or a message it cannot parse (#1122)
- Fix a second removal of a stream removing a newer stream for the same call, and stream callbacks throwing
InvalidCastExceptionon an error from the server (#1122)
- Breaking: Start a stream when it is added, removing
- Server side functions
- Add
Connection.Compile, which compiles a lambda into a server side function (#1128) - Compile operators, conditionals, casts,
System.Math, string operations, collection, tuple and structure constructors,Console.WriteLineand the common LINQ operators (#1128) - Throw
FunctionCompilationExceptionnaming a construct a lambda cannot contain, including a call that depends on the current culture (#1128) - Add
Connection.RunandConnection.AddEvent, and aConnection.AddStream<T>overload taking a server side function (#1128) - Breaking: Compile a lambda given to
AddStream, so the remote calls in its arguments are evaluated on every update (#1128) - Breaking: Replace
RemoteObject.idwithRemoteObject.GetObjectId, which returns the id of a remote object forExpression.ConstantObject(#1160)
- Add
- Types and errors
- Breaking: Throw the matching .NET exception, such as
NullReferenceException,KeyNotFoundExceptionorTimeoutException, for an error reported by any service, in place ofRPCException(#1124) - Breaking: Support
nullfor any nullable type, including a structure field, list element, tuple item and dictionary value. Value types use the nullable form (int?) (#1017, #1091) - Throw
InvalidOperationExceptionfromStream.Getfor a null value the stream's type cannot hold (#1128) - Support structure types, generated as a
structwith a constructor, equality and ordering over its fields (#1066) - Fix an
ArgumentExceptionfrom the server carrying its message as the parameter name (#1111)
- Breaking: Throw the matching .NET exception, such as
- Connections
- Breaking: Send protocol version 1 when connecting, and fail to connect to a server from before 0.7 (#1162)
- Add
Connection.ConnectLocal, which connects to a server on the same machine over a unix domain socket (#1065) - Add a
timeoutparameter to theConnectionconstructor, bounding how long a connection is waited for (#1065) - Reduce the cost of a remote procedure call, most for one that returns a collection or an object (#1056)
- Update to Google.Protobuf 3.36.2 (#1139)
C++ client
- Streams and events
- Breaking: Start a stream when it is added, removing
Stream::startandEvent::start(#1122) - Breaking: Remove
Client::freeze_streamsandClient::thaw_streams. Calls made while holding the tick withKRPC::hold_tickgive values from one physics tick (#1118) - Breaking: Return a
krpc::Conditionfrom theget_conditionmethods andClient::get_stream_update_condition, locked with akrpc::RecursiveMutex(#1122) - Return
truefromStream::waitandEvent::waiton an update, andfalseon a timeout (#1122) - Wait for a stream's first value when reading it (#1122)
- End a stream on an error from the server, and every stream with
krpc::ConnectionErrorwhen the connection closes or fails (#1122) - Throw
krpc::StreamErrorwhen reading or waiting on a removed stream or event, or on a client with no stream connection (#1122, #1109) - Add
add_end_callbackto streams and events, called with the exception that ends the stream (#1122) - Call a callback added to a stream or event straight away for a value or firing already received (#1122)
- Fix
Event::waitmissing an earlier firing, and a thread waiting on a stream staying blocked when the stream is removed (#1122, #1090) - Fix the stream update thread spinning after the server closes the connection, and ending the process on a bad message or a throwing callback (#1122)
- Fix data races between a stream update and reading the value or changing the callbacks (#1090, #1108)
- Fix use of freed memory by streams and callbacks once the client, stream or event they came from is moved or destroyed (#1122)
- Fix two copies of a stream sharing one condition lock, a removed stream returning its last value, and a second removal removing a newer stream (#1122, #1090)
- Breaking: Start a stream when it is added, removing
- Server side functions
- Add
krpc::run, which runs a server side function within a single physics tick and returns its value (#1129) - Add
krpc::add_streamandkrpc::add_event, which stream a server side function and create an event from one (#1129) - Add
krpc::get_object_id, which returns the id of a remote object forExpression::constant_object(#1160)
- Add
- Types
- Breaking: Support null for any nullable type, held as
std::optional, including a structure field, list element, tuple item and dictionary value (#1017, #1091) - Support structure types, generated as a
structwith a constructor, equality, ordering and astd::hashover its fields (#1066) - Add
krpc::hash_valueandkrpc::hash, which hash any type the client carries, so a tuple or a collection can key an unordered container (#1067) - Include the header of every service a service header uses, so service headers can be included in any order (#1150)
- Fix a stream of an enumeration or structure, and a procedure with a collection of enumerations, failing to compile (#1094, #1044)
- Breaking: Support null for any nullable type, held as
- Connections
- Breaking: Send protocol version 1 when connecting, and fail to connect to a server from before 0.7 (#1162)
- Add
krpc::connect_local, which connects to a server on the same machine over a unix domain socket (#1065) - Add a
timeoutparameter tokrpc::connect, bounding how long a connection is waited for (#1065) - Fix
krpc::Connection::closefailing to link (#1065) - Reduce the cost of a remote procedure call, most for one that carries a collection (#1056)
- Update to protobuf v36.2 and ASIO 1.38.2 (#1139)
Java client
- Streams and events
- Breaking: Start a stream when it is added, removing
Stream.start,Stream.startAndWaitandEvent.start(#1122) - Breaking: Return
truefromStream.waitForUpdateWithTimeoutandEvent.waitForWithTimeouton an update, andfalseon a timeout (#1122) - Wait for a stream's first value in
Stream.get(#1122) - End a stream on an error from the server, and every stream with a
StreamExceptionwhen the connection closes or fails (#1122) - Throw
StreamExceptionwhen reading or waiting on a removed stream or event (#1122) - Add
addEndCallbackto streams and events, called with the exception that ends the stream (#1122) - Call a callback added to a stream or event straight away for a value or firing already received (#1122)
- Fix
Event.waitFormissing an earlier firing, and waking only one of two waiting threads (#1122) - Fix the stream update thread stopping on a value it cannot decode (#1122)
- Fix a second removal of a stream removing a newer stream for the same call, and an error ending a stream throwing
ClassCastExceptionin its callbacks (#1122)
- Breaking: Start a stream when it is added, removing
- Server side functions
- Types and errors
- Breaking: Throw the matching Java exception, such as
NullPointerException,NoSuchElementExceptionorArithmeticException, for an error reported by any service, in place ofRPCException(#1124) - Breaking: Support
nullfor any nullable type, including a structure field, list element, tuple item and dictionary value. Primitives use the boxed type (Integer, ...) (#1017, #1091) - Support structure types, generated as a class with a constructor, getters,
equals,hashCodeandComparableover its fields (#1066)
- Breaking: Throw the matching Java exception, such as
- Connections
- Breaking: Send protocol version 1 when connecting, and fail to connect to a server from before 0.7 (#1162)
- Breaking: Require Java 17 or later, for unix domain sockets (#1065)
- Add
Connection.newLocalInstance, which connects to a server on the same machine over a unix domain socket (#1065) - Add
Connection.newInstanceoverloads taking atimeout, bounding how long a connection is waited for (#1065) - Update to protobuf-java 4.36.2 (#1139)
Lua client
- Breaking: Support
Types.nonefor any nullable type, including a structure field, list element, tuple item and dictionary value (#1017, #1091) - Breaking: Return messages, such as the server status, as plain tables (#1142)
- Breaking: Rename
conn.li_dartoconn.lidar, for theLIDARservice (#1149) - Breaking: Send protocol version 1 when connecting, and fail to connect to a server from before 0.7 (#1162)
- Support Lua 5.3 and 5.4, where 64-bit values decode to exact integers (#1142)
- Depend on
lua-protobufin place ofprotobuf, and require luasocket 3.0 or later (#1142, #1060) - Add
krpc.connect_local, which connects to a server on the same machine over a unix domain socket, on Linux and macOS (#1065) - Support structure types, built from their field values in order with named access (#1066)
- Skip a service member naming an unknown type with a warning, and connect (#1066)
- Add
krpc.limits, the extremes of the numeric types kRPC carries, such askrpc.limits.SINT32_MAX(#1045) - Add
krpc.get_object_id, which returns the id of a remote object forExpression.constant_object(#1160) - Reduce the cost of a remote procedure call (#1056)
- Fix a service failing to load when a default value names an enumeration of a service not yet loaded (#1044)
- Fix a type occasionally being built twice, leaving an enumeration or class type unusable (#1068)
- Fix the client assigning global variables, such as
dataandtyp(#1142)
Python client
- Streams and events
- Breaking: Start a stream when it is added, removing
Stream.startandEvent.start(#1122) - Return
TruefromStream.waitandEvent.waiton an update, andFalseon a timeout (#1122) - End a stream on an error from the server, and every stream with
ConnectionErrorwhen the connection closes or fails (#1122, #315) - Raise
StreamErrorwhen reading or waiting on a removed stream or event (#1122) - Add
add_end_callbackto streams and events, called with the exception that ends the stream (#1122) - Call a callback added to a stream or event straight away for a value or firing already received (#1122)
- Fix
Event.waitmissing an earlier firing, and waking only one of two waiting threads (#1122) - Fix the stream update thread stopping on a value it cannot decode (#1122, #198)
- Fix a second removal of a stream removing a newer stream for the same call, and an error ending an event calling its callbacks (#1122)
- Breaking: Start a stream when it is added, removing
- Server side functions
- Add
Client.compile, which compiles a Python function or lambda into a server side function (#1127) - Compile operators, comprehensions, f-strings, slices,
print, a subset of the builtins and themathmodule, and the statements of a function body (#1127) - Compile a captured
nonlocalvariable to a state variable, which keeps its value between runs (#1127) - Raise
FunctionCompilationErrornaming an unsupported construct (#1127) - Add
Client.runandClient.add_event, and stream a function withClient.add_streamandClient.stream(#1127) - Add
krpc.get_object_id, which returns the id of a remote object forExpression.constant_object(#1160)
- Add
- Types and errors
- Breaking: Raise the matching built-in exception, such as
TypeError,KeyError,IndexErrororTimeoutError, for an error reported by any service, in place ofRPCError(#1124) - Breaking: Support
Nonefor any nullable type, including a structure field, list element, tuple item and dictionary value (#1017, #1091) - Breaking: Rename the
LiDARservice class toLIDAR, andconn.li_dartoconn.lidarin a client without stubs (#1149) - Support structure types as named tuples, accepting a tuple or list with one element per field (#1066)
- Skip a service member naming an unknown type with a warning, and connect (#1066)
- Add the class members only the server declares to a service with pre-generated stubs (#1077)
- Escape an enumeration member named after a keyword in a dynamically created service, such as
Classtoclass_, as the stubs do (#1094) - Add
krpc.limits, the extremes of the numeric types kRPC carries, such askrpc.limits.SINT32_MAX(#1045) - Fix a service failing to load when a default value names an enumeration of a service not yet loaded (#1044)
- Fix type checkers skipping code after a name the service defines, typing a stream value as
object, and rejectingstream_port=None(#1134)
- Breaking: Raise the matching built-in exception, such as
- Connections
- Breaking: Send protocol version 1 when connecting, and fail to connect to a server from before 0.7 (#1162)
- Add
krpc.connect_local, which connects to a server on the same machine over a unix domain socket (#1065) - Add a
timeoutparameter tokrpc.connect, bounding how long a connection is waited for (#1065) - Reduce the cost of a remote procedure call (#1056)
- Require protobuf 7.36.2 or later (#1139)
krpctools
- Breaking: Require
--includeinkrpc-clientgenfor each service whose types a C++ or C nano service uses, giving the path of its header (#1150) - Breaking: Generate C# and C++ stubs that mark the calls returning a stream or an event, which need a v0.7.0 client (#1122)
- Breaking: Construct a generator module given to
krpc-clientgenby path with the definitions of every loaded service (#1044) - Breaking: Run
krpc-servicedefsandTestServeron the .NET 10 runtime, in place of .NET 8 (#1139) - Generate and document the structure types and nullable values a service defines, for every client (#1066, #1017, #1091)
- Read the definitions of several services in
krpc-clientgen, from JSON files alongside DLLs (#1148) - Generate python stubs that declare a service's classes, enumerations, structures and exceptions for type checkers (#1134)
- Allow NaN, the infinities and the numeric extremes as parameter default values, named as the target language names them (#1045)
- Generate an enumeration default value as the member it names, and report an undeclared one with its service, procedure and parameter (#1044)
- Fix default values containing an enumeration failing to generate, and Lua and C++ documentation writing default values in the wrong syntax (#1044)
- Fix a 32-bit float default value being written in full, so
0.1fread as0.10000000149011612(#1045) - Fix the escaping of member names that are keywords in the generated Python, C++ and Java code and documentation (#1094)
- Fix the python stubs for a service that names a type the KRPC service defines failing to import, and its exception types naming no service (#1094)
- Fix
krpc-clientgenfailing to load a generator from a file (#1134)