Skip to content

Commit

Permalink
Merge pull request #833 from cazfi/srvup
Browse files Browse the repository at this point in the history
  • Loading branch information
cazfi authored Apr 19, 2024
2 parents 0a07597 + cb10b2d commit 87dc93d
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 16 deletions.
4 changes: 4 additions & 0 deletions freeciv/apply_patches.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
# ----------------------------------
Expand Down Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
From d6481dd6a44d7782eacc9df34bc3e935f6528827 Mon Sep 17 00:00:00 2001
From: Marko Lindqvist <[email protected]>
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 <[email protected]>
---
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

28 changes: 14 additions & 14 deletions freeciv/patches/longturn.patch
Original file line number Diff line number Diff line change
@@ -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 <string.h>

Expand Down Expand Up @@ -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)
{
Expand All @@ -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;
}
Expand All @@ -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;
}
}
+
Expand All @@ -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);
Expand All @@ -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."));
Expand Down
4 changes: 2 additions & 2 deletions freeciv/version.txt
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 87dc93d

Please sign in to comment.