[Freeciv-Dev] (PR#38001) [Patch] Saving scenarios

2007-03-12 Thread Marko Lindqvist

URL: http://bugs.freeciv.org/Ticket/Display.html?id=38001 

 Scenarios are not exactly same thing as savegame from running game.
In that sense our editor is not capable of producing scenarios.
 This patch provides some framework for saving games as scenarios.

 - When scenario is loaded, contents of [scenario] are read also, and stored
 - Server sends [scenario] information to client (which does nothing with it)
 - Game saving code differentiates between scenario saves and normal saves
 - Scenario saves include [scenario] information, but are ATM
otherwise identical to normal saves
 - Scenario save is initiated by new save_scenario -packet from client
 - Gtk client editor has Save Scenario dialog and it can send
save_scenario packet
 - Server has new commandline option '--scenarios' for defining
directory where scenarios are saved
 - Server launched from client saves scenarios to ~/.freeciv/scenarios
 - Scenario saving will success only if [scenario] information is set.
Currently it is only set when loading existing scenario

 Since editor cannot set [scenario] data, only possible use for this
for now is updating old scenarios. One can load old scenario and then
save it via 'Save Scenario' and [scenario] remains intact. But even
that is not advisable as game is otherwise saved as running game.

 Is it so that delta code is unable to create packets that are sent
both from server to client and client to server? I tried to define
scenario_info packet as one (server sends initial information to
client, client updates) but couldn't make it compile. Currently that
packet is only used when server sends initial information to client.

 Loading distributed scenario and then saving it causes gettext
marking for scenario name and description to disappear.


 - ML

diff -Nurd -X.diff_ignore freeciv/client/connectdlg_common.c freeciv/client/connectdlg_common.c
--- freeciv/client/connectdlg_common.c	2007-03-05 21:12:22.0 +0200
+++ freeciv/client/connectdlg_common.c	2007-03-12 09:29:42.0 +0200
@@ -240,6 +240,8 @@
 argv[argc++] = -e;
 argv[argc++] = --saves;
 argv[argc++] = ~/.freeciv/saves;
+argv[argc++] = --scenarios;
+argv[argc++] = ~/.freeciv/scenarios;
 if (logfile) {
   argv[argc++] = --debug;
   argv[argc++] = 3;
diff -Nurd -X.diff_ignore freeciv/client/gui-gtk-2.0/menu.c freeciv/client/gui-gtk-2.0/menu.c
--- freeciv/client/gui-gtk-2.0/menu.c	2007-03-05 21:11:59.0 +0200
+++ freeciv/client/gui-gtk-2.0/menu.c	2007-03-12 09:37:37.0 +0200
@@ -164,6 +164,7 @@
   MENU_EDITOR_TOGGLE,
   MENU_EDITOR_TOOLS,
   MENU_EDITOR_RECALC_BORDERS,
+  MENU_EDITOR_SAVE,
 
   MENU_HELP_LANGUAGES,
   MENU_HELP_CONNECTING,
@@ -233,7 +234,7 @@
 popup_settable_options_dialog();
 break;
   case MENU_GAME_SAVE_GAME:
-popup_save_dialog();
+popup_save_dialog(FALSE);
 break;
   case MENU_GAME_SAVE_QUICK:
 send_save_game(NULL);
@@ -611,6 +612,9 @@
   case MENU_EDITOR_RECALC_BORDERS:
 key_editor_recalc_borders();
 break;
+  case MENU_EDITOR_SAVE:
+popup_save_dialog(TRUE);
+break;
   }
 }
 
@@ -950,6 +954,8 @@
 editor_menu_callback, MENU_EDITOR_TOOLS },
   { / N_(_Editor) / N_(_Recalculate Borders), NULL,
 editor_menu_callback, MENU_EDITOR_RECALC_BORDERS },
