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: undisclosed-recipients:;
Subject: [Freeciv-Dev] Re: (PR#3736) Pregame player list
From: "andrearo@xxxxxxxxxxxx" <andrearo@xxxxxxxxxxxx>
Date: Thu, 24 Apr 2003 09:37:29 -0700
Reply-to: rt@xxxxxxxxxxxxxx

Mike Kaufman wrote:

>On Mon, Apr 21, 2003 at 01:58:51PM -0700, andrearo@xxxxxxxxxxxx wrote:
>  
>
>>>these inits near the top of civclient.c,
>>>
>>>      
>>>
>>The reason I used those functions was that the conn_lists are not 
>>cleared when a client connects to a server in pregame, then disconnects 
>>and connects to the same server in pregame state. However, I think 
>>client_remove_all_cli_conn() can be used there instead. Right?
>>    
>>
>
>yes. you get lucky that the list unlink is an implicit init, but this
>should not be in the gui code. It should probably should be at the bottom
>of clinet.c:close_socket_nomessage(), though vasc should verify this.
>
>it seems that if we're in pregame and disconnect, client_game_free()
>doesn't get called. hmm. interesting.
> 
>  
>
>>Is there anything else that could be changed?  It would be nice to have 
>>a teamname column as well..
>>    
>>
>
>hmm, better to have a right click or tooltip or something on the row to 
>bring up extra info, since we want the dialog to be unobstrusive.
>
>update_conn_list_model() should be renamed update_conn_list_dialog() as
>model is very gtk2-centric.
>
>other than these, the ball is in vasc's court. I would very much like to
>see gtk1.2 and xaw versions of this when committed too.
>
>-mike
>
I made the changes you requested, and ported it to gtk1.2.
However, I can't make a xaw version. (lacking know-how and time).

Andreas Røsdal

diff -Nur -Xfreeciv-changed/diff_ignore freeciv-cvs-Apr-21/client/civclient.c 
freeciv-changed/client/civclient.c
--- freeciv-cvs-Apr-21/client/civclient.c       2003-04-18 06:57:02.000000000 
+0200
+++ freeciv-changed/client/civclient.c  2003-04-24 18:06:06.000000000 +0200
@@ -99,7 +99,6 @@
  */
 bool turn_done_sent = FALSE;
 
-static void client_remove_all_cli_conn(void);
 
 /**************************************************************************
 ...
@@ -710,6 +709,7 @@
     }
   }
   update_turn_done_button_state();
+  update_conn_list_dialog();
 }
 
 
@@ -739,7 +739,7 @@
   Remove (and free) all connections from all connection lists in client.
   Assumes game.all_connections is properly maintained with all connections.
 **************************************************************************/
-static void client_remove_all_cli_conn(void)
+void client_remove_all_cli_conn(void)
 {
   while (conn_list_size(&game.all_connections) > 0) {
     struct connection *pconn = conn_list_get(&game.all_connections, 0);
diff -Nur -Xfreeciv-changed/diff_ignore freeciv-cvs-Apr-21/client/civclient.h 
freeciv-changed/client/civclient.h
--- freeciv-cvs-Apr-21/client/civclient.h       2003-04-13 06:57:15.000000000 
+0200
+++ freeciv-changed/client/civclient.h  2003-04-24 18:06:06.000000000 +0200
@@ -38,6 +38,7 @@
 enum client_states get_client_state(void);
 
 void client_remove_cli_conn(struct connection *pconn);
+void client_remove_all_cli_conn(void);
 
 extern char sound_plugin_name[512];
 extern char sound_set_name[512];
diff -Nur -Xfreeciv-changed/diff_ignore freeciv-cvs-Apr-21/client/clinet.c 
freeciv-changed/client/clinet.c
--- freeciv-cvs-Apr-21/client/clinet.c  2003-04-21 06:56:58.000000000 +0200
+++ freeciv-changed/client/clinet.c     2003-04-24 18:06:06.000000000 +0200
@@ -103,6 +103,7 @@
   
   set_client_state(CLIENT_PRE_GAME_STATE);
   agents_disconnect();
+  client_remove_all_cli_conn();
 }
 
 /**************************************************************************
diff -Nur -Xfreeciv-changed/diff_ignore 
freeciv-cvs-Apr-21/client/gui-gtk/gui_main.c 
freeciv-changed/client/gui-gtk/gui_main.c
--- freeciv-cvs-Apr-21/client/gui-gtk/gui_main.c        2003-04-22 
06:57:06.000000000 +0200
+++ freeciv-changed/client/gui-gtk/gui_main.c   2003-04-24 18:06:06.000000000 
+0200
@@ -103,6 +103,10 @@
 GtkWidget *main_frame_civ_name;
 GtkWidget *main_label_info;
 
+static GtkWidget *avbox, *ahbox, *vbox, *conn_box;
+static GtkWidget* scroll_panel;
+static GtkWidget* conn_user_list;
+
 GtkWidget *econ_label[10];
 GtkWidget *bulb_label;
 GtkWidget *sun_label;
@@ -152,6 +156,9 @@
 static void select_unit_pixmap_callback(GtkWidget *w, GdkEvent *ev, 
                                         gpointer data);
 static gint timer_callback(gpointer data);
+static gboolean show_conn_list_popup(GtkWidget *view, 
+                       GdkEventButton *event, gpointer data);
+static gint hide_conn_list_popup(GtkWidget *w, GdkEventButton *ev);
 
 /**************************************************************************
   Print extra usage information, including one line help on each option,
@@ -520,8 +527,7 @@
 **************************************************************************/
 static void setup_widgets(void)
 {
-  GtkWidget *box, *ebox, *hbox, *vbox;
-  GtkWidget *avbox, *ahbox;
+  GtkWidget *box, *ebox, *hbox, *sbox, *conn_label;
   GtkWidget *frame, *table, *paned, *menubar, *text;
   GtkStyle  *text_style, *style;
   int i;
@@ -565,13 +571,39 @@
   gtk_signal_connect(GTK_OBJECT(overview_canvas), "button_press_event",
                      (GtkSignalFunc) butt_down_overviewcanvas, NULL);
 
+  /* Prepare list of Connected Users in the pregame state. */
+  conn_user_list = gtk_clist_new(1);
+  gtk_clist_set_column_auto_resize (GTK_CLIST(conn_user_list), 1, TRUE);
+  gtk_clist_set_column_width(GTK_CLIST(conn_user_list), 0,
+       GTK_CLIST(conn_user_list)->clist_window_width);
+
+
+  /* Display the list of Connected Users. */
+  conn_box = gtk_vbox_new(FALSE, 2);
+  conn_label=gtk_widget_new(GTK_TYPE_LABEL,
+                           "GtkLabel::label", _("Connected Users:"),
+                           "GtkWidget::visible", TRUE,
+                           "xalign", 0.1, "yalign", 0.5, 
+                           NULL);
+  scroll_panel = gtk_scrolled_window_new(NULL,NULL);
+  gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scroll_panel),
+                         GTK_POLICY_AUTOMATIC,GTK_POLICY_AUTOMATIC);
+  gtk_box_pack_start(GTK_BOX(conn_box), conn_label, FALSE, FALSE, 0);
+  gtk_container_add(GTK_CONTAINER(conn_box), scroll_panel);
+  gtk_container_add(GTK_CONTAINER(avbox), conn_box);
+  gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(scroll_panel),
+                           conn_user_list);
+  gtk_signal_connect(GTK_OBJECT(conn_user_list), "button-press-event",
+                 GTK_SIGNAL_FUNC(show_conn_list_popup), NULL);
+
+
   /* The Rest */
 
   ahbox = detached_widget_new();
   gtk_container_add(GTK_CONTAINER(vbox), ahbox);
   avbox = detached_widget_fill(ahbox);
 
-  /* Info on player's civilization */
+  /* Info on player's civilization, when game is running. */
   frame = gtk_frame_new(NULL);
   gtk_box_pack_start(GTK_BOX(avbox), frame, FALSE, FALSE, 0);
 
@@ -732,9 +764,9 @@
 
   /* *** The message window -- this is a detachable widget *** */
 
-  ahbox = detached_widget_new();
-  gtk_paned_pack2(GTK_PANED(paned), ahbox, TRUE, TRUE);
-  avbox = detached_widget_fill(ahbox);
+  sbox = detached_widget_new();
+  gtk_paned_pack2(GTK_PANED(paned), sbox, TRUE, TRUE);
+  avbox = detached_widget_fill(sbox);
 
   hbox = gtk_hbox_new(FALSE, 0);
   gtk_box_pack_start(GTK_BOX(avbox), hbox, TRUE, TRUE, 0);
@@ -780,6 +812,7 @@
     gtk_widget_hide(map_horizontal_scrollbar);
     gtk_widget_hide(map_vertical_scrollbar);
   }
+  gtk_widget_hide(ahbox);  /* Hide info on player's civ in pregame */
 }
 
 /**************************************************************************
@@ -956,6 +989,85 @@
 }
 
 /**************************************************************************
+ Update Connected Users list in the pregame state.
+**************************************************************************/
+void update_conn_list_dialog(void)
+{
+  gchar *row[1];
+  if (get_client_state() != CLIENT_GAME_RUNNING_STATE) {
+    gtk_clist_freeze(GTK_CLIST(conn_user_list));
+    gtk_clist_clear(GTK_CLIST(conn_user_list));
+    conn_list_iterate(game.est_connections, pconn)
+      row[0] = pconn->username;
+      gtk_clist_append(GTK_CLIST(conn_user_list), row);
+    conn_list_iterate_end;
+    gtk_widget_hide(ahbox);
+    gtk_widget_show(conn_box);
+  } else {
+    gtk_widget_hide(conn_box);
+    gtk_widget_show(ahbox);
+  }
+}
+
+/**************************************************************************
+ Show details about a user in the Connected Users dialog in a popup
+**************************************************************************/
+static gboolean show_conn_list_popup(GtkWidget *view, GdkEventButton *event,
+                                                        gpointer data)
+{
+  GtkWidget *p;
+  struct connection *pconn;
+  char buf[512];
+  GList *selection;
+  gchar *conn_name;
+  gint row;
+
+  /* Get the current selection in the Connected Users list */
+  gtk_clist_get_selection_info(GTK_CLIST(conn_user_list),
+                           event->x, event->y, &row ,NULL);
+  gtk_clist_select_row(GTK_CLIST(conn_user_list), row, 0);  
+  if ((selection=GTK_CLIST(conn_user_list)->selection)) {
+    row = GPOINTER_TO_INT(selection->data);
+    gtk_clist_get_text(GTK_CLIST(conn_user_list), row, 0, &conn_name); 
+    pconn = find_conn_by_user(conn_name);
+    
+    /* Show popup. */
+    my_snprintf(buf, sizeof(buf),
+           _("Name: %s \nHost: %s "), 
+           pconn->username,
+           pconn->addr);  
+    
+    p = gtk_window_new(GTK_WINDOW_POPUP);
+    gtk_widget_new(GTK_TYPE_LABEL, "GtkWidget::parent", p,
+                           "GtkLabel::label", buf,
+                           "GtkWidget::visible", TRUE,
+                           NULL);
+    gtk_widget_realize(p);
+    gtk_widget_popup(p, event->x_root-p->requisition.width/2,
+                           event->y_root-p->requisition.height/2);
+    gdk_pointer_grab(p->window, TRUE, GDK_BUTTON_RELEASE_MASK,
+                           NULL, NULL, 0);
+    gtk_grab_add(p);
+
+    gtk_signal_connect_after(GTK_OBJECT(p), "button_release_event",
+                           GTK_SIGNAL_FUNC(hide_conn_list_popup), NULL);
+  }
+  return FALSE;
+}
+
+/**************************************************************************
+ Hide popup for Connected Users dialog
+**************************************************************************/
+static gint hide_conn_list_popup(GtkWidget *w, GdkEventButton *ev)
+{
+  gtk_grab_remove(w);
+  gdk_pointer_ungrab(GDK_CURRENT_TIME);
+  gtk_widget_destroy(w);
+  update_conn_list_dialog();
+  return FALSE;
+}
+
+/**************************************************************************
  obvious...
 **************************************************************************/
 void sound_bell(void)
diff -Nur -Xfreeciv-changed/diff_ignore 
freeciv-cvs-Apr-21/client/gui-gtk-2.0/gui_main.c 
freeciv-changed/client/gui-gtk-2.0/gui_main.c
--- freeciv-cvs-Apr-21/client/gui-gtk-2.0/gui_main.c    2003-04-19 
06:57:11.000000000 +0200
+++ freeciv-changed/client/gui-gtk-2.0/gui_main.c       2003-04-24 
18:06:06.000000000 +0200
@@ -105,6 +105,14 @@
 GtkWidget *main_frame_civ_name;
 GtkWidget *main_label_info;
 
+GtkWidget *avbox, *ahbox, *vbox, *conn_box, *conn_list_view;
+GtkListStore *conn_list_model;       
+GtkCellRenderer *conn_list_renderer;
+GtkTreeViewColumn *conn_list_column; 
+GtkTreeSelection *conn_list_selection;
+GtkTreeIter conn_list_iter;
+GtkWidget* scroll_panel;
+
 GtkWidget *econ_label[10];
 GtkWidget *bulb_label;
 GtkWidget *sun_label;
@@ -159,7 +167,8 @@
 static gboolean select_unit_pixmap_callback(GtkWidget *w, GdkEvent *ev, 
                                            gpointer data);
 static gint timer_callback(gpointer data);
-
+static gboolean show_conn_list_popup(GtkWidget *view, 
+                       GdkEventButton *event, GtkTreeModel *model);
 static char *network_charset = NULL;
 
 
@@ -644,8 +653,7 @@
 **************************************************************************/
 static void setup_widgets(void)
 {
-  GtkWidget *box, *ebox, *hbox, *vbox;
-  GtkWidget *avbox, *ahbox, *align;
+  GtkWidget *box, *ebox, *hbox, *sbox, *align, *conn_label;
   GtkWidget *frame, *table, *table2, *paned, *menubar, *sw, *text;
   GtkStyle *style;
   int i;
@@ -679,7 +687,7 @@
   avbox = detached_widget_fill(ahbox);
 
   align = gtk_alignment_new(0.5, 0.5, 0.0, 0.0);
-  gtk_box_pack_start(GTK_BOX(avbox), align, TRUE, TRUE, 0);
+  gtk_box_pack_start(GTK_BOX(avbox), align, FALSE, FALSE, 0);
 
   overview_canvas = gtk_drawing_area_new();
 
@@ -695,13 +703,46 @@
   g_signal_connect(overview_canvas, "button_press_event",
                   G_CALLBACK(butt_down_overviewcanvas), NULL);
 
+  /* Prepare list of Connected Users in the pregame state. */
+  conn_list_model = gtk_list_store_new(1, G_TYPE_STRING); 
+  conn_list_view = gtk_tree_view_new_with_model(
+                       GTK_TREE_MODEL(conn_list_model));
+  gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(conn_list_view), false);
+  conn_list_selection = 
gtk_tree_view_get_selection(GTK_TREE_VIEW(conn_list_view));
+  
+  /*  Add column with username to Connected Users List.  */
+  conn_list_renderer = gtk_cell_renderer_text_new();
+  conn_list_column = gtk_tree_view_column_new_with_attributes("users",
+                       conn_list_renderer, "text", 0,  NULL);
+  gtk_tree_view_append_column(GTK_TREE_VIEW(conn_list_view),conn_list_column);
+  g_object_set(conn_list_renderer, "weight", "bold", NULL);
+  gtk_list_store_append(conn_list_model, &conn_list_iter);
+  
+  /* Display the list of Connected Users. */
+  conn_box = gtk_vbox_new(FALSE, 2);
+  conn_label = g_object_new(GTK_TYPE_LABEL,
+                      "use-underline", TRUE,
+                      "mnemonic-widget", conn_list_view,
+                      "label", _("_Connected Users:"),
+                      "xalign", 0.1, "yalign", 0.5, NULL);
+  scroll_panel = gtk_scrolled_window_new(NULL,NULL);
+  gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scroll_panel),
+                 GTK_POLICY_AUTOMATIC,GTK_POLICY_AUTOMATIC);
+  gtk_box_pack_start(GTK_BOX(conn_box), conn_label, FALSE, FALSE, 0);
+  gtk_container_add(GTK_CONTAINER(conn_box), scroll_panel);
+  gtk_container_add(GTK_CONTAINER(avbox), conn_box);
+  gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(scroll_panel),
+                           conn_list_view);
+  g_signal_connect(G_OBJECT(conn_list_view), "button-press-event",
+                           G_CALLBACK(show_conn_list_popup), NULL);
+
   /* The Rest */
 
   ahbox = detached_widget_new();
   gtk_container_add(GTK_CONTAINER(vbox), ahbox);
   avbox = detached_widget_fill(ahbox);
 
-  /* Info on player's civilization */
+  /* Info on player's civilization, when game is running. */
   frame = gtk_frame_new(NULL);
   gtk_box_pack_start(GTK_BOX(avbox), frame, FALSE, FALSE, 0);
 
@@ -891,9 +932,9 @@
 
   /* *** The message window -- this is a detachable widget *** */
 
-  ahbox = detached_widget_new();
-  gtk_paned_pack2(GTK_PANED(paned), ahbox, TRUE, TRUE);
-  avbox = detached_widget_fill(ahbox);
+  sbox = detached_widget_new();
+  gtk_paned_pack2(GTK_PANED(paned), sbox, TRUE, TRUE);
+  avbox = detached_widget_fill(sbox);
 
   sw = gtk_scrolled_window_new(NULL, NULL);
   gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(sw),
@@ -942,6 +983,7 @@
     gtk_widget_hide(map_horizontal_scrollbar);
     gtk_widget_hide(map_vertical_scrollbar);
   }
+  gtk_widget_hide(ahbox);  /* Hide info on player's civ in pregame */
 }
 
 /**************************************************************************
@@ -1127,6 +1169,78 @@
 }
 
 /**************************************************************************
+ Update Connected Users list in the pregame state.
+**************************************************************************/
+void update_conn_list_dialog(void)
+{
+  if (get_client_state() != CLIENT_GAME_RUNNING_STATE) {
+    gtk_list_store_clear(conn_list_model);
+    conn_list_iterate(game.est_connections, pconn)
+      gtk_list_store_append(conn_list_model, &conn_list_iter);
+      gtk_list_store_set(conn_list_model, &conn_list_iter, 
+                 0, pconn->username, -1);
+    conn_list_iterate_end;
+    gtk_widget_hide(ahbox);
+    gtk_widget_show(conn_box);
+  } else {
+    gtk_widget_hide(conn_box);
+    gtk_widget_show(ahbox);
+  }
+}
+
+/**************************************************************************
+ Show details about a user in the Connected Users dialog in a popup
+**************************************************************************/
+static gboolean show_conn_list_popup(GtkWidget *view, GdkEventButton *event,
+                                                        GtkTreeModel *model)
+{
+  GtkWidget *popup;
+  GtkTreeIter it;
+  char buf[512];
+  gchar *conn_name;
+  struct connection *pconn;
+  GtkTreeSelection *selection, *sel;
+  GtkTreePath *path;
+
+  /* Get the current selection in the Connected Users list */
+  if (!gtk_tree_view_get_path_at_pos(GTK_TREE_VIEW(conn_list_view),
+                           event->x, event->y, &path, NULL, NULL, NULL))
+    return FALSE;
+  sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(conn_list_view));
+  gtk_tree_selection_select_path(sel, path);
+  gtk_tree_path_free(path);
+
+  selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(conn_list_view));
+  if (gtk_tree_selection_get_selected(selection, &model, &it)) {    
+    gtk_tree_model_get(model, &it, 0, &conn_name, -1);
+    pconn = find_conn_by_user(conn_name);
+
+    /* Show popup. */
+    my_snprintf(buf, sizeof(buf),
+           _("Name: %s \nHost: %s "), 
+           pconn->username,
+           pconn->addr);   
+    popup = gtk_window_new(GTK_WINDOW_POPUP);
+    gtk_widget_set_app_paintable(popup, TRUE);
+    gtk_container_set_border_width(GTK_CONTAINER(popup), 4);
+    gtk_window_set_position(GTK_WINDOW(popup), GTK_WIN_POS_MOUSE);
+    
+ 
+    gtk_widget_new(GTK_TYPE_LABEL, "GtkWidget::parent", popup,
+                                  "GtkLabel::label", buf,
+                                  "GtkWidget::visible", TRUE,
+                                  NULL);
+    gtk_widget_show(popup);
+    gdk_pointer_grab(popup->window, TRUE, GDK_BUTTON_RELEASE_MASK,
+                    NULL, NULL, event->time);
+    gtk_grab_add(popup);
+    g_signal_connect_after(popup, "button_release_event",
+                           G_CALLBACK(show_info_button_release), NULL);
+  }
+  return FALSE;
+}
+
+/**************************************************************************
  obvious...
 **************************************************************************/
 void sound_bell(void)
diff -Nur -Xfreeciv-changed/diff_ignore 
freeciv-cvs-Apr-21/client/gui-win32/gui_main.c 
freeciv-changed/client/gui-win32/gui_main.c
--- freeciv-cvs-Apr-21/client/gui-win32/gui_main.c      2003-02-27 
07:01:01.000000000 +0100
+++ freeciv-changed/client/gui-win32/gui_main.c 2003-04-24 18:06:06.000000000 
+0200
@@ -557,6 +557,14 @@
 
 
 /**************************************************************************
+ Update Connected Users list in the pregame state.
+**************************************************************************/
+void update_conn_list_dialog(void)
+{
+       /* PORTME */
+}
+
+/**************************************************************************
 
 **************************************************************************/
 void
diff -Nur -Xfreeciv-changed/diff_ignore 
freeciv-cvs-Apr-21/client/gui-xaw/gui_main.c 
freeciv-changed/client/gui-xaw/gui_main.c
--- freeciv-cvs-Apr-21/client/gui-xaw/gui_main.c        2003-02-27 
07:01:02.000000000 +0100
+++ freeciv-changed/client/gui-xaw/gui_main.c   2003-04-24 18:06:06.000000000 
+0200
@@ -730,6 +730,14 @@
 }
 
 /**************************************************************************
+ Update Connected Users list in the pregame state.
+**************************************************************************/
+void update_conn_list_dialog(void)
+{
+       /* PORTME */
+}
+
+/**************************************************************************
 ...
 **************************************************************************/
 void sound_bell(void)
diff -Nur -Xfreeciv-changed/diff_ignore 
freeciv-cvs-Apr-21/client/include/gui_main_g.h 
freeciv-changed/client/include/gui_main_g.h
--- freeciv-cvs-Apr-21/client/include/gui_main_g.h      2002-08-25 
08:53:22.000000000 +0200
+++ freeciv-changed/client/include/gui_main_g.h 2003-04-24 18:06:32.000000000 
+0200
@@ -19,6 +19,7 @@
 
 void ui_init(void);
 void ui_main(int argc, char *argv[]);
+void update_conn_list_dialog(void);
 void sound_bell(void);
 void add_net_input(int);
 void remove_net_input(void);
diff -Nur -Xfreeciv-changed/diff_ignore freeciv-cvs-Apr-21/client/packhand.c 
freeciv-changed/client/packhand.c
--- freeciv-cvs-Apr-21/client/packhand.c        2003-04-18 06:57:02.000000000 
+0200
+++ freeciv-changed/client/packhand.c   2003-04-24 18:06:06.000000000 +0200
@@ -1445,6 +1445,7 @@
     sz_strlcpy(pconn->capability, pinfo->capability);
   }
   update_players_dialog();
+  update_conn_list_dialog();
 }
 
 /*************************************************************************
diff -Nur -Xfreeciv-changed/diff_ignore freeciv-cvs-Apr-21/server/connecthand.c 
freeciv-changed/server/connecthand.c
--- freeciv-cvs-Apr-21/server/connecthand.c     2003-04-13 06:57:19.000000000 
+0200
+++ freeciv-changed/server/connecthand.c        2003-04-24 18:06:06.000000000 
+0200
@@ -64,9 +64,10 @@
 
   /* "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);
+
   /* introduce the server to the connection */
   if (my_gethostname(hostname, sizeof(hostname)) == 0) {
     notify_conn(dest, _("Welcome to the %s Server running at %s port %d."),

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