Complete.Org: Mailing Lists: Archives: freeciv-dev: April 2003:
[Freeciv-Dev] Re: (PR#3736) Pregame player list
Home

[Freeciv-Dev] Re: (PR#3736) Pregame player list

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: andrearo@xxxxxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#3736) Pregame player list
From: "Mike Kaufman" <kaufman@xxxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 21 Apr 2003 05:06:35 -0700
Reply-to: rt@xxxxxxxxxxxxxx

On Sun, Apr 20, 2003 at 12:34:53AM -0700, andrearo@xxxxxxxxxxxx wrote:
> Mike Kaufman wrote:
> 
> >On Sat, Apr 19, 2003 at 11:59:53AM -0700, andrearo@xxxxxxxxxxxx wrote:
> >  
> >
> >>To make sure that game.est_connections always contains
> >>a correct list of connections, I had to change connecthand.c:
> >> -  struct conn_list *dest = &pconn->self;
> >>+  struct conn_list *dest = &game.est_connections;
> >>It solves the problem, but is this the correct way to do it?
> >>    
> >>
> >
> >no it isn't. To see why, connect a first client to the server and then
> >connect a second. watch what happens.
> >
> >-mike
> >
> I see, the problem is that the new client conneting doesn't get the list 
> of the other clients.
> A solution is to first send info about the new client to all clients, 
> and then send info
> about all clients to the new client.  I've tested it without any problems.

well this wasn't the problem I was referring to, but I believe that you're
right. I'll check the connecthand part of your solution probably tonight.

Most of the the rest is up to vasc, but a couple things:

> +                    "label", _("_Connected Players:"),
> +                    "xalign", 0.0, "yalign", 0.5, NULL);
> +  scroll_panel = gtk_scrolled_window_new(NULL,NULL);

This should rather be "Connected Users".

>  {
>    gtk_input_remove(input_id);
>    gdk_window_set_cursor(root_window, NULL);
> +  conn_list_init(&game.all_connections);
> +  conn_list_init(&game.est_connections);
> +  conn_list_init(&game.game_connections);
>  }

this shouldn't be here. It does appear that client_init() does not get
called yet. Either don't update the list (and don't require the use of the
conn lists) until handle_conn_info gets called (the best solution) or make
these inits near the top of civclient.c,

>  
>    /* "establish" the connection */
>    pconn->established = TRUE;
> -  conn_list_insert_back(&game.est_connections, pconn);
>    send_conn_info(dest, &game.est_connections);
> -  
> +  conn_list_insert_back(&game.est_connections, pconn);
> +  send_conn_info(&game.est_connections, dest);
> +

I'm not quite sure about this yet, I'll check. Vasc, hold off on commiting
this.

-mike

PS: a very good feature, should be ported to all the clients.



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