Complete.Org: Mailing Lists: Archives: freeciv-dev: November 2004:
[Freeciv-Dev] (PR#10895) bugreport for 2.0.0-beta3 version
Home

[Freeciv-Dev] (PR#10895) bugreport for 2.0.0-beta3 version

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: ph@xxxxxxxxxx
Subject: [Freeciv-Dev] (PR#10895) bugreport for 2.0.0-beta3 version
From: "Mateusz Stefek" <mstefek@xxxxxxxxx>
Date: Mon, 8 Nov 2004 06:57:37 -0800
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=10895 >

> [ph@xxxxxxxxxx - Fri Nov 05 20:26:05 2004]:
> 
> Dear Freeciv team,
> 
> I've just installed the beta3 version and I'm starting the server using:
> 
> civserver -f /usr/local/share/freeciv/scenario/europe-200x100-v2.sav
> 
> After starting the civclient and connecting to the local server, I start 
> the game with the 'start' command from the server prompt. On the client 
> the nation selection window pops up.
> Most of the nations are disabled (shaded in gray), which seems to be a 
> consequence of the map I selected when starting the server. I've got no 
> problem with that.
> But if I click on the "Fictional Slider" the civclient hangs (GUI window 
> isn't redrawn).
> 
> Best Regards,
> Paul Heinzlreiter
> 
Here's a fix for your problem.

While I was testing it i found very serious bug in the server: it
doesn't check if the nation selected by a client is available.
The second patch fixes it. I'm applying it immediately

--
mateusz
--- freeorig/server/srv_main.c  2004-11-01 12:32:30.000000000 +0100
+++ freeciv/server/srv_main.c   2004-11-07 16:43:50.000000000 +0100
@@ -1131,7 +1131,8 @@
   /* check sanity of the packet sent by client */
   if (nation_no < 0 || nation_no >= game.nation_count ||
       city_style < 0 || city_style >= game.styles_count ||
-      city_styles[city_style].techreq != A_NONE) {
+      city_styles[city_style].techreq != A_NONE
+      || !nations_available[nation_no]) {
     return;
   }
 
--- freeorig/client/gui-gtk/dialogs.c   2004-10-18 09:05:37.000000000 +0200
+++ freeciv/client/gui-gtk/dialogs.c    2004-11-07 16:37:08.000000000 +0100
@@ -1756,7 +1756,8 @@
   int class_id = selected_class;
   int nations_in_class = g_list_length(sorted_races_list[class_id]);
   int index;
-
+  int tries = 0;
+  
   /* try to find a free nation */
   while (TRUE) {
     index = myrand(nations_in_class);
@@ -1765,6 +1766,7 @@
     if (GTK_WIDGET_SENSITIVE(races_toggles[class_id][index])) {
       break;
     }
+    if (tries++ > 1000) return;
   }
 
   /* initialize nation toggle array */

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