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

Now that I've had some sleep....

Madeline Book wrote:
> Yes, I was afraid of something like that. So what are the
> semantics of client.playing?

It is set from game.info.player_idx -- exclusively.


> Is it supposed to be NULL 
> when the client is an observer (unlike aconnection.player 
> apparently) and during pregame before the user has picked 
> his nation and set his player name?

Had never noticed aconnection.player, and have no idea about its purpose.
Certainly, aconnection.player is a bad idea.  That isn't properly updated
as players are removed (before start) -- unlike client.playing.

Yet Another Data Duplication headache.


> What then is supposed
> to be passed to popup_races_dialog?
> 
Heck, you shouldn't be able to select a race before player is assigned.

Compare XAW:

   if (client.playing) {
     popup_races_dialog(client.playing);
   }

With GTK2:

   if (aconnection.player) {
     popup_races_dialog(client.playing);
   } else if (game.info.is_new_game) {
     send_chat("/take -");
     popup_races_dialog(client.playing);
   }


I added the last call in PR#39927 back in December, both 2.1 and 2.2, so
that's not within the past 2 weeks:

      send_chat("/take -");
+    popup_races_dialog(game.player_ptr);


This aconnection.player change appeared in PR#16459, so perhaps Per can
explain:

  static void pick_nation_callback(GtkWidget *w, gpointer data)
  {
-  if (game.player_ptr) {
+  if (aconnection.player) {
      popup_races_dialog(game.player_ptr);
+  } else if (game.info.is_new_game) {
+    send_chat("/take -");
    }
  }


For connection dialog, another call to popup_races_dialog() with another
parameter was added even earlier in PR#15688, so perhaps Jason can explain:

+static void conn_menu_nation_chosen(GtkMenuItem *menuitem, gpointer data)
+{
+  popup_races_dialog(conn_menu_player);
+}

So, a third static copy of player, always a joy to debug! :-(

Yet Another Data Duplication headache.


> No, I just connected to a server running on my local
> machine and tried to start the game (incidentally doing
> it this way the "Start" button is also inactive, which
> might indicate that there is some deeper problem).
> 
Probably just sensitive to whether you've picked a Nation yet.


> 1. Start a server process (e.g. with ./ser in the build
> directory).
> 
> 2. Start a client process (e.g. with "./civ -a"
> in the build directory).
> 
> 3. Client started in (2) connects to the server started
> in (1).
> 
Not on my setup.  It hangs in some silly reverse DNS lookup, because I'm
running behind a firewall -- as all good developers always do!

Depending on a reverse DNS lookup is a bad idea, as there are many users
that run NAT with RFC-1918 addresses, and it is an unreasonable load on
(wearing another hat) our root servers.

Depending on a DNS lookup of any kind completing is a terrible idea....

But that's another ticket.  I'm pretty sure there's an existing one.


> 4. Now as the client, press the button labelled "Pick Nation".
> 
Sounds like that should be sensitive to whether you have a player yet.


> 5. The races (a.k.a. nations) dialog pops-up.
> 
> 6. Click any nation in the list (e.g. Assyrian).
> 
> 7. The button labelled "Ok" becomes active.
> 
> 8. Press the button labelled "Ok".
> 
> 9. The assertion failure occurs.
> 


> A few weeks ago branch S2_2 did not experience this assertion
> failure. As I was using it in this exact manner for working
> on the editor.
> 
Since it doesn't occur with the more usual New Game page, I suggest that
you try it for your Editor experiments, until this is tracked down.

Or you could try checking out earlier revisions by binary search until you
find the revision number that caused the problem....

Until somebody does that, it's unlikely to be fixed.



_______________________________________________
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev

Reply via email to