+  { / N_(_Editor) / N_(_Save Scenario), NULL,
+editor_menu_callback, MENU_EDITOR_SAVE, StockItem, GTK_STOCK_SAVE_AS },
 
   /* Help menu ... */
   { / N_(_Help),	NULL,
@@ -1351,6 +1357,8 @@
 			can_conn_edit(aconnection));
 menus_set_sensitive(main/_Editor/_Recalculate Borders,
 			can_conn_edit(aconnection));
+menus_set_sensitive(main/_Editor/_Save Scenario,
+can_conn_edit(aconnection));
 menus_set_active(main/_Editor/Editing Mode,
 		 can_conn_edit(aconnection));
 
diff -Nurd -X.diff_ignore freeciv/client/gui-gtk-2.0/pages.c freeciv/client/gui-gtk-2.0/pages.c
--- freeciv/client/gui-gtk-2.0/pages.c	2007-03-05 21:11:59.0 +0200
+++ freeciv/client/gui-gtk-2.0/pages.c	2007-03-12 09:18:21.0 +0200
@@ -81,6 +81,8 @@
 
 static GtkWidget *ruleset_combo;
 
+static bool save_scenario = FALSE;
+
 /**
   spawn a server, if there isn't one, using the default settings.
 **/
@@ -1645,14 +1647,14 @@
 /**
   update the saved games list store.
 **/
