[Freeciv-commits] r29486 - /trunk/data/civ2/effects.ruleset
Author: sveinung Date: Thu Aug 13 14:52:37 2015 New Revision: 29486 URL: http://svn.gna.org/viewcvs/freeciv?rev=29486view=rev Log: civ2: Add Fundamentalism's Casus Belli exception Getting caught while planting a nuclear device doesn't give everyone else a casus belli against you if your government is Fundamentalism. Reported by Jacob Nevins jtn See bug #23778 Modified: trunk/data/civ2/effects.ruleset Modified: trunk/data/civ2/effects.ruleset URL: http://svn.gna.org/viewcvs/freeciv/trunk/data/civ2/effects.ruleset?rev=29486r1=29485r2=29486view=diff == --- trunk/data/civ2/effects.ruleset (original) +++ trunk/data/civ2/effects.ruleset Thu Aug 13 14:52:37 2015 @@ -2309,8 +2309,9 @@ type = Casus_Belli_Caught value = 1000 reqs = -{ type, name, range - Action, Suitcase Nuke, Local +{ type, name, range, present + Action, Suitcase Nuke, Local, TRUE + Gov, Fundamentalism, Player, FALSE } ; TODO: Find the exact probability ___ Freeciv-commits mailing list Freeciv-commits@gna.org https://mail.gna.org/listinfo/freeciv-commits
[Freeciv-commits] r29484 - in /trunk: ./ client/ common/ data/alien/ data/civ2civ3/ data/classic/ data/experimental/ data/multiplayer/ data/stub/
Author: sveinung Date: Thu Aug 13 14:52:24 2015 New Revision: 29484 URL: http://svn.gna.org/viewcvs/freeciv?rev=29484view=rev Log: Make exceptions to slow_invasions possible Introduce the new unit type flag BeachLander. Units with this flag won't lose all movement when moving from non native to native terrain even when slow_invasions is enabled. See patch #6212 Modified: trunk/client/helpdata.c trunk/common/map.c trunk/common/unittype.h trunk/data/alien/units.ruleset trunk/data/civ2civ3/units.ruleset trunk/data/classic/units.ruleset trunk/data/experimental/units.ruleset trunk/data/multiplayer/units.ruleset trunk/data/stub/units.ruleset trunk/fc_version Modified: trunk/client/helpdata.c URL: http://svn.gna.org/viewcvs/freeciv/trunk/client/helpdata.c?rev=29484r1=29483r2=29484view=diff == --- trunk/client/helpdata.c (original) +++ trunk/client/helpdata.c Thu Aug 13 14:52:24 2015 @@ -3917,6 +3917,13 @@ CATLSTR(buf, bufsz, _(* Can launch attack from non-native tiles.\n)); } + if (game.info.slow_invasions + utype_has_flag(utype, UTYF_BEACH_LANDER)) { +/* BeachLander only matters when slow_invasions are enabled. */ +CATLSTR(buf, bufsz, +_(* Won't lose all movement when moving from non-native + terrain to native terrain.\n)); + } if (utype_has_flag(utype, UTYF_PARATROOPERS)) { cat_snprintf(buf, bufsz, _(* Can be paradropped from a friendly city or suitable base Modified: trunk/common/map.c URL: http://svn.gna.org/viewcvs/freeciv/trunk/common/map.c?rev=29484r1=29483r2=29484view=diff == --- trunk/common/map.c (original) +++ trunk/common/map.c Thu Aug 13 14:52:24 2015 @@ -697,10 +697,11 @@ } else if (!is_native_tile_to_class(pclass, t1)) { if (game.info.slow_invasions + !(punit unit_has_type_flag(punit, UTYF_BEACH_LANDER)) tile_city(t1) == NULL) { /* If slowinvasions option is turned on, units moving from * non-native terrain (from transport) to native terrain lose all - * their movement. + * their movement unless they have the BeachLander unit type flag. * e.g. ground units moving from sea to land */ if (punit != NULL) { return punit-moves_left; Modified: trunk/common/unittype.h URL: http://svn.gna.org/viewcvs/freeciv/trunk/common/unittype.h?rev=29484r1=29483r2=29484view=diff == --- trunk/common/unittype.h (original) +++ trunk/common/unittype.h Thu Aug 13 14:52:24 2015 @@ -218,47 +218,51 @@ /* Only barbarians can build this unit */ #define SPECENUM_VALUE27 UTYF_BARBARIAN_ONLY #define SPECENUM_VALUE27NAME N_(?unitflag:BarbarianOnly) - -#define SPECENUM_VALUE28 UTYF_USER_FLAG_1 -#define SPECENUM_VALUE29 UTYF_USER_FLAG_2 -#define SPECENUM_VALUE30 UTYF_USER_FLAG_3 -#define SPECENUM_VALUE31 UTYF_USER_FLAG_4 -#define SPECENUM_VALUE32 UTYF_USER_FLAG_5 -#define SPECENUM_VALUE33 UTYF_USER_FLAG_6 -#define SPECENUM_VALUE34 UTYF_USER_FLAG_7 -#define SPECENUM_VALUE35 UTYF_USER_FLAG_8 -#define SPECENUM_VALUE36 UTYF_USER_FLAG_9 -#define SPECENUM_VALUE37 UTYF_USER_FLAG_10 -#define SPECENUM_VALUE38 UTYF_USER_FLAG_11 -#define SPECENUM_VALUE39 UTYF_USER_FLAG_12 -#define SPECENUM_VALUE40 UTYF_USER_FLAG_13 -#define SPECENUM_VALUE41 UTYF_USER_FLAG_14 -#define SPECENUM_VALUE42 UTYF_USER_FLAG_15 -#define SPECENUM_VALUE43 UTYF_USER_FLAG_16 -#define SPECENUM_VALUE44 UTYF_USER_FLAG_17 -#define SPECENUM_VALUE45 UTYF_USER_FLAG_18 -#define SPECENUM_VALUE46 UTYF_USER_FLAG_19 -#define SPECENUM_VALUE47 UTYF_USER_FLAG_20 -#define SPECENUM_VALUE48 UTYF_USER_FLAG_21 -#define SPECENUM_VALUE49 UTYF_USER_FLAG_22 -#define SPECENUM_VALUE50 UTYF_USER_FLAG_23 -#define SPECENUM_VALUE51 UTYF_USER_FLAG_24 -#define SPECENUM_VALUE52 UTYF_USER_FLAG_25 -#define SPECENUM_VALUE53 UTYF_USER_FLAG_26 -#define SPECENUM_VALUE54 UTYF_USER_FLAG_27 -#define SPECENUM_VALUE55 UTYF_USER_FLAG_28 -#define SPECENUM_VALUE56 UTYF_USER_FLAG_29 -#define SPECENUM_VALUE57 UTYF_USER_FLAG_30 -#define SPECENUM_VALUE58 UTYF_USER_FLAG_31 -#define SPECENUM_VALUE59 UTYF_USER_FLAG_32 -#define SPECENUM_VALUE60 UTYF_USER_FLAG_33 -#define SPECENUM_VALUE61 UTYF_USER_FLAG_34 -#define SPECENUM_VALUE62 UTYF_USER_FLAG_35 -#define SPECENUM_VALUE63 UTYF_USER_FLAG_36 -#define SPECENUM_VALUE64 UTYF_USER_FLAG_37 -#define SPECENUM_VALUE65 UTYF_USER_FLAG_38 -#define SPECENUM_VALUE66 UTYF_USER_FLAG_39 -#define SPECENUM_VALUE67 UTYF_USER_FLAG_40 +/* Unit won't lose all its movement when moving from non-nantive terrain to + * native terrain even if slow_invasions is turned on. */ +#define SPECENUM_VALUE28 UTYF_BEACH_LANDER +#define SPECENUM_VALUE28NAME N_(?unitflag:BeachLander) + +#define SPECENUM_VALUE29 UTYF_USER_FLAG_1 +#define SPECENUM_VALUE30
[Freeciv-commits] r29487 - /branches/S2_6/common/metaknowledge.c
Author: sveinung Date: Thu Aug 13 14:53:10 2015 New Revision: 29487 URL: http://svn.gna.org/viewcvs/freeciv?rev=29487view=rev Log: meta knowledge: seeing city internals isn't magic Stop assuming that being able to see the internals of the target city makes the player able to know what buildings other cities contain. See bug #23774 Modified: branches/S2_6/common/metaknowledge.c Modified: branches/S2_6/common/metaknowledge.c URL: http://svn.gna.org/viewcvs/freeciv/branches/S2_6/common/metaknowledge.c?rev=29487r1=29486r2=29487view=diff == --- branches/S2_6/common/metaknowledge.c(original) +++ branches/S2_6/common/metaknowledge.cThu Aug 13 14:53:10 2015 @@ -366,12 +366,6 @@ } if (req-source.kind == VUT_IMPROVEMENT) { -/* Anyone that can see city internals (like the owner) */ -if (can_player_see_city_internals(pow_player, target_city)) { - return TRUE; -} - -/* Cities not owned by pow_player */ switch (req-range) { case REQ_RANGE_WORLD: case REQ_RANGE_ALLIANCE: @@ -390,6 +384,11 @@ return FALSE; case REQ_RANGE_CITY: case REQ_RANGE_LOCAL: + if (can_player_see_city_internals(pow_player, target_city)) { +/* Anyone that can see city internals (like the owner) */ +return TRUE; + } + /* Can't see invisible improvements in foreign cities. */ if (!is_improvement_visible(req-source.value.building)) { return FALSE; ___ Freeciv-commits mailing list Freeciv-commits@gna.org https://mail.gna.org/listinfo/freeciv-commits
[Freeciv-commits] r29485 - /trunk/common/metaknowledge.c
Author: sveinung Date: Thu Aug 13 14:52:31 2015 New Revision: 29485 URL: http://svn.gna.org/viewcvs/freeciv?rev=29485view=rev Log: meta knowledge: seeing city internals isn't magic Stop assuming that being able to see the internals of the target city makes the player able to know what buildings other cities contain. See bug #23774 Modified: trunk/common/metaknowledge.c Modified: trunk/common/metaknowledge.c URL: http://svn.gna.org/viewcvs/freeciv/trunk/common/metaknowledge.c?rev=29485r1=29484r2=29485view=diff == --- trunk/common/metaknowledge.c(original) +++ trunk/common/metaknowledge.cThu Aug 13 14:52:31 2015 @@ -366,12 +366,6 @@ } if (req-source.kind == VUT_IMPROVEMENT) { -/* Anyone that can see city internals (like the owner) */ -if (can_player_see_city_internals(pow_player, target_city)) { - return TRUE; -} - -/* Cities not owned by pow_player */ switch (req-range) { case REQ_RANGE_WORLD: case REQ_RANGE_ALLIANCE: @@ -390,6 +384,11 @@ return FALSE; case REQ_RANGE_CITY: case REQ_RANGE_LOCAL: + if (can_player_see_city_internals(pow_player, target_city)) { +/* Anyone that can see city internals (like the owner) */ +return TRUE; + } + /* Can't see invisible improvements in foreign cities. */ if (!is_improvement_visible(req-source.value.building)) { return FALSE; ___ Freeciv-commits mailing list Freeciv-commits@gna.org https://mail.gna.org/listinfo/freeciv-commits
[Freeciv-commits] r29489 - /branches/S2_6/client/gui-gtk-3.0/mapview.c
Author: cazfi Date: Thu Aug 13 19:01:17 2015 New Revision: 29489 URL: http://svn.gna.org/viewcvs/freeciv?rev=29489view=rev Log: Draw cross overlay tile to correct location with zoom != 1.0 See bug #23773 Modified: branches/S2_6/client/gui-gtk-3.0/mapview.c Modified: branches/S2_6/client/gui-gtk-3.0/mapview.c URL: http://svn.gna.org/viewcvs/freeciv/branches/S2_6/client/gui-gtk-3.0/mapview.c?rev=29489r1=29488r2=29489view=diff == --- branches/S2_6/client/gui-gtk-3.0/mapview.c (original) +++ branches/S2_6/client/gui-gtk-3.0/mapview.c Thu Aug 13 19:01:17 2015 @@ -590,7 +590,7 @@ if (tile_to_canvas_pos(canvas_x, canvas_y, ptile)) { pixmap_put_overlay_tile(gtk_widget_get_window(map_canvas), map_zoom, - canvas_x, canvas_y, + canvas_x / map_zoom, canvas_y / map_zoom, get_attention_crosshair_sprite(tileset)); } } ___ Freeciv-commits mailing list Freeciv-commits@gna.org https://mail.gna.org/listinfo/freeciv-commits
[Freeciv-commits] r29488 - /trunk/client/gui-gtk-3.0/mapview.c
Author: cazfi Date: Thu Aug 13 19:01:10 2015 New Revision: 29488 URL: http://svn.gna.org/viewcvs/freeciv?rev=29488view=rev Log: Draw cross overlay tile to correct location with zoom != 1.0 See bug #23773 Modified: trunk/client/gui-gtk-3.0/mapview.c Modified: trunk/client/gui-gtk-3.0/mapview.c URL: http://svn.gna.org/viewcvs/freeciv/trunk/client/gui-gtk-3.0/mapview.c?rev=29488r1=29487r2=29488view=diff == --- trunk/client/gui-gtk-3.0/mapview.c (original) +++ trunk/client/gui-gtk-3.0/mapview.c Thu Aug 13 19:01:10 2015 @@ -592,7 +592,7 @@ if (tile_to_canvas_pos(canvas_x, canvas_y, ptile)) { pixmap_put_overlay_tile(gtk_widget_get_window(map_canvas), map_zoom, - canvas_x, canvas_y, + canvas_x / map_zoom, canvas_y / map_zoom, get_attention_crosshair_sprite(tileset)); } } ___ Freeciv-commits mailing list Freeciv-commits@gna.org https://mail.gna.org/listinfo/freeciv-commits
[Freeciv-commits] r29493 - in /branches/S2_6/client: gui-sdl/themes.c gui-sdl2/themes.c
Author: cazfi Date: Thu Aug 13 19:33:10 2015 New Revision: 29493 URL: http://svn.gna.org/viewcvs/freeciv?rev=29493view=rev Log: Replaced gui-sdl / gui-sdl2 with Sdl-client / Sdl2-client in an error message. See patch #6211 Modified: branches/S2_6/client/gui-sdl/themes.c branches/S2_6/client/gui-sdl2/themes.c Modified: branches/S2_6/client/gui-sdl/themes.c URL: http://svn.gna.org/viewcvs/freeciv/branches/S2_6/client/gui-sdl/themes.c?rev=29493r1=29492r2=29493view=diff == --- branches/S2_6/client/gui-sdl/themes.c (original) +++ branches/S2_6/client/gui-sdl/themes.c Thu Aug 13 19:33:10 2015 @@ -53,7 +53,7 @@ theme_free(theme); if (!load_theme(options.gui_sdl_default_theme_name)) { /* TRANS: No full stop after the URL, could cause confusion. */ -log_fatal(_(No gui-sdl theme was found. For instructions on how to +log_fatal(_(No Sdl-client theme was found. For instructions on how to get one, please visit %s), WIKI_URL); exit(EXIT_FAILURE); } Modified: branches/S2_6/client/gui-sdl2/themes.c URL: http://svn.gna.org/viewcvs/freeciv/branches/S2_6/client/gui-sdl2/themes.c?rev=29493r1=29492r2=29493view=diff == --- branches/S2_6/client/gui-sdl2/themes.c (original) +++ branches/S2_6/client/gui-sdl2/themes.c Thu Aug 13 19:33:10 2015 @@ -54,7 +54,7 @@ if (!load_theme(options.gui_sdl2_default_theme_name)) { /* TRANS: No full stop after the URL, could cause confusion. */ -log_fatal(_(No gui-sdl2 theme was found. For instructions on how to +log_fatal(_(No Sdl2-client theme was found. For instructions on how to get one, please visit %s), WIKI_URL); exit(EXIT_FAILURE); } ___ Freeciv-commits mailing list Freeciv-commits@gna.org https://mail.gna.org/listinfo/freeciv-commits
[Freeciv-commits] r29492 - in /trunk/client: gui-sdl/themes.c gui-sdl2/themes.c
Author: cazfi Date: Thu Aug 13 19:33:02 2015 New Revision: 29492 URL: http://svn.gna.org/viewcvs/freeciv?rev=29492view=rev Log: Replaced gui-sdl / gui-sdl2 with Sdl-client / Sdl2-client in an error message. See patch #6211 Modified: trunk/client/gui-sdl/themes.c trunk/client/gui-sdl2/themes.c Modified: trunk/client/gui-sdl/themes.c URL: http://svn.gna.org/viewcvs/freeciv/trunk/client/gui-sdl/themes.c?rev=29492r1=29491r2=29492view=diff == --- trunk/client/gui-sdl/themes.c (original) +++ trunk/client/gui-sdl/themes.c Thu Aug 13 19:33:02 2015 @@ -53,7 +53,7 @@ theme_free(theme); if (!load_theme(options.gui_sdl_default_theme_name)) { /* TRANS: No full stop after the URL, could cause confusion. */ -log_fatal(_(No gui-sdl theme was found. For instructions on how to +log_fatal(_(No Sdl-client theme was found. For instructions on how to get one, please visit %s), WIKI_URL); exit(EXIT_FAILURE); } Modified: trunk/client/gui-sdl2/themes.c URL: http://svn.gna.org/viewcvs/freeciv/trunk/client/gui-sdl2/themes.c?rev=29492r1=29491r2=29492view=diff == --- trunk/client/gui-sdl2/themes.c (original) +++ trunk/client/gui-sdl2/themes.c Thu Aug 13 19:33:02 2015 @@ -54,7 +54,7 @@ if (!load_theme(options.gui_sdl2_default_theme_name)) { /* TRANS: No full stop after the URL, could cause confusion. */ -log_fatal(_(No gui-sdl2 theme was found. For instructions on how to +log_fatal(_(No Sdl2-client theme was found. For instructions on how to get one, please visit %s), WIKI_URL); exit(EXIT_FAILURE); } ___ Freeciv-commits mailing list Freeciv-commits@gna.org https://mail.gna.org/listinfo/freeciv-commits
[Freeciv-commits] r29490 - in /trunk/server: connecthand.c report.c report.h
Author: cazfi Date: Thu Aug 13 19:08:46 2015 New Revision: 29490 URL: http://svn.gna.org/viewcvs/freeciv?rev=29490view=rev Log: Send current turns History Report to all clients connecting during the turn. See patch #6195 Modified: trunk/server/connecthand.c trunk/server/report.c trunk/server/report.h Modified: trunk/server/connecthand.c URL: http://svn.gna.org/viewcvs/freeciv/trunk/server/connecthand.c?rev=29490r1=29489r2=29490view=diff == --- trunk/server/connecthand.c (original) +++ trunk/server/connecthand.c Thu Aug 13 19:08:46 2015 @@ -303,6 +303,9 @@ reset_all_start_commands(TRUE); (void) send_server_info_to_metaserver(META_INFO); } + + send_current_history_report(pconn-self); + conn_compression_thaw(pconn); } Modified: trunk/server/report.c URL: http://svn.gna.org/viewcvs/freeciv/trunk/server/report.c?rev=29490r1=29489r2=29490view=diff == --- trunk/server/report.c (original) +++ trunk/server/report.c Thu Aug 13 19:08:46 2015 @@ -59,6 +59,10 @@ int last_turn; struct plrdata_slot *plrdata; }; + +/* Have to be initialized to value less than -1 so it doesn't seem like report was created at + * the end of previous turn in the beginning to turn 0. */ +struct history_report latest_history_report = { -2 }; static struct logging_civ_score *score_log = NULL; @@ -227,15 +231,15 @@ } /** - Publish historian report. -**/ -static void historian_generic(enum historian_type which_news) + Construct Historian Report +**/ +static void historian_generic(struct history_report *report, + enum historian_type which_news) { int i, j = 0, rank = 0; - char buffer[4096]; - char title[1024]; struct player_score_entry size[player_count()]; + report-turn = game.info.turn; players_iterate(pplayer) { if (GOOD_PLAYER(pplayer)) { switch(which_news) { @@ -264,7 +268,7 @@ } players_iterate_end; qsort(size, j, sizeof(size[0]), secompare); - buffer[0] = '\0'; + report-body[0] = '\0'; for (i = 0; i j; i++) { if (i 0 size[i].value size[i - 1].value) { /* since i j, only top entry reigns Supreme */ @@ -274,17 +278,28 @@ /* clamp to final entry */ rank = ARRAY_SIZE(ranking) - 1; } -cat_snprintf(buffer, sizeof(buffer), +cat_snprintf(report-body, REPORT_BODYSIZE, _(ranking[rank]), i + 1, nation_plural_for_player(size[i].player)); -fc_strlcat(buffer, \n, sizeof(buffer)); - } - fc_snprintf(title, sizeof(title), _(historian_message[which_news]), +fc_strlcat(report-body, \n, REPORT_BODYSIZE); + } + fc_snprintf(report-title, REPORT_TITLESIZE, _(historian_message[which_news]), calendar_text(), _(historian_name[fc_rand(ARRAY_SIZE(historian_name))])); - page_conn_etype(game.est_connections, _(Historian Publishes!), - title, buffer, E_BROADCAST_REPORT); +} + +/** + Send history report of this turn. +**/ +void send_current_history_report(struct conn_list *dest) +{ + /* History report is actually constructed at the end of previous turn. */ + if (latest_history_report.turn = game.info.turn - 1) { +page_conn_etype(dest, _(Historian Publishes!), +latest_history_report.title, latest_history_report.body, +E_BROADCAST_REPORT); + } } /** @@ -1283,6 +1298,8 @@ + player_slot_index(pslot); plrdata-name = NULL; } player_slots_iterate_end; + + latest_history_report.turn = -2; } /** @@ -1525,7 +1542,8 @@ game.server.scoreturn = (game.info.turn + GAME_DEFAULT_SCORETURN + fc_rand(GAME_DEFAULT_SCORETURN)); - historian_generic(game.server.scoreturn % HISTORIAN_LAST); + historian_generic(latest_history_report, game.server.scoreturn % HISTORIAN_LAST); + send_current_history_report(game.est_connections); } /** Modified: trunk/server/report.h URL: http://svn.gna.org/viewcvs/freeciv/trunk/server/report.h?rev=29490r1=29489r2=29490view=diff == --- trunk/server/report.h (original) +++ trunk/server/report.h Thu Aug 13 19:08:46 2015 @@ -18,6 +18,16
[Freeciv-commits] r29491 - in /branches/S2_6/server: connecthand.c report.c report.h
Author: cazfi Date: Thu Aug 13 19:08:53 2015 New Revision: 29491 URL: http://svn.gna.org/viewcvs/freeciv?rev=29491view=rev Log: Send current turns History Report to all clients connecting during the turn. See patch #6195 Modified: branches/S2_6/server/connecthand.c branches/S2_6/server/report.c branches/S2_6/server/report.h Modified: branches/S2_6/server/connecthand.c URL: http://svn.gna.org/viewcvs/freeciv/branches/S2_6/server/connecthand.c?rev=29491r1=29490r2=29491view=diff == --- branches/S2_6/server/connecthand.c (original) +++ branches/S2_6/server/connecthand.c Thu Aug 13 19:08:53 2015 @@ -303,6 +303,9 @@ reset_all_start_commands(TRUE); (void) send_server_info_to_metaserver(META_INFO); } + + send_current_history_report(pconn-self); + conn_compression_thaw(pconn); } Modified: branches/S2_6/server/report.c URL: http://svn.gna.org/viewcvs/freeciv/branches/S2_6/server/report.c?rev=29491r1=29490r2=29491view=diff == --- branches/S2_6/server/report.c (original) +++ branches/S2_6/server/report.c Thu Aug 13 19:08:53 2015 @@ -59,6 +59,10 @@ int last_turn; struct plrdata_slot *plrdata; }; + +/* Have to be initialized to value less than -1 so it doesn't seem like report was created at + * the end of previous turn in the beginning to turn 0. */ +struct history_report latest_history_report = { -2 }; static struct logging_civ_score *score_log = NULL; @@ -227,15 +231,15 @@ } /** - Publish historian report. -**/ -static void historian_generic(enum historian_type which_news) + Construct Historian Report +**/ +static void historian_generic(struct history_report *report, + enum historian_type which_news) { int i, j = 0, rank = 0; - char buffer[4096]; - char title[1024]; struct player_score_entry size[player_count()]; + report-turn = game.info.turn; players_iterate(pplayer) { if (GOOD_PLAYER(pplayer)) { switch(which_news) { @@ -264,7 +268,7 @@ } players_iterate_end; qsort(size, j, sizeof(size[0]), secompare); - buffer[0] = '\0'; + report-body[0] = '\0'; for (i = 0; i j; i++) { if (i 0 size[i].value size[i - 1].value) { /* since i j, only top entry reigns Supreme */ @@ -274,17 +278,28 @@ /* clamp to final entry */ rank = ARRAY_SIZE(ranking) - 1; } -cat_snprintf(buffer, sizeof(buffer), +cat_snprintf(report-body, REPORT_BODYSIZE, _(ranking[rank]), i + 1, nation_plural_for_player(size[i].player)); -fc_strlcat(buffer, \n, sizeof(buffer)); - } - fc_snprintf(title, sizeof(title), _(historian_message[which_news]), +fc_strlcat(report-body, \n, REPORT_BODYSIZE); + } + fc_snprintf(report-title, REPORT_TITLESIZE, _(historian_message[which_news]), calendar_text(), _(historian_name[fc_rand(ARRAY_SIZE(historian_name))])); - page_conn_etype(game.est_connections, _(Historian Publishes!), - title, buffer, E_BROADCAST_REPORT); +} + +/** + Send history report of this turn. +**/ +void send_current_history_report(struct conn_list *dest) +{ + /* History report is actually constructed at the end of previous turn. */ + if (latest_history_report.turn = game.info.turn - 1) { +page_conn_etype(dest, _(Historian Publishes!), +latest_history_report.title, latest_history_report.body, +E_BROADCAST_REPORT); + } } /** @@ -1283,6 +1298,8 @@ + player_slot_index(pslot); plrdata-name = NULL; } player_slots_iterate_end; + + latest_history_report.turn = -2; } /** @@ -1525,7 +1542,8 @@ game.server.scoreturn = (game.info.turn + GAME_DEFAULT_SCORETURN + fc_rand(GAME_DEFAULT_SCORETURN)); - historian_generic(game.server.scoreturn % HISTORIAN_LAST); + historian_generic(latest_history_report, game.server.scoreturn % HISTORIAN_LAST); + send_current_history_report(game.est_connections); } /** Modified: branches/S2_6/server/report.h URL: http://svn.gna.org/viewcvs/freeciv/branches/S2_6/server/report.h?rev=29491r1=29490r2=29491view=diff == ---