Jump to content

martin

Members
  • Posts

    2
  • Joined

  • Last visited

Reputation

0 Neutral

Contact Methods

  • Twitter
    @martindevans

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Aha - I was looking at the attributes, not the parameters. Oops! A reasonable guess, but it doesn't quite encode things correctly. Could you point me to the place within the server that encodes/decodes these values, I'll tear out that code and reuse it myself
  2. I've been fiddling with using kRPC recently, trying to use it from a C# program. I've hit a bit of a brick wall with property getters and setters. For example, the GetServices call tells me this: Vessel_set_Name Class.Property.Set(SpaceCenter.Vessel,Name) ParameterType(0).Class(SpaceCenter.Vessel) So according to this, setting the name doesn't take a name parameter. This seems to be a problem with all property setters, including rather important ones like set throttle! Where do I pass in the parameter to set this property to? Just for reference, here's my current test code: //KRPC.cs internal byte[] RawRequest(string name, string service, params Argument[] args) { Request r = new Request { Procedure = name, Service = service, Arguments = args }; Serializer.SerializeWithLengthPrefix(_rpcStream, r, PrefixStyle.Base128); var response = Serializer.DeserializeWithLengthPrefix<Response>(_rpcStream, PrefixStyle.Base128); if (response.Error != null) throw new RpcException(response.Error); return response.ReturnValue; } //Vessel.cs public string Name { set { Rpc.RawRequest("Vessel_set_Name", "SpaceCenter", Argument.Create(0, this)); // <-- Encoding "this" as an argument simply passes back exactly whatever byte array was received from the server when this proxy object was created } } It looks like this version hasn't made it onto CKAN yet
×
×
  • Create New...