-static void update_saves_store(GtkListStore *store)
+static void update_saves_store(GtkListStore *store, const char *dir)
 {
   struct datafile_list *files;
 
   gtk_list_store_clear(store);
 
   /* search for user saved games. */
-  files = datafilelist_infix(saves, .sav, FALSE);
+  files = datafilelist_infix(dir, .sav, FALSE);
   datafile_list_iterate(files, pfile) {
 GtkTreeIter it;
 
@@ -1690,7 +1692,7 

Re: [Freeciv-Dev] (PR#35961) nation legends in help system

2007-03-12 Thread Egor Vyscrebentsov

URL: http://bugs.freeciv.org/Ticket/Display.html?id=35961 

On Thu, 22 Feb 2007 Daniel Markstedt wrote:

 On 2/22/07, Egor Vyscrebentsov evyscr@ wrote:
 (...)
 
  PS [2Daniel? and others]: Maybe it would be nice to have more long
  nation legends, that will be accessible through in-game help?

 Indeed. Many legends have been improved recently, and more are on the way.

 Replying to this into a wishlist ticket I made for this very thing. It
 should be quite trivial, programming-wise and I might give it a go
 this weekend.

Attached is a pre-version of patch. Legends are used as a help text.
Only gui-xaw supported.

Ah, and main Nations section requires a better text ;)

Hope to make gui-gtk2 part at evenight.

PS. Do we want to have helptext field in data/nation/*.ruleset ?

-- 
Thanks, evyscr

Index: data/helpdata.txt
===
--- data/helpdata.txt	(revision 12711)
+++ data/helpdata.txt	(working copy)
@@ -12,7 +12,7 @@
 ; 'generate' = means replace this node with generated list of game
 ;	   elements; current categories are: 
 ;	  Units, Improvements, Wonders, Techs, 
-;		  Terrain, Governments
+;		  Terrain, Governments, Nations
 ;
 ; Within the text, the help engine recognizes a few generated tables.  
 ; These are generated by the help engine, and inserted at the point of 
@@ -1451,3 +1451,12 @@
 that will arrive earlier.  The only other option is to capture \
 their capital.\
 )
+
+[help_nations]
+name = _(Nations)
+text = _(\
+Daniel, please, write something here ;)\
+)
+
+[help_gen_nations]
+generate = Nations
Index: client/gui-xaw/menu.c
===
--- client/gui-xaw/menu.c	(revision 12711)
+++ client/gui-xaw/menu.c	(working copy)
@@ -246,6 +246,7 @@
 { { N_(Government), 0   },  , MENU_HELP_GOVERNMENT, 0 },
 { { N_(Happiness), 0},  , MENU_HELP_HAPPINESS, 0 },
 { { N_(Space Race), 0   },  , MENU_HELP_SPACE_RACE, 0 },
+{ { N_(Nations), 0  },  , MENU_HELP_NATIONS, 0 },
 { { 0 },  , MENU_SEPARATOR_LINE, 0 },
 { { N_(Copying), 0  },  , MENU_HELP_COPYING, 0 },
 { { N_(About), 0},  , MENU_HELP_ABOUT, 0 },
@@ -882,6 +883,9 @@
   case MENU_HELP_SPACE_RACE:
 popup_help_dialog_string(HELP_SPACE_RACE_ITEM);
 break;
+  case MENU_HELP_NATIONS:
+popup_help_dialog_string(HELP_NATIONS_ITEM);
+break;
   case MENU_HELP_COPYING:
 popup_help_dialog_string(HELP_COPYING_ITEM);
 break;
Index: client/gui-xaw/menu.h
===
--- client/gui-xaw/menu.h	(revision 12711)
+++ client/gui-xaw/menu.h	(working copy)
@@ -129,6 +129,7 @@
   MENU_HELP_GOVERNMENT,
   MENU_HELP_HAPPINESS,
   MENU_HELP_SPACE_RACE,
+  MENU_HELP_NATIONS,
   MENU_HELP_COPYING,
   MENU_HELP_ABOUT,
 
Index: client/gui-xaw/helpdlg.c
===
--- client/gui-xaw/helpdlg.c	(revision 12711)
+++ client/gui-xaw/helpdlg.c	(working copy)
@@ -1059,6 +1059,25 @@
   XtVaSetValues(help_text, XtNstring, buf, NULL);
 }
 
+/
+  ...
+/
+static void help_update_nation(const struct help_item *pitem,
+			   char *title,
+			   struct nation_type *pnation)
+{
+  char buf[4096];
+
+  if (!pnation) {
+strcat(buf, pitem-text);
+  } else {
+helptext_nation(buf, sizeof(buf), pnation, pitem-text);
+  }
+  create_help_page(HELP_TEXT);
+  set_title_topic(pitem);
+  XtVaSetValues(help_text, XtNstring, buf, NULL);
+}
+
 /**
 ...
 **/
@@ -1096,6 +1115,9 @@
   case HELP_GOVERNMENT:
 help_update_government(pitem, top, find_government_by_name(top));
 break;
+  case HELP_NATION:
+help_update_nation(pitem, top, find_nation_by_name(top));
+break;
   case HELP_TEXT:
   default:
 /* it was a pure text item */ 
Index: client/include/helpdlg_g.h
===
--- client/include/helpdlg_g.h	(revision 12711)
+++ client/include/helpdlg_g.h	(working copy)
@@ -15,7 +15,7 @@
 
 enum help_page_type { HELP_ANY, HELP_TEXT, HELP_UNIT, HELP_IMPROVEMENT,
 		  HELP_WONDER, HELP_TECH, HELP_TERRAIN,
-  HELP_GOVERNMENT, HELP_LAST };
+  HELP_GOVERNMENT, HELP_NATION, HELP_LAST };
 
 void popup_help_dialog_string(const char *item);
 void popup_help_dialog_typed(const char *item, enum help_page_type);
@@ -38,6 +38,7 @@
 #define HELP_GOVERNMENT_ITEM Government
 #define HELP_HAPPINESS_ITEM Happiness
 #define HELP_SPACE_RACE_ITEM Space Race
+#define HELP_NATIONS_ITEM Nations
 #define 

Re: [Freeciv-Dev] (PR#37980) [Patch] Server decides if wall gfx should be drawn

2007-03-12 Thread Marko Lindqvist

URL: http://bugs.freeciv.org/Ticket/Display.html?id=37980 

On 3/12/07, Per I. Mathisen [EMAIL PROTECTED] wrote:

 On Sun, 11 Mar 2007, Marko Lindqvist wrote:
  First step toward fixing #37977. Server decides if wall gfx should be
  drawn and sends that information to client.
  This does change how Great Wall effects appear. Previously client
  knew that even fogged cities get walls when player builds Great Wall
  and lose walls when it gets obsolete. Now player knowledge about
  fogged cities is not updated.
 
  This patch is for trunk only as it adds mandatory capability.

 How does this work right now? Do all players know the defense effects of
 other players' cities?

 Accidentally other players see city walls just correctly (in default
ruleset). Everyone knows about wonders (Great Wall) and about City
Walls (since it has VisibleByOthers flag), but they do not know
about any other defense effects.


 - ML



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


Re: [Freeciv-Dev] (PR#37851) [Patch] Fix AI evaluation of EFT_UPGRADE_UNIT

2007-03-12 Thread Marko Lindqvist

URL: http://bugs.freeciv.org/Ticket/Display.html?id=37851 

On 3/9/07, Marko Lindqvist [EMAIL PROTECTED] wrote:

  Evaluation of EFT_UPGRADE_UNIT multiplies value of earlier effects.
 Fix attached. Affects S2_1 also.

 S2_1 version


 - ML

diff -Nurd -X.diff_ignore freeciv/ai/aicity.c freeciv/ai/aicity.c
--- freeciv/ai/aicity.c	2007-03-05 19:14:29.0 +0200
+++ freeciv/ai/aicity.c	2007-03-12 14:05:01.0 +0200
@@ -569,13 +569,12 @@
 		+ ai-stats.units.air);
 	  break;
 	case EFT_UPGRADE_UNIT:
-	  v += ai-stats.units.upgradeable;
 	  if (amount == 1) {
-	v *= 2;
+v += ai-stats.units.upgradeable * 2;
 	  } else if (amount == 2) {
-	v *= 3;
+v += ai-stats.units.upgradeable * 3;
 	  } else {
-	v *= 4;
+v += ai-stats.units.upgradeable * 4;
 	  }
 	  break;
 	case EFT_DEFEND_BONUS:
___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] (PR#38011) [Bug] Gtk help: improvement requirements

2007-03-12 Thread Marko Lindqvist

URL: http://bugs.freeciv.org/Ticket/Display.html?id=38011 

 gtk help for improvements creates hyperlink to just one requirement,
first in list. Further, requirement type is not checked, hyperlink
always points to some tech.


 - ML



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


[Freeciv-Dev] (PR#37137) Split of Korean ruleset

2007-03-12 Thread Daniel Markstedt

URL: http://bugs.freeciv.org/Ticket/Display.html?id=37137 

Attaching a Emirati (UAE) nation to this ticket. Emailed to me by Daniil
Ivanov. Some stylistic changes by me.

 ~Daniel



uae.tar.gz
Description: application/gzip
___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] (PR#38016) [Patch] Gtk client selects base type by gui_type

2007-03-12 Thread Marko Lindqvist

URL: http://bugs.freeciv.org/Ticket/Display.html?id=38016 

 gtk client uses get_base_by_gui_type() instead of using hardcoded
base ids BASE_FORTRESS and BASE_AIRBASE.


 - ML

diff -Nurd -X.diff_ignore freeciv/client/control.c freeciv/client/control.c
--- freeciv/client/control.c	2007-03-12 16:23:02.0 +0200
+++ freeciv/client/control.c	2007-03-12 16:27:17.0 +0200
@@ -2369,8 +2369,12 @@
 void key_unit_airbase(void)
 {
   unit_list_iterate(get_units_in_focus(), punit) {
-if (can_unit_do_activity_base(punit, BASE_AIRBASE)) {
-  request_new_unit_activity_base(punit, BASE_AIRBASE);
+struct base_type *pbase;
+
+pbase = get_base_by_gui_type(BASE_GUI_AIRBASE, punit, punit-tile);
+
+if (pbase) {
+  request_new_unit_activity_base(punit, pbase-id);
 }
   } unit_list_iterate_end;
 }
@@ -2440,8 +2444,12 @@
 void key_unit_fortress(void)
 {
   unit_list_iterate(get_units_in_focus(), punit) {
-if (can_unit_do_activity_base(punit, BASE_FORTRESS)) {
-  request_new_unit_activity_base(punit, BASE_FORTRESS);
+struct base_type *pbase;
+
+pbase = get_base_by_gui_type(BASE_GUI_FORTRESS, punit, punit-tile);
+
+if (pbase) {
+  request_new_unit_activity_base(punit, pbase-id);
 }
   } unit_list_iterate_end;
 }
diff -Nurd -X.diff_ignore freeciv/client/gui-gtk-2.0/menu.c freeciv/client/gui-gtk-2.0/menu.c
--- freeciv/client/gui-gtk-2.0/menu.c	2007-03-12 16:23:02.0 +0200
+++ freeciv/client/gui-gtk-2.0/menu.c	2007-03-12 16:40:47.0 +0200
@@ -442,10 +442,13 @@
 unit_list_iterate(get_units_in_focus(), punit) {
   /* FIXME: this can provide different actions for different units...
* not good! */
-  if (can_unit_do_activity_base(punit, BASE_FORTRESS))
+  struct base_type *pbase = get_base_by_gui_type(BASE_GUI_FORTRESS,
+ punit, punit-tile);
+  if (pbase) {
 	key_unit_fortress();
-  else
+  } else {
 	key_unit_fortify();
+  }
 } unit_list_iterate_end;
 break;
case MENU_ORDER_AIRBASE:
@@ -1392,11 +1395,11 @@
   menus_set_sensitive(main/_Orders/Transf_orm Terrain,
 			  can_units_do_activity(punits, ACTIVITY_TRANSFORM));
   menus_set_sensitive(main/_Orders/Build _Fortress,
-  (can_units_do_base(punits, BASE_FORTRESS)
+  (can_units_do_base_gui(punits, BASE_GUI_FORTRESS)
|| can_units_do_activity(punits,
 		ACTIVITY_FORTIFYING)));
   menus_set_sensitive(main/_Orders/Build Airbas_e,
-			  can_units_do_base(punits, BASE_AIRBASE));
+			  can_units_do_base_gui(punits, BASE_GUI_AIRBASE));
   menus_set_sensitive(main/_Orders/Clean _Pollution,
   (can_units_do_activity(punits, ACTIVITY_POLLUTION)
|| can_units_do(punits, can_unit_paradrop)));
diff -Nurd -X.diff_ignore freeciv/common/unitlist.c freeciv/common/unitlist.c
--- freeciv/common/unitlist.c	2007-03-12 16:23:02.0 +0200
+++ freeciv/common/unitlist.c	2007-03-12 16:40:33.0 +0200
@@ -125,6 +125,24 @@
 }
 
 /
+  Returns TRUE if any of the units can build base with given gui_type.
+/
+bool can_units_do_base_gui(const struct unit_list *punits,
+   enum base_gui_type base_gui)
+{
+  unit_list_iterate(punits, punit) {
+struct base_type *pbase = get_base_by_gui_type(base_gui, punit, punit-tile);
+
+if (pbase) {
+  /* Some unit can build base of given gui_type */
+  return TRUE;
+}
+  } unit_list_iterate_end;
+
+  return FALSE;
+}
+
+/
   Returns TRUE if any of the units can do the activity.
 /
 bool can_units_do_diplomat_action(const struct unit_list *punits,
diff -Nurd -X.diff_ignore freeciv/common/unitlist.h freeciv/common/unitlist.h
--- freeciv/common/unitlist.h	2007-03-12 16:23:02.0 +0200
+++ freeciv/common/unitlist.h	2007-03-12 16:32:50.0 +0200
@@ -59,6 +59,8 @@
 			   enum unit_activity activity);
 bool can_units_do_base(const struct unit_list *punits,
enum base_type_id base);
+bool can_units_do_base_gui(const struct unit_list *punits,
+   enum base_gui_type base_gui);
 bool can_units_do_diplomat_action(const struct unit_list *punits,
   enum diplomat_actions action);
 bool units_have_flag(const struct unit_list *punits, enum unit_flag_id flag,
___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] (PR#38017) [Patch] Savegame base compatibility based on gui_type

2007-03-12 Thread Marko Lindqvist

URL: http://bugs.freeciv.org/Ticket/Display.html?id=38017 

 When handling old ACTIVITY_FORTRESS and ACTIVITY_AIRBASE in
savegames, try to find matching base type based on gui_type instead of
hardcoded base ids BASE_FORTRESS and BASE_AIRBASE.


 - ML

diff -Nurd -X.diff_ignore freeciv/server/savegame.c freeciv/server/savegame.c
--- freeciv/server/savegame.c	2007-03-12 16:23:02.0 +0200
+++ freeciv/server/savegame.c	2007-03-12 17:05:39.0 +0200
@@ -1638,6 +1638,7 @@
 int nat_x, nat_y;
 const char* type_name;
 struct unit_type *type;
+struct base_type *pbase = NULL;
 
 type_name = secfile_lookup_str_default(file, NULL, 
player%d.u%d.type_by_name,
@@ -1700,13 +1701,22 @@
 }
 
 if (activity == ACTIVITY_FORTRESS) {
-  set_unit_activity_base(punit, BASE_FORTRESS);
+  pbase = get_base_by_gui_type(BASE_GUI_FORTRESS, punit, punit-tile);
 } else if (activity == ACTIVITY_AIRBASE) {
-  set_unit_activity_base(punit, BASE_AIRBASE);
+  pbase = get_base_by_gui_type(BASE_GUI_AIRBASE, punit, punit-tile);
+} else if (activity == ACTIVITY_BASE) {
+  /* This should currently not happen as ACTIVITY_BASE is saves as
+   * ACTIVITY_FORTRESS or ACTIVITY_AIRBASE. We don't know base type,
+   * let's use sensible fallback */
+  set_unit_activity_base(punit, BASE_FORTRESS);
 } else {
   set_unit_activity(punit, activity);
 }
 
+if (pbase) {
+  set_unit_activity_base(punit, pbase-id);
+}
+
 /* need to do this to assign/deassign settlers correctly -- Syela
  *
  * was punit-activity=secfile_lookup_int(file,
@@ -1797,6 +1807,7 @@
 	punit-has_orders = TRUE;
 	for (j = 0; j  len; j++) {
 	  struct unit_order *order = punit-orders.list[j];
+  struct base_type *pbase = NULL;
 
 	  if (orders_buf[j] == '\0' || dir_buf[j] == '\0'
 	  || act_buf[j] == '\0') {
@@ -1819,11 +1830,17 @@
 	  }
 
   if (order-activity == ACTIVITY_FORTRESS) {
-order-activity = ACTIVITY_BASE;
-order-base = BASE_FORTRESS;
+pbase = get_base_by_gui_type(BASE_GUI_FORTRESS, NULL, NULL);
+order-activity = ACTIVITY_IDLE; /* In case no matching gui_type found */
   } else if (order-activity == ACTIVITY_AIRBASE) {
+pbase = get_base_by_gui_type(BASE_GUI_AIRBASE, NULL, NULL);
+order-activity = ACTIVITY_IDLE; /* In case no matching gui_type found */
+  }
+
+  if (pbase) {
+/* Either ACTIVITY_FORTRESS or ACTIVITY_AIRBASE */
 order-activity = ACTIVITY_BASE;
-order-base = BASE_AIRBASE;
+order-base = pbase-id;
   }
 	}
   } else {
@@ -2933,12 +2950,15 @@
 activity = punit-activity;
 
 if (activity == ACTIVITY_BASE) {
-  if (punit-activity_base == BASE_FORTRESS) {
+  struct base_type *pbase;
+  pbase = base_type_get_by_id(punit-activity_base);
+
+  if (pbase-gui_type == BASE_GUI_FORTRESS) {
 activity = ACTIVITY_FORTRESS;
-  } else if (punit-activity_base == BASE_AIRBASE) {
+  } else if (pbase-gui_type == BASE_GUI_AIRBASE) {
 activity = ACTIVITY_AIRBASE;
   } else {
-freelog(LOG_ERROR, Unknown activity_base!);
+/* Gui type other. Make sensible fallback */
 activity = ACTIVITY_FORTRESS;
   }
 }
@@ -3010,13 +3030,15 @@
 	  break;
 	case ORDER_ACTIVITY:
   if (punit-orders.list[j].activity == ACTIVITY_BASE) {
-if (punit-orders.list[j].base == BASE_FORTRESS) {
+struct base_type *pbase;
+pbase = base_type_get_by_id(punit-orders.list[j].base);
+
+if (pbase-gui_type == BASE_GUI_FORTRESS) {
   act_buf[j] = activity2char(ACTIVITY_FORTRESS);
-} else if (punit-orders.list[j].base == BASE_AIRBASE) {
+} else if (pbase-gui_type == BASE_GUI_AIRBASE) {
   act_buf[j] = activity2char(ACTIVITY_AIRBASE);
 } else {
-  freelog(LOG_ERROR, Unknown base type in player_save);
-  /* Saving as fortress */
+  /* Saving others as fortress */
   act_buf[j] = activity2char(ACTIVITY_FORTRESS);
 }
   } else {
___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


Re: [Freeciv-Dev] (PR#38028) 2.0.9 STABLE cannot join games

2007-03-12 Thread Lauri Uotinen

URL: http://bugs.freeciv.org/Ticket/Display.html?id=38028 

Per I. Mathisen wrote:
 URL: http://bugs.freeciv.org/Ticket/Display.html?id=38028 

 On Mon, 12 Mar 2007, Lauri Uotinen wrote:
   
 FreeCiv stable release 2.0.9 cannot join games. It crashes instantly
 as you try to join a game. Verified with four different clients. The
 Linux version seems to be unaffected by this.
 

 So which clients on which platforms *are* affected?

- Per
   
I can't say. Atleast Windows XP and Windows 2000 stable 2.0.9
clients. We are using the standard packages and the same settings
that we used on last week.

-Lauri Uotinen



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


Re: [Freeciv-Dev] (PR#38028) 2.0.9 STABLE cannot join games

2007-03-12 Thread Lauri Uotinen

URL: http://bugs.freeciv.org/Ticket/Display.html?id=38028 

Update:
I just tested and it works now! Maybe it was some temporary bug, because
connection to the central server could not be made. Or something.. I 
don't know.
Anyway. I cannot reproduce it anymore.



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


[Freeciv-Dev] (PR#38035) [Patch] Client player-nation-player consistency

2007-03-12 Thread Marko Lindqvist

URL: http://bugs.freeciv.org/Ticket/Display.html?id=38035 

 This patch reinitializes player-nation for all players when nations
are reinitialized.


 - ML

diff -Nurd -X.diff_ignore freeciv/client/packhand.c freeciv/client/packhand.c
--- freeciv/client/packhand.c	2007-03-12 16:23:02.0 +0200
+++ freeciv/client/packhand.c	2007-03-12 22:32:11.0 +0200
@@ -2123,6 +2123,8 @@
 **/
 void handle_ruleset_control(struct packet_ruleset_control *packet)
 {
+  int i;
+
   ruleset_data_free();
 
   ruleset_cache_init();
@@ -2131,6 +2133,12 @@
   governments_alloc(packet-government_count);
   nations_alloc(packet-nation_count);
   city_styles_alloc(packet-styles_count);
+
+  /* We are in inconsistent state. Players point to nations,
+   * which do not point to players. Fix */
+  for (i = 0; i  MAX_NUM_PLAYERS + MAX_NUM_BARBARIANS; i++) {
+game.players[i].nation = NULL;
+  }
 }
 
 /**
___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev