Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Srvup #734

Merged
merged 4 commits into from
Jul 18, 2023
Merged

Srvup #734

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 4 additions & 14 deletions freeciv/apply_patches.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,6 @@
# osdn #????? is ticket in freeciv.org tracker:
# https://osdn.net/projects/freeciv/ticket/?????
#
# 0002-Meson-Compress-scenario-files-installed.patch
# Fix an autotools -> meson regression of not compressing scenarios
# osdn #47826
# 0052-Correct-version-numbers-in-sg_regr-uses-to-decimal.patch
# Correction to savegame loading error reporting
# osdn #48212
# 0039-Protocol-Fix-sending-gives_shared_tiles.patch
# Network protocol fix
# osdn #48119
# 0044-Meson-Include-just-stub-AI-when-server-not-built.patch
# Included to freeciv-web for memory savings on any build
# osdn #48193
Expand Down Expand Up @@ -47,11 +38,13 @@
# 0014-Meson-Fix-configure-on-FORTIFY_SOURCE-envs.patch
# Build fix with fortified sources
# osdn #48362
# 0025-Don-t-notify-unrelated-players-about-their-governmen.patch
# Fix illegal memory access
# osdn #48301

# Not in the upstream Freeciv server
# ----------------------------------
# meson_webperimental installs webperimental ruleset
# freeciv_segfauls_fix is a workaround some segfaults in the Freeciv server. Freeciv bug #23884.
# tutorial_ruleset changes the ruleset of the tutorial to one supported by Freeciv-web.
# - This should be replaced by modification of the tutorial scenario that allows it to
# work with multiple rulesets (Requires patch #7362 / SVN r33159)
Expand All @@ -70,9 +63,6 @@ declare -a GIT_PATCHLIST=(
)

declare -a PATCHLIST=(
"backports/0002-Meson-Compress-scenario-files-installed"
"backports/0052-Correct-version-numbers-in-sg_regr-uses-to-decimal"
"backports/0039-Protocol-Fix-sending-gives_shared_tiles"
"backports/0044-Meson-Include-just-stub-AI-when-server-not-built"
"backports/0038-Give-ui_name-for-internal-actions"
"backports/0023-Meson-Add-dev-save-compat-support"
Expand All @@ -84,6 +74,7 @@ declare -a PATCHLIST=(
"backports/0016-Fix-warning-about-player-not-providing-shared-vision"
"backports/0012-savegame3.c-Fix-zero-length-VLA-when-saving-counters"
"backports/0014-Meson-Fix-configure-on-FORTIFY_SOURCE-envs"
"backports/0025-Don-t-notify-unrelated-players-about-their-governmen"
"meson_webperimental"
"metachange"
"text_fixes"
Expand All @@ -93,7 +84,6 @@ declare -a PATCHLIST=(
"savegame"
"maphand_ch"
"server_password"
"freeciv_segfauls_fix"
"scorelog_filenames"
"longturn"
"load_command_confirmation"
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
From 06f2a14b78e60b897c6bb0a41f570a6b7da1947e Mon Sep 17 00:00:00 2001
From: Marko Lindqvist <[email protected]>
Date: Mon, 10 Jul 2023 02:52:20 +0300
Subject: [PATCH 25/25] Don't notify unrelated players about their government
options

When a new tech is somehow added to one research, notify only
members of that research about possible new government options.

See osdn #48301

Signed-off-by: Marko Lindqvist <[email protected]>
---
server/techtools.c | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/server/techtools.c b/server/techtools.c
index 18e31ea7e1..f7fbf44c94 100644
--- a/server/techtools.c
+++ b/server/techtools.c
@@ -408,7 +408,7 @@ void found_new_tech(struct research *presearch, Tech_type_id tech_found,

could_switch = create_current_governments_data(presearch);

- /* getting tech allows us to change research without applying techpenalty
+ /* Getting tech allows us to change research without applying techpenalty
* (without losing bulbs) */
if (tech_found == presearch->researching) {
presearch->free_bulbs = presearch->bulbs_researched;
@@ -437,9 +437,10 @@ void found_new_tech(struct research *presearch, Tech_type_id tech_found,
/* Make proper changes for all players. Use shuffled order, in case
* a script would detect a signal. */
shuffled_players_iterate(aplayer) {
+ bool shares_research = (presearch == research_get(aplayer));
i = player_index(aplayer);

- if (presearch == research_get(aplayer)) {
+ if (shares_research) {
char buf[250];

/* Only for players sharing the research. */
@@ -450,7 +451,7 @@ void found_new_tech(struct research *presearch, Tech_type_id tech_found,
upgrade_all_city_extras(aplayer, was_discovery);

/* Revealing of extras with visibility_req */
- whole_map_iterate(&(wld.map),ptile) {
+ whole_map_iterate(&(wld.map), ptile) {
if (map_is_known_and_seen(ptile, aplayer, V_MAIN)) {
if (update_player_tile_knowledge(aplayer, ptile)) {
send_tile_info(aplayer->connections, ptile, FALSE);
@@ -463,9 +464,11 @@ void found_new_tech(struct research *presearch, Tech_type_id tech_found,
* that world-ranged effects will not be updated immediately. */
unit_list_refresh_vision(aplayer->units);

- fc_snprintf(buf, sizeof(buf), _("Discovery of %s"), advance_name);
+ if (shares_research) {
+ fc_snprintf(buf, sizeof(buf), _("Discovery of %s"), advance_name);

- notify_new_government_options(aplayer, could_switch, buf);
+ notify_new_government_options(aplayer, could_switch, buf);
+ }
}

/* For any player. */
--
2.40.1

This file was deleted.

This file was deleted.

Loading