Jump to content

[1.8.x to 1.12.x] kRPC: Remote Procedure Call Server (v0.5.1, 2nd March 2023)


djungelorm

Recommended Posts

big thx dj, worked perfectly even on the slower machine and local/remote control.

and thx for changing the kRPC server for automatic start and memorizing the entered ip for the session, makes life easier.

:)

Link to comment
Share on other sites

Cool, glad that solved the issue.

But I added the "auto-start" behaviour by accident! I was using it for testing, and plan to add it as a configuration option, but I don't think that should be the default behaviour.

:)

for development purposes autostart & ip/port remembering and !!! no allow/deny questions :P is fine but sure in final kRPC this should be configurable and have a secure default.

i guess a whitelist of hosts that are allowed to connect & autostart would be the way to go.

Link to comment
Share on other sites

Risking to re-ignite the security discussion, I don't think any harm could come from auto-launching a server that listens on localhost, or alternatively auto-accepting all connections from localhost, or even both.

Link to comment
Share on other sites

small bug (at least in linux):

when entering an ip address into the kRPC Server dialog "." accelerates time too, i guess numbers will run action groups if defined.

wouldnt it be better to show a list of the machines ip addresses to choose from ?

Link to comment
Share on other sites

small bug (at least in linux):

when entering an ip address into the kRPC Server dialog "." accelerates time too, i guess numbers will run action groups if defined.

Yes, it triggers action groups too. I think this is a bug with stock KSP on linux. Other mods (e.g. MechJeb) suffer from the same problem, at least last time I checked. If the issue still exists when 0.24 is released, I'll see if I can find a workaround for it.

http://bugs.kerbalspaceprogram.com/issues/1230

wouldnt it be better to show a list of the machines ip addresses to choose from ?

Nice idea! Would "fix" the "." bug too. Although typing port numbers would still be problematic.

Edited by djungelorm
Link to comment
Share on other sites

Hello! I'm sorry if I'm missing some instructions in a text file somewhere, but I can not seem to get everything installed correctly, despite several hours of work. My system is running Windows 7. I have the mod downloaded and the Gamedata is in its proper location. My troubles have begun, however, when I attempted to install the protobuf package for python that the kRPC python client package requires. Again, I hope I have not overlooked a more clear set of install instructions, but I can not seem to figure out how to install this package from Google. Any help would be greatly appreciated!

Link to comment
Share on other sites

The easiest way to install Google's protobuf is using pip. On windows you can do this as follows:

  • Install pip by following these instructions: http://www.pip-installer.org/en/latest/installing.html
  • Run:
    pip.exe install protobuf


    Note that this requires your python scripts directory (which is where pip.exe is installed) to be in your PATH. For example, I had to add C:\Python27\Scripts to my PATH environment variable.

Hope that helps!

Link to comment
Share on other sites

It definitely did, I'm one step closer to getting Pip to work. Unfortunatly, running Pip garners no response :/. The command line shows for a brief moment that it is running pip.exe, but it quickly halts. Any thoughts? I'm running a fresh install of Python 2.7.6 and just installed Pip as that page instructed.

Link to comment
Share on other sites

Odd. Maybe it's timing out when trying to connect to the internet? Are you behind a proxy?

You could also trying running pip with verbose output to see if that gives any helpful error messages:

pip.exe -vvv install protobuf

Link to comment
Share on other sites

No dice :/ are there other module installers that might function similarly? Or am I doomed to trying to install protobuf manually?

Edit: RESOLVED :D

Turns out protobuf wasn't too difficult to manually install this time. Maybe i shouldn't try to do these things late at night while I'm hungry? :P

Edit II: I'm having terrible luck with this.

Everything got installed and seemed to be functioning properly, however the in-game server does not seem to be discovering my client's attempt to connect.

Ksp view: http://imgur.com/V6QNv6H

Python Shell: http://imgur.com/B52ivY6

Am I missing something?

Edited by Pixelator
Link to comment
Share on other sites

Looks like there are some bugs on windows *sigh*. I get the same issue, and also clicking stop server crashes ksp.

However, this is not that suprising as I've been doing all the testing on Linux. I'll let you know when I get it working on windows.

Link to comment
Share on other sites

  • 3 weeks later...

No not all, it's anything but dead! I've been busy implementing the basic services to interact with vessels (documented here https://github.com/djungelorm/krpc/wiki/SpaceCenter-Service). It's taken some time to wrap my head around the 3d math involved... but it's mostly working now. Another pre-release is imminent!

Link to comment
Share on other sites

This took a lot longer than expected, but I've finally uploaded a new pre-release :)

Server plugin download link: https://github.com/djungelorm/krpc/releases/download/v0.1.0/krpc-0.1.0.zip

Python client download link: https://pypi.python.org/pypi/krpc

Here's a summary of the changes:

  • The plugin now works on Windows, and the build scripts work when run in a cygwin environment
  • I have partially implemented the 'SpaceCenter' service that provides basic interaction with craft. This includes getting flight/orbital data, resource info and basic auto-piloting. It's documented here: https://github.com/djungelorm/krpc/wiki/SpaceCenter-Service
  • Added support for default arguments
  • Added support for enumerations
  • Added support for 'blocking' procedures. These are procedures that take more than one frame to execute.
  • The python client code is now hosted on pypi (link above). This means you can install it using "pip install krpc" or you can download the source and install it using setuptools via "python setup.py install"

I've also changed the license to GNU GPL v3, as I have reused auto-pilot code from various GPL'd mods. Big thanks to r4m0n (MechJeb), Nivekk (kOS) and Cilph (RemoteTech) for their awesome mods, and mic_e for writing a prototype kRPC autopilot service!

Link to comment
Share on other sites

How would one go through with writing a kRPC program in Java?

You'd need to implement a java client library that you can use from your java programs to talk to the server. My knowledge of Java is limited, but I guess it would do something like translate Java RMI calls to/from protocol buffer messages that the server understands. I haven't yet documented how the protocol buffer communication protocol works, but it could be reverse engineered from the existing python client library.

tja mentioned back on page 6 (http://forum.kerbalspaceprogram.com/threads/69313-WIP-kRPC-A-language-agnostic-Remote-Procedure-Call-server-for-KSP?p=1028791&viewfull=1#post1028791) that they'd had a go at implementing such a java client. Maybe tja could share the code with you?

Link to comment
Share on other sites

Alright, thanks. I'll toss tja a PM.

EDIT: Apparently that was most likely an account he made for that, he hasn't been online since the 18th of March. I'm gonna have a go at learning Python instead, Because It Can't Be That HardTM

Edited by Rich
Let's keep the chatter appropriate please.
Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...