[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: 2 Player mode



On 06.10.2006 22:26, Henk Jonas wrote:
> well, the SDL_net seems to make things quite easy.

Indeed. I found a nice example as well, so it looks like the
transmission part won't be too much of a technical challenge,
which is nice.

I've got acouple of issues with your patch, though.

a) just a general remark: please also use -p when creating a diff.
   That way locating the snippet in question becomes much easier

b) what exactly is GI_2PLAY? Hot-seat? Network? Both? Without
   currentlyhaving any hard evidence (and not having progressed
   enoughto try) I get the feeling that it is sometimes
   used inconsistently (and, of course, the name's obviously not
   telling)

c) what I'm missing in your code is an initialization step. After
   a game is loaded (either started or resumed) the server should
   send the entire mission to the client, to avoid issues with
   slightly different versions or the map not being available at
   the client etc. Are you doing this at all?

d) in a networked game, for the remote player, you call CheckEvents()
   on the server. That looks wrong, because the player will get "his"
   events only with "Show turn history" enabled. Ideally, the part
   for the remote player in StartTurn would look like this:

     SendHistory();
     hist = WaitForMsg();
     hist->ReplayForReal();
     EndTurn();

   and on the client side:

     hist = WaitForMsg();
     hist->ReplayForReal();
     EnableDisplay();
     CheckEvents();

   and in EndTurn:

     DisableDisplay();
     SendHistory();

   (I think. Right?)


Anyway, I'm currently working on getting proper net infrastructure
support into the code. Hopefully, I'll be able to produce something
I can actually run after that.

Jens