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

On 26/08/07, Pepeto _ <[EMAIL PROTECTED]> wrote:
>
> When you reload a ruleset with more nations than the previous (for
> example civ1 -> civ2), you get a lot of "1: handle_ruleset_nation() bad
> nation %d.". It seems that the nations rulesets are sent both. A first
> time before the ruleset control packet (this one is not good), a second
> time after.
>
> Sometimes I got a client crash about nations too, but i didn't find yet
> how reproduce this crash yet.
>
> In server/srv_main.c, init_available_nations(), line 1329:
>   if (game.est_connections) {
>     send_ruleset_nations(game.est_connections);
>   }
> Are this lines really useful? I tried to remove them, i didn't get any
> strange effect yet.


 Patch


 - ML

diff -Nurd -X.diff_ignore freeciv/server/savegame.c freeciv/server/savegame.c
--- freeciv/server/savegame.c	2007-08-17 23:34:39.000000000 +0300
+++ freeciv/server/savegame.c	2007-08-28 22:55:58.000000000 +0300
@@ -3961,6 +3961,12 @@
     /* Initialize nations we loaded from rulesets. This has to be after
      * map loading and before we seek nations for players */
     init_available_nations();
+    if (game.est_connections) {
+      /* Update client knowledge about available nations after
+       * init_available_nations() may have marked some of them unavailable
+       * in this scenario */
+      send_ruleset_nations(game.est_connections);
+    }
 
     players_iterate(pplayer) {
       player_load(pplayer, pplayer->player_no, file, improvement_order,
diff -Nurd -X.diff_ignore freeciv/server/srv_main.c freeciv/server/srv_main.c
--- freeciv/server/srv_main.c	2007-08-22 03:26:25.000000000 +0300
+++ freeciv/server/srv_main.c	2007-08-28 22:43:24.000000000 +0300
@@ -1326,9 +1326,6 @@
       }
     }
   } nations_iterate_end;
-  if (game.est_connections) {
-    send_ruleset_nations(game.est_connections);
-  }
 }
 
 /**************************************************************************
_______________________________________________
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev

Reply via email to