[Freeciv-Dev] Re: Improved game starting (version 8)
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
On Sun, Jan 27, 2002 at 12:56:28PM -0500, Daniel L Speyer wrote:
> On Sun, 27 Jan 2002, Raimar Falke wrote:
>
> > On Sun, Jan 20, 2002 at 12:51:54AM -0500, Daniel L Speyer wrote:
> > > Here is yet another version of the improved game starting patch. The
> > > server control buttons now send there commands over the network, and there
> > > is now a checkbox to start the game immediately. I have also moved the
> > > extern statement from connectdlg.c to connectdlg.h.
> >
> > Try to build it for the xaw client:
> >
> Hmm, I guess popup_main_menu needs to have the same name as the connect
> dialog in xaw. I'll work on that.
There are also other clients besides xaw.
> > Overall I think that the people will just like it very much.
> >
> > Issues:
> > - if I load a file which isn't a savegame there is no feedback
>
> Hmm, I dread the thought of parsing its pipe output -- maybe I can give
> context-sensitive errors on server death, though.
From the user point of view there should be a message.
> > - if I select file "foobar" as savefile name it will create a "foobar.gz"
>
> Should it be foobar.sav.gz? Does gtk have a way to help with this?
This problem isn't made by the new dialog. The server has always
appended it prefix. However with the dialog you loose the feeback the
server gives.
> > - there is no error if the game couldn't be saved. Just remove the
> > write permissions *evil grin*.
>
> The server only sends a warning through the pipe. I just went through
> removing all pipe usage from those buttons.
> Maybe the server should command a popup for failed saves?
No. For normal uses the server gives the feedback. The new dialog just
doesn't relay this feedback.
> > - I would like the ability to dump the server communication. Best
> > would be a file. Enabled by command line option or a DUMP_SERVER_IO
> > pre-processor switch.
>
> Difficult. How about a gui command to display all server pipe output not
> yet claimed? Would that be good enough?
Not if we want people to include the files in the bug reports.
> > - sizeof(char) is by definition 1
>
> Is it?
From http://std.dkuug.dk/JTC1/SC22/open/n2620/n2620.txt 6.3.3.4#3:
> [#3] When applied to an operand that has type char, unsigned
> char, or signed char, (or a qualified version thereof) the
> result is 1.
> That seems like a bad idea. Eventually libc might go
> Unicode. More credibly, GTK could do something like qt, and we'll want to
> mass-replace char with gchar -- then we'll want these sizeofs
Certainly not gchar. wchar_t is the name of the thing. But be assured
that we would need a whole audit for a change like this.
> > - are you serious about _the thing_ in get_player_name? Use a struct
> > which has MAX_NUM_PLAYERS slots.
>
> Yes, I am serious.
>
> I'd forgotten that MAX_NUM_PLAYERS already existed, so I guess there isn't
> quite as much need for dynamicism as I'd thought. Even so, I can't
> immediately see how anything else will work. Remember, every callback
> needs to get everything, so that it can de-allocate it. However, each
> callback needs to get something different, so that it knows what it
> is. This pretty much requires a circular structure of some sort. I
> suppose you could have something like:
>
> Array <--------------\----\
> /-\ | |
> | |---->struct{name,|} |
> +-+ |
> | |--------->struct{name,|}
> +-+
> .
> .
> .
> +-+
> | |---->buf
> +-+
> .
> .
> .
>
>
> and then pass the relevant struct, but I'm not sure how much nicer that
> really is. The struct name will have to clutter the namespace, if nothing
> else.
struct a {
char *name;
GtkWidget *window;
};
In get_player_name:
static struct a[MAX_NUM_PLAYERS];
and you pass "struct a*" around. Seems a lot nicer.
Another one:
+ for(i=strlen(name);name[i]!='(';i--);
+ name[i-1]=0;
could be replaced by
*(strrchr(name,'(')-1)=0;
Not really nice but nicer than the for loop IMHO. And could be
implemented in asm.
Raimar
--
email: rf13@xxxxxxxxxxxxxxxxx
"The two rules for success in life are:
1) Never tell them everything you know."
[Freeciv-Dev] Re: Improved game starting (version 8), Raimar Falke, 2002/01/27
|
|