Complete.Org: Mailing Lists: Archives: freeciv-dev: April 2005:
[Freeciv-Dev] (PR#12936) put 'ready' into the conn dialog
Home

[Freeciv-Dev] (PR#12936) put 'ready' into the conn dialog

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Subject: [Freeciv-Dev] (PR#12936) put 'ready' into the conn dialog
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Fri, 29 Apr 2005 15:05:19 -0700
Reply-to: bugs@xxxxxxxxxxx

<URL: http://bugs.freeciv.org/Ticket/Display.html?id=12936 >

This patch adds the pplayer->is_started info into the conn list in the
pregame screen.  See PR#12838.

The behavior is pretty straightforward.  I had to add some code to send
out player info when a connection connects or when is_started is changed.

After this, the next step is to reset is_started when "something
important" changes (like a player connecting or leaving, a setting being
changed, etc).

-jason

Index: client/packhand.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/packhand.c,v
retrieving revision 1.495
diff -u -r1.495 packhand.c
--- client/packhand.c   23 Apr 2005 17:40:23 -0000      1.495
+++ client/packhand.c   29 Apr 2005 22:01:45 -0000
@@ -1545,6 +1545,8 @@
     city_report_dialog_update();
   }
 
+  pplayer->is_started = pinfo->is_started;
+
   if (pplayer == game.player_ptr
       && pplayer->phase_done != pinfo->phase_done) {
     update_turn_done_button_state();
@@ -1594,6 +1596,7 @@
   /* Just about any changes above require an update to the intelligence
    * dialog. */
   update_intel_dialog(pplayer);
+  update_conn_list_dialog();
 }
 
 /**************************************************************************
Index: client/gui-gtk-2.0/gui_main.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk-2.0/gui_main.c,v
retrieving revision 1.119
diff -u -r1.119 gui_main.c
--- client/gui-gtk-2.0/gui_main.c       28 Apr 2005 04:08:28 -0000      1.119
+++ client/gui-gtk-2.0/gui_main.c       29 Apr 2005 22:01:46 -0000
@@ -1229,8 +1229,13 @@
   if (get_client_state() != CLIENT_GAME_RUNNING_STATE) {
     gtk_list_store_clear(conn_model);
     conn_list_iterate(game.est_connections, pconn) {
+      bool is_started = pconn->player ? pconn->player->is_started : FALSE;
+
       gtk_list_store_append(conn_model, &it);
-      gtk_list_store_set(conn_model, &it, 0, pconn->username, -1);
+      gtk_list_store_set(conn_model, &it,
+                        0, pconn->username,
+                        1, is_started,
+                        -1);
     } conn_list_iterate_end;
   }
 }
Index: client/gui-gtk-2.0/pages.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk-2.0/pages.c,v
retrieving revision 1.25
diff -u -r1.25 pages.c
--- client/gui-gtk-2.0/pages.c  11 Apr 2005 22:11:41 -0000      1.25
+++ client/gui-gtk-2.0/pages.c  29 Apr 2005 22:01:47 -0000
@@ -1035,15 +1035,21 @@
   gtk_box_pack_start(GTK_BOX(vbox), align, FALSE, FALSE, 8);
 
 
-  conn_model = gtk_list_store_new(1, G_TYPE_STRING); 
+  conn_model = gtk_list_store_new(2, G_TYPE_STRING, G_TYPE_BOOLEAN); 
 
   view = gtk_tree_view_new_with_model(GTK_TREE_MODEL(conn_model));
   g_object_unref(conn_model);
-  gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(view), FALSE);
+  gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(view), TRUE);
 
   rend = gtk_cell_renderer_text_new();
     gtk_tree_view_insert_column_with_attributes(GTK_TREE_VIEW(view),
-       -1, NULL, rend, "text", 0, NULL);
+                                               -1, _("Name"), rend,
+                                               "text", 0, NULL);
+
+  rend = gtk_cell_renderer_toggle_new();
+  gtk_tree_view_insert_column_with_attributes(GTK_TREE_VIEW(view),
+                                             -1, _("Ready"), rend,
+                                             "active", 1, NULL);
 
   g_signal_connect(view, "button-press-event",
                   G_CALLBACK(show_conn_popup), NULL);
Index: common/capstr.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/capstr.c,v
retrieving revision 1.237
diff -u -r1.237 capstr.c
--- common/capstr.c     29 Apr 2005 17:58:10 -0000      1.237
+++ common/capstr.c     29 Apr 2005 22:01:47 -0000
@@ -82,7 +82,7 @@
  *     as long as possible.  We want to maintain network compatibility with
  *     the stable branch for as long as possible.
  */
-#define CAPABILITY "+Freeciv.Devel.2005.Apr.29"
+#define CAPABILITY "+Freeciv.Devel.2005.Apr.29b"
 
 void init_our_capability(void)
 {
Index: common/packets.def
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/packets.def,v
retrieving revision 1.108
diff -u -r1.108 packets.def
--- common/packets.def  23 Apr 2005 04:26:57 -0000      1.108
+++ common/packets.def  29 Apr 2005 22:01:47 -0000
@@ -559,6 +559,7 @@
   UINT8 city_style;
   NATION nation;
   TEAM team;
+  BOOL is_started;
   BOOL phase_done;
   TURN nturns_idle;
   BOOL is_alive;
Index: server/connecthand.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/connecthand.c,v
retrieving revision 1.43
diff -u -r1.43 connecthand.c
--- server/connecthand.c        29 Apr 2005 18:14:40 -0000      1.43
+++ server/connecthand.c        29 Apr 2005 22:01:48 -0000
@@ -183,6 +183,7 @@
   send_conn_info(dest, game.est_connections);
   conn_list_append(game.est_connections, pconn);
   send_conn_info(game.est_connections, dest);
+  send_player_info_c(NULL, dest);
   (void) send_server_info_to_metaserver(META_INFO);
 }
 
Index: server/plrhand.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/plrhand.c,v
retrieving revision 1.366
diff -u -r1.366 plrhand.c
--- server/plrhand.c    15 Apr 2005 05:22:52 -0000      1.366
+++ server/plrhand.c    29 Apr 2005 22:01:48 -0000
@@ -1453,6 +1453,7 @@
   packet->is_male=plr->is_male;
   packet->is_observer=plr->is_observer;
   packet->team = plr->team;
+  packet->is_started = plr->is_started;
   packet->city_style=plr->city_style;
 
   packet->is_alive=plr->is_alive;
@@ -1612,6 +1613,9 @@
 static enum plr_info_level player_info_level(struct player *plr,
                                             struct player *receiver)
 {
+  if (server_state < RUN_GAME_STATE) {
+    return INFO_MINIMUM;
+  }
   if (plr == receiver) {
     return INFO_FULL;
   }
Index: server/stdinhand.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/stdinhand.c,v
retrieving revision 1.400
diff -u -r1.400 stdinhand.c
--- server/stdinhand.c  29 Apr 2005 18:14:40 -0000      1.400
+++ server/stdinhand.c  29 Apr 2005 22:01:49 -0000
@@ -3673,6 +3673,7 @@
        * than once to remind other people to start (which is a good thing
        * until somebody does it too much and it gets labeled as spam). */
       caller->player->is_started = TRUE;
+      send_player_info(caller->player, NULL);
       players_iterate(pplayer) {
        if (pplayer->is_connected) {
          if (pplayer->is_started) {

[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#12936) put 'ready' into the conn dialog, Jason Short <=