[crossfire] Am interested in porting to Mac

Mark Wedel mwedel at sonic.net
Thu Aug 11 02:06:25 CDT 2005


  Quick notes on how the common stuff works:

  The GUI aspect of the client controls its own event loop.  All it needs to do 
is check the network socket to see if it has input, and call do_network().

  do_network() then reads the data and parses it, taking care of the protocol 
and making function calls on its own.

  In some cases, this results in function calls back to the GUI area.  the 
common/external.h lists the functions the common area will call.

  In some cases, the gui functin call may do nothing at all - it may just 
provide that function because _some_ clients do something with that.

  The common area also sets up data structures - the most notable of these is 
the_map structure which is what the map looks at.  Other things it maintains is 
the players inventory, stats, etc.

  In the case of the opengl client, it basically doesn't do anything with the 
disaply_map_..() functions, other than to set that the map has changed.  It then 
just redraws the map on its own timeframe (basically when there is no input left 
on the socket).

  I have no idea if this callback method works with objective C.  But as others 
have said, if you can continue to use the common area, it certainly will save 
you work in the long run - while the protocol may change, these functions and 
data structures are less likely to change.

    
    


More information about the crossfire mailing list