djungelorm

[1.4.x,1.3.x,1.2.2] kRPC: Remote Procedure Call Server (v0.4.7, 27th July 2018)

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.

:)

Share this post


Link to post
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.

Share this post


Link to post
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.

Share this post


Link to post
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.

Share this post


Link to post
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 ?

Share this post


Link to post
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

Share this post


Link to post
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!

Share this post


Link to post
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!

Share this post


Link to post
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.

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

Nope, no proxies. I don't think its getting caught by a firewall either, mine always pops up a message if it stops something. I tried verbose mode and it sill did the same non-response:

dG4BGUs.png

Share this post


Link to post
Share on other sites

You could also try putting the full path to pip.exe to make sure you're running the one you're expecting, e.g.:

C:\Python27\Scripts\pip.exe -vvv install protobuf

Share this post


Link to post
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

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

Just curious, not to sound pushy or anything because I understand how difficult these things can be to develop, but has this Mod died?

Share this post


Link to post
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!

Share this post


Link to post
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?

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

I've made a new pre-release, just with some minor changes this time. Here's a change log:


v0.1.1
- Add new functionality to SpaceCenter service
- Minor server code improvements

Share this post


Link to post
Share on other sites

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.