Complete.Org: Mailing Lists: Archives: freeciv-dev: September 2001:
[Freeciv-Dev] Re: [Patch] Extended connect dialog (PR#977)
Home

[Freeciv-Dev] Re: [Patch] Extended connect dialog (PR#977)

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: rf13@xxxxxxxxxxxxxxxxxxxxxx
Cc: freeciv-dev@xxxxxxxxxxx, bugs@xxxxxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] Re: [Patch] Extended connect dialog (PR#977)
From: Andreas Kemnade <akemnade@xxxxxxxxxxx>
Date: Tue, 25 Sep 2001 20:26:10 +0200

Raimar Falke writes:

 > Another problem. It would be nice if we don't put this new code in the
 > current code as it has been before but make a small design. Reasons:
 >  1) I notices while I was doing the auto connect that the client
 >  startup isn't an easy thing
 >  2) I don't want to get a lot of other "if(special_condition)" into
 >  the code
Ack.
 >  3) I don't want to get code duplication among the clients
I have thought about that. But I did not found stuff you can share
between clients. The start server method cannot be shared (perhaps
between the gtk and xaw client). 
The whole pipe handling has to be done in a different way for the
gui-mui and the gui-win32 client. The fork()/execvp() combination has
to be done in a different way, too. The same for SIGCHLD.

 > 
 > For the following I call the new dialog you have coded "main
 > menu". These are the nodes used:
 >  - game start
 >  - main menu
 >  - connect dialog
I think we should add an input dialog for the player name.
    - name dialog
 >  - main window (the map window)
 > 
 > if "game start":
 >   if "auto connect":
 >      gosub "connect to server"
 >      goto "main window"
 >   else:
 >      popup "main menu"
 > 
 > if user chooses "new game" in "main menu":
 >   gosub "start server"
     popup "name dialog"
 >   gosub "connect to server"
 >   goto "main window"
 > 
 > if user chooses "load game" in "main menu":
 >   popup "file dialog"
 >   gosub "start server" with "-f"
     popup "name dialog"
 >   gosub "connect to server"
 >   goto "main window"
 > 
 > if user chooses "join game" in "main menu":
 >   popup "connect dialog"
 >   gosub "connect to server"
 >   goto "main window"
 > 
 > if user chooses "quit client" in "main window":
     server_pid=-1;
     exit(0); /* atexit handler will kill process with
                 server_pid if it is valid */
 >   ???
 > 
 > Is this correct till here? 
Yes. I have made some additions.
A public method for testing if the client has started the server is
also needed. 

Save game method (with file dialog popup) is also needed. 
 > 
 > I would really like to see the logic above in the code structure. This
 > would allow us to skip various parts: for example a client command
 > line option "-f" could be used to start the server, load the game and
 > autoconnect the client. We may also need an option to skip the "main
 > menu".
I think I have understood what you would like to see.

Greetings
Andreas Kemnade 


[Prev in Thread] Current Thread [Next in Thread]