I was looking at what I'd need to do for my application to make contact with Goncyn's upcoming protobuf procedures for setting dwarf labors. (He mentions his future addition to DFHack around the bottom of page 2 in my thread here: http://www.bay12forums.com/smf/index.php?topic=105530.29)
I've cloned DFHack and searched through the project for anything relating to a protobufs RPC service, and it looks like there's nothing committed about one yet. (I see lots of .protos, but no service definitions.)
How is the DFHack RPC service going to work (at least from the "client" side)? Will an outside application need to know a port number? Will this be defined by the individual plugins? I'd like to understand this part of the design perspective, so that I can (hopefully) prepare my outside application a bit for communication with DFHack (if/when that becomes possible). Thanks for your help.
protobuff is only the part used to encode the messages from client to server.
then ZMQ libraries are used to do the actual plumbing of creating connections and exchanging the data.
proto buff works this way:
protos files are used by google protobuff tools to generate code which will produce the same encoding for any OS/language combination.
so, for example, if you want to exchange messages on windows between 2 c++ applications, you only need one set of generated classes to exchange the data and can use existing ones if you don't create new protos.
but if you want, like me, to exchange between a c# .NET client and the dfhack c++ server, you'll have to get a protobuff code generator for C#, then create the equivalent code using the protos model.
then you have ZMQ:
it makes exchanging data beetween a client and server which don't have to be on the same OS or language easy and does the heavy lifting for you. then again, if you use a different language for the client, you have to get you're language version (often a wrapper of the c++ dlls) to make it work. and again, if your client is in c++, you can just use the same dlls as dfhack.
i think the code of the server part included in dfhack is here:
https://github.com/peterix/dfhack/blob/master/library/RemoteServer.cppfor a simple exemple of the client part in c++, you can see it here, it's a console executable to transmit simple command to dfhack from a non-dfhack console:
https://github.com/peterix/dfhack/blob/master/library/dfhack-run.cpp