Closed CIB closed 3 years ago
Usually, you need to create a C++ DFHack plugin which process the data that you need to use in the input proto message and pack it to a proto out message.
Check RemoteFortressReader plugin as a example.
We're using our own RPC protocol, actually, not gRPC. I don't think gRPC would work with DFHack out of the box, but maybe it's similar.
Ah, gotcha, thanks. I just googled "rpc protobuf", and so google's rpc protocol came up, hence the confusion. :)
Hm, so I guess I'd have to implement that protocol in node myself. I tried to find the implementation in armokvision, but couldn't. How difficult would it be to implement from scratch?
https://github.com/RosaryMala/RemoteClientDF-Net is (at least most of) Armok Vision's RPC implementation. You're at least the second person this month to ask about DFHack's RPC protocol, and it is definitely in need of documentation. Ragundo (or RosaryMala) would know more about the protocol than myself at the moment.
Thanks a bunch! I also found the relevant code in DFHack now. So it's just a custom protocol implemented on top of TCP sockets, then. (btw. won't the header break if the server uses a different byte order than the client? Meh, I guess that's an edge case)
I have a Go implementation of the RPC here: https://github.com/BenLubar/dfhackrpc
Since Dwarf Fortress currently only runs on x86, assuming little endian is pretty safe. A lot of code within Dwarf Fortress also passively assumes little endian.
This JS client can connect to DFHack RPC services like RemoteFortressReader or IsoworldRemote: https://github.com/alexchandel/dfhack-remote The connection is not direct, but goes through a websockify proxy.
Closing as this seems to have been addressed.
We also have a dedicated documentation page for DFHack's remote API now (open to additions): https://docs.dfhack.org/en/latest/docs/Remote.html
Hi. Sorry for using a github issue, but it seemed like the easiest way to communicate.
I'm experimenting with building a program that communicates with DFHack using node. I saw that grpc is currently being used for this purpose. For that, I used this tutorial. Loading the .proto files worked fine, however from there I got stuck. The tutorial explains that to create a client, you have to "attach" to one of the service definitions in the proto file. But as far as I can tell, the proto files in DFHack don't define any services at all. Rather, all the function signatures seem to be only available as comments. How would I go about actually calling these functions from node grpc?