[Freeciv-Dev] Re: Working on client APIs
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
On Fri, Jul 07, 2000 at 01:51:45PM -0700, jrb3@xxxxxxxx (Joseph Beckenbach III,
CCP) wrote:
>
> Has anyone started working on this, either as direct multithread
> support, or as "defining the client-side API"? I have a gut feel that all
> the code will need to be rewritten to be multithreaded, and then let the
> single-threaded client support be a special case (eg Lock() and Unlock()
> on the "shared data areas" as no-ops for the single-threaded)
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.
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?
Raimar
--
email: rf13@xxxxxxxxxxxxxxxxx
"Just because you put a flag on the moon doesn't make it yours, it just
puts a hole in the moon."
- [Freeciv-Dev] Working on client APIs, jrb3@xxxxxxxx (Joseph Beckenbach III, CCP), 2000/07/07
- [Freeciv-Dev] Re: Working on client APIs,
Raimar Falke <=
- [Freeciv-Dev] Re: Working on client APIs, Jed Davis, 2000/07/17
- [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
|
|