[Freeciv-Dev] Re: Working on client APIs
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
--On Saturday, 8 July 2000 2:24 PM +0200 Raimar Falke
<hawk@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
I have started on defining and implementing an API for client side AI. The
basic structure in my current design is a general layer, which does
caching and the network stuff. This layer exports an API to the upper
layer, which I termed "control program". This part can be written in any
language. The interaction is quite simple throught callbacks: the lower
layer sniffs a packet from the network, updates the cache and calls a
notify callback in the upper layer. The upper layer then can use the
cached data to make a decision and call some set_* method in the lower
layer. My test control program is now written in C and can at least call
turn_done() if it gets a new_year_notify. This allows to get a whole
game from -4000 till the server-AI kills me in some minutes.
This would also be very useful for client-side
scripting/automation/whatever. However I'm not quite clear what a callback
would involve here: I first thought that it would involve calling a C
function (which could dispatch the call to an embedded interpreter), but
the "written in any language" implies that these callbacks involve some
kind of IPC with the controller running as a separate process, which is
probably a better idea in the long run. Since I'm sort of working on
(read: planning and trying in vain to find time for) GUILE scripting, I'd
appreciate any information on this.
There is no multithreading in this design. I'm not sure if there is a
situation where mutlithreading is needed. Since I don't know any thread
package for C can somebody recommend one?
I know of pthread (POSIX threads), which as far as I know is fairly
widespread.
--Jed
- [Freeciv-Dev] Working on client APIs, jrb3@xxxxxxxx (Joseph Beckenbach III, CCP), 2000/07/07
- [Freeciv-Dev] Re: Working on client APIs, Raimar Falke, 2000/07/08
- [Freeciv-Dev] Re: Working on client APIs,
Jed Davis <=
- [Freeciv-Dev] Re: Working on client APIs, Raimar Falke, 2000/07/17
- [Freeciv-Dev] Re: Working on client APIs, Jed Davis, 2000/07/17
- [Freeciv-Dev] Re: Working on client APIs, Raimar Falke, 2000/07/18
- [Freeciv-Dev] Re: Working on client APIs, Jed Davis, 2000/07/19
- [Freeciv-Dev] Re: Working on client APIs, David Pfitzner, 2000/07/20
[Freeciv-Dev] Re: Working on client APIs, Jeff Mallatt, 2000/07/08
|
|