From 5fa09f0e50c13368047b1258ce7da5e80ac1ace2 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Fri, 12 Apr 2024 07:17:52 +0300 Subject: [PATCH 1/3] Update to Freeciv server freeciv/freeciv@9dc97fc1a5 Signed-off-by: Marko Lindqvist --- freeciv/version.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/freeciv/version.txt b/freeciv/version.txt index c98361c7a..0c72f795a 100644 --- a/freeciv/version.txt +++ b/freeciv/version.txt @@ -1,9 +1,9 @@ # The Git SHA hash for the commit to checkout from # https://github.com/freeciv/freeciv -FCREV=d30edc5109a4394a1eb6ed14906dff191d1efc38 +FCREV=9dc97fc1a5b233c972daf4e0f7dcfa80d49d79ea -ORIGCAPSTR="+Freeciv.Devel-\${MAIN_VERSION}-2024.Mar.22" +ORIGCAPSTR="+Freeciv.Devel-\${MAIN_VERSION}-2024.Mar.30" # There's no need to bump this constantly as current freeciv-web # makes no connections to outside world - all connections are From aaadb8cc92226f982f2759b4a4cdc54dd5678479 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Fri, 12 Apr 2024 07:35:26 +0300 Subject: [PATCH 2/3] longturn.patch: Rebase It had fuzz in applying Signed-off-by: Marko Lindqvist --- freeciv/patches/longturn.patch | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/freeciv/patches/longturn.patch b/freeciv/patches/longturn.patch index 83d1cf1d8..7ed96e6dd 100644 --- a/freeciv/patches/longturn.patch +++ b/freeciv/patches/longturn.patch @@ -1,6 +1,6 @@ diff -Nurd freeciv/server/connecthand.c freeciv/server/connecthand.c ---- freeciv/server/connecthand.c 2024-02-16 23:22:03.446761475 +0200 -+++ freeciv/server/connecthand.c 2024-02-16 23:22:15.126944960 +0200 +--- freeciv/server/connecthand.c 2024-04-12 07:19:30.221431641 +0300 ++++ freeciv/server/connecthand.c 2024-04-12 07:19:45.477539308 +0300 @@ -18,6 +18,7 @@ #include @@ -118,9 +118,9 @@ diff -Nurd freeciv/server/connecthand.c freeciv/server/connecthand.c if (game.server.auto_ai_toggle && !is_human(pplayer)) { toggle_ai_player_direct(nullptr, pplayer); diff -Nurd freeciv/server/settings.c freeciv/server/settings.c ---- freeciv/server/settings.c 2024-02-16 23:22:03.450761538 +0200 -+++ freeciv/server/settings.c 2024-02-16 23:22:15.126944960 +0200 -@@ -857,6 +857,10 @@ +--- freeciv/server/settings.c 2024-04-12 07:19:30.225431668 +0300 ++++ freeciv/server/settings.c 2024-04-12 07:19:45.481539337 +0300 +@@ -858,6 +858,10 @@ ****************************************************************************/ static void metamessage_action(const struct setting *pset) { @@ -132,9 +132,9 @@ diff -Nurd freeciv/server/settings.c freeciv/server/settings.c * An empty user metaserver message results in an automatic meta message. * A non empty user meta message results in the user meta message. */ diff -Nurd freeciv/server/srv_main.c freeciv/server/srv_main.c ---- freeciv/server/srv_main.c 2024-02-16 23:22:03.446761475 +0200 -+++ freeciv/server/srv_main.c 2024-02-16 23:22:15.126944960 +0200 -@@ -3431,6 +3431,15 @@ +--- freeciv/server/srv_main.c 2024-04-12 07:19:30.221431641 +0300 ++++ freeciv/server/srv_main.c 2024-04-12 07:19:45.481539337 +0300 +@@ -3470,6 +3470,15 @@ map_show_all(pplayer); } players_iterate_end; } @@ -150,8 +150,8 @@ diff -Nurd freeciv/server/srv_main.c freeciv/server/srv_main.c } if (game.scenario.is_scenario && game.scenario.players) { -@@ -3855,3 +3864,11 @@ - } +@@ -3935,3 +3944,11 @@ + game.server.world_peace_start = game.info.turn; } } + @@ -163,8 +163,8 @@ diff -Nurd freeciv/server/srv_main.c freeciv/server/srv_main.c + return (!fc_strcasecmp(game.server.meta_info.type, "longturn")); +} diff -Nurd freeciv/server/srv_main.h freeciv/server/srv_main.h ---- freeciv/server/srv_main.h 2024-02-16 23:22:03.450761538 +0200 -+++ freeciv/server/srv_main.h 2024-02-16 23:22:15.126944960 +0200 +--- freeciv/server/srv_main.h 2024-04-12 07:19:30.225431668 +0300 ++++ freeciv/server/srv_main.h 2024-04-12 07:19:45.481539337 +0300 @@ -96,6 +96,7 @@ void fc__noreturn srv_main(void); void fc__noreturn server_quit(void); @@ -174,8 +174,8 @@ diff -Nurd freeciv/server/srv_main.h freeciv/server/srv_main.h enum server_states server_state(void); void set_server_state(enum server_states newstate); diff -Nurd freeciv/server/stdinhand.c freeciv/server/stdinhand.c ---- freeciv/server/stdinhand.c 2024-02-16 23:22:03.446761475 +0200 -+++ freeciv/server/stdinhand.c 2024-02-16 23:22:15.130945024 +0200 +--- freeciv/server/stdinhand.c 2024-04-12 07:19:30.225431668 +0300 ++++ freeciv/server/stdinhand.c 2024-04-12 07:19:45.481539337 +0300 @@ -615,6 +615,10 @@ log_deprecation(_("/metamessage command is deprecated. " "Set metamessage setting instead.")); From cb10b2dd6f0ff466c626889c3d0b77591dd5e441 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Sun, 14 Apr 2024 01:30:52 +0300 Subject: [PATCH 3/3] Server: Backport 0034-update_bulbs-Fix-research-researching_saved-research.patch Signed-off-by: Marko Lindqvist --- freeciv/apply_patches.sh | 4 +++ ...-research-researching_saved-research.patch | 33 +++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 freeciv/patches/backports/0034-update_bulbs-Fix-research-researching_saved-research.patch diff --git a/freeciv/apply_patches.sh b/freeciv/apply_patches.sh index 6cab73093..80ed92674 100755 --- a/freeciv/apply_patches.sh +++ b/freeciv/apply_patches.sh @@ -18,6 +18,9 @@ # 0053-AI-Fix-bad-city-spot-value-calculation-with-unknown-.patch # AI city spot evaluation fix # RM #408 +# 0034-update_bulbs-Fix-research-researching_saved-research.patch +# Fix to research assert failure +# RM #449 # Not in the upstream Freeciv server # ---------------------------------- @@ -45,6 +48,7 @@ declare -a PATCHLIST=( "backports/0051-Adjust-nationality-of-remaining-units-after-player-r" "backports/0038-AI-Delay-war-declaration-until-really-revolted" "backports/0053-AI-Fix-bad-city-spot-value-calculation-with-unknown-" + "backports/0034-update_bulbs-Fix-research-researching_saved-research" "RevertAmplio2ExtraUnits" "meson_webperimental" "metachange" diff --git a/freeciv/patches/backports/0034-update_bulbs-Fix-research-researching_saved-research.patch b/freeciv/patches/backports/0034-update_bulbs-Fix-research-researching_saved-research.patch new file mode 100644 index 000000000..b6e400d79 --- /dev/null +++ b/freeciv/patches/backports/0034-update_bulbs-Fix-research-researching_saved-research.patch @@ -0,0 +1,33 @@ +From d6481dd6a44d7782eacc9df34bc3e935f6528827 Mon Sep 17 00:00:00 2001 +From: Marko Lindqvist +Date: Sun, 14 Apr 2024 01:05:11 +0300 +Subject: [PATCH 34/35] update_bulbs(): Fix "research->researching_saved != + research->researching" assert + +See RM #449 + +Signed-off-by: Marko Lindqvist +--- + server/techtools.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/server/techtools.c b/server/techtools.c +index 2144eeeef9..261c18005e 100644 +--- a/server/techtools.c ++++ b/server/techtools.c +@@ -662,10 +662,10 @@ void update_bulbs(struct player *pplayer, int bulbs, bool check_tech, + } + fc_assert_ret(research); + +- /* count our research contribution this turn */ ++ /* Count our research contribution this turn */ + pplayer->server.bulbs_last_turn += bulbs; + research->bulbs_researched += bulbs; +- if (A_UNKNOWN != research->researching_saved) { ++ if (research->researching_saved != A_UNKNOWN && research->researching_saved != A_UNSET) { + fc_assert(research->researching_saved != research->researching); + research->bulbs_researching_saved += bulbs; + } +-- +2.43.0 +