Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: hackurist 1.0: a client library/command line tool for the dfhack rpc server  (Read 2275 times)

DeDeRon

  • Bay Watcher
    • View Profile

hi@all,

i want to announce the first release of hackurist - a client library/command line tool for the dfhack rpc server, written in Go.

please see https://bitbucket.org/telesto/hackurist for source code, downloads, documentation etc.

while this package is nothing worldshaking, i hope to encourage other ppl to implement client libraries in other programming/scripting lanuages too. Right now, afaik, there is only the dfhack c++ client. many ppl can't program in c++ or don't like c++. hopefully, by having a wider choice of rpc clients, we see more third party tools around in future. i think especially of python, as python is very popular these days. anyone up for the task? the hackurist code is documented, quite compact and readable.

while implementing hackurist some ideas arose for improving the dfhack rpc protocol - i will open a dedicated topic for a discussion. i'd love to see some clean up and simplifying, again to make programming of rpc clients easier.

a request - the windows and mac os x binaries are cross compiled (i use linux only) - can someone confirm that these programs are working?

strike the earth!

dederon

Nopenope

  • Bay Watcher
    • View Profile

Didn't DFHack use to have Python bindings at some point? They seem to have gone so this tool comes in handy.
Logged

expwnent

  • Bay Watcher
    • View Profile

In combination with modtools/anonymous-script or just :lua you can execute arbitrary code using something like this, so be careful with that.
Logged

milo christiansen

  • Bay Watcher
  • Something generic here
    • View Profile

This looks useful! It's even in the right language :)

If I understand correctly this is a library form of what `dfhack-run` does?
Basically an easy to use wrapper around the protocol buffer system?

In combination with modtools/anonymous-script or just :lua you can execute arbitrary code using something like this, so be careful with that.
You can do that with `dfhack-run` too, so it's not like it's a new problem...
Logged
Rubble 8 - The most powerful modding suite in existence!
After all, coke is for furnaces, not for snorting.
You're not true dwarven royalty unless you own the complete 'Signature Collection' baby-bone bedroom set from NOKEAS

DeDeRon

  • Bay Watcher
    • View Profile

This looks useful! It's even in the right language :)
yes, i hope more ppl will write some tools for df this way.

If I understand correctly this is a library form of what `dfhack-run` does?
yes, included is a command line program ("cmd/hackurist" directory), which is quite the same as dfhack-run.

Basically an easy to use wrapper around the protocol buffer system?
yes. unfortunately the dfhack rpc protocol is not 100% protobuf based, e.g. c++ objects, used as header, are written raw over the connection. as an user of the library you will not notice this, it's hidden away in the library. but it makes things more complicated than they should be an increases the sloc.
a rewrite of this rpc protocol would make things much easier (not only at the client side), seems it accumulated some cruft over the years. i would gladly take the chance, but we need someone from the core dfhack team to get things implemented on the server side.
so if a member of the dfhack team is interested cleaning up this thing, leave a message here.