Complete.Org: Mailing Lists: Archives: freeciv-dev: September 1999:
[Freeciv-Dev] use new many leaders patch in xaw client
Home

[Freeciv-Dev] use new many leaders patch in xaw client

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] use new many leaders patch in xaw client
From: Jeff Mallatt <jjm@xxxxxxxxxxxx>
Date: Thu, 16 Sep 1999 19:21:23 -0400

Well, this was a fun one :)

I started out to adapt the Xaw client to use the new list of leaders (by
just adding a popup menu with the nation's leader names from the nation
ruleset).  At some point, I had a bug which de-referenced a null pointer
while the Select Nation dialog was open, so the Client crashed -- no
problem; easy to fix -- but the Server crashed, also!!

This lead me for the first time into the server's state machine.  While
poking around at it, I did some tests with two clients.  If I connected
them both, and then (before starting a game) if I disconnected (or quit)
the _first_ one which was connected, then the second one popped-up an
*empty* Select Government dialog.  And, since Sel Gov is modal, and this
"empty" one doesn't have any buttons, the whole app winds up hung.

Well, I've tried to fix both of these bugs.  Since this is my first foray
into the intricacies of the intermeshing server/client state machines, I
could easily have overlooked something.

To fix the server crash, I added some code to main() in server/civserver.c
to catch the zero-players case, and jump back to a previous state.

To fix the extraneous Sel Gov dialog, I added a check to the beginning of
handle_player_info() in client/packhand.c which just returns if the client
state is not yet running.

Oh, yes, I also then did add the new popup to the Xaw client :)  And, also,
"Disconnect" and "Quit" buttons to both clients' Sel Nat dialogs (since the
server can now handle it).

Attachment: nation-leader-pick-4.diff.gz
Description: Binary data

jjm

[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] use new many leaders patch in xaw client, Jeff Mallatt <=