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

In 2.0, when a user join and start observing while SELECT_RACES_STATE, his 
client crash because ruleset infos are not sent:
0: Cannot find any palace building
0: Cannot find any land defend building
civclient: unittype.c:89: get_unit_type:  l'assertion « id >= 0 && id < 200 
&& id < game.num_unit_types » a échoué.

I propose:
diff -aurd freeciv-2.0.9/server/stdinhand.c test/server/stdinhand.c
--- freeciv-2.0.9/server/stdinhand.c    2007-02-10 03:06:30.000000000 +0100
+++ test/server/stdinhand.c     2007-06-17 22:21:40.000000000 +0200
@@ -2803,8 +2803,14 @@
     send_diplomatic_meetings(pconn);
     send_packet_thaw_hint(pconn);
     send_packet_start_turn(pconn);
+  } else if (server_state == SELECT_RACES_STATE) {
+    send_packet_freeze_hint(pconn);
+    send_rulesets(&pconn->self);
+    send_player_info(NULL, NULL);
+    send_packet_thaw_hint(pconn);
   }

+
   cmd_reply(CMD_OBSERVE, caller, C_OK, _("%s now observes %s"),
             pconn->username, pplayer->name);

Sorry for the french messages.

_________________________________________________________________
Windows Live Messenger sur i-mode™ : dialoguez avec vos amis depuis votre 
mobile comme sur PC ! http://mobile.live.fr/messenger/bouygues/

diff -aurd freeciv-2.0.9/server/stdinhand.c test/server/stdinhand.c
--- freeciv-2.0.9/server/stdinhand.c	2007-02-10 03:06:30.000000000 +0100
+++ test/server/stdinhand.c	2007-06-17 22:21:40.000000000 +0200
@@ -2803,8 +2803,14 @@
     send_diplomatic_meetings(pconn);
     send_packet_thaw_hint(pconn);
     send_packet_start_turn(pconn);
+  } else if (server_state == SELECT_RACES_STATE) {
+    send_packet_freeze_hint(pconn);
+    send_rulesets(&pconn->self);
+    send_player_info(NULL, NULL);
+    send_packet_thaw_hint(pconn);
   }
 
+
   cmd_reply(CMD_OBSERVE, caller, C_OK, _("%s now observes %s"),
             pconn->username, pplayer->name);

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

Reply via email to