From 40d4d044745349f0c9b7a3d6f3c9d744dbc780e3 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Thu, 21 Nov 2024 05:20:21 +0200 Subject: [PATCH 1/2] Update to Freeciv server freeciv/freeciv@dc977345b1 Signed-off-by: Marko Lindqvist --- freeciv/patches/RevertAmplio2ExtraUnits.patch | 7 +++---- freeciv/version.txt | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/freeciv/patches/RevertAmplio2ExtraUnits.patch b/freeciv/patches/RevertAmplio2ExtraUnits.patch index ffcf04b15..44b5f82db 100644 --- a/freeciv/patches/RevertAmplio2ExtraUnits.patch +++ b/freeciv/patches/RevertAmplio2ExtraUnits.patch @@ -1,8 +1,8 @@ diff --git a/data/amplio2/extra_units.spec b/data/amplio2/extra_units.spec -index 97457e7063..8890179983 100644 +index 92c2baa7ca..4c9d1523d8 100644 --- a/data/amplio2/extra_units.spec +++ b/data/amplio2/extra_units.spec -@@ -26,105 +26,27 @@ dy = 48 +@@ -26,105 +26,25 @@ dy = 48 pixel_border = 1 tiles = { "row", "column", "tag" @@ -111,8 +111,7 @@ index 97457e7063..8890179983 100644 - 10, 10, "u.elephant_Idle" - 10, 11, "u.polar_bear_Idle" - 10, 12, "u.squid_Idle" -+ - 10, 13, "u.storm_Idle" +- - 10, 14, "u.mammoth_Idle" + } diff --git a/freeciv/version.txt b/freeciv/version.txt index 454f65c93..408a11d04 100644 --- a/freeciv/version.txt +++ b/freeciv/version.txt @@ -1,7 +1,7 @@ # The Git SHA hash for the commit to checkout from # https://github.com/freeciv/freeciv -FCREV=ccddb209ef986da35b737e797b856bd9e144e3b8 +FCREV=dc977345b1519d409318e3aaa4d7711765f689b7 ORIGCAPSTR="+Freeciv.Devel-\${MAIN_VERSION}-2024.June.08" From cf77708ced289aae98613b6596c54d3b21c50e42 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Thu, 21 Nov 2024 05:37:34 +0200 Subject: [PATCH 2/2] Server: Backport 0045-unit_server_side_agent_set-Send-unit-info-only-if-ss.patch Signed-off-by: Marko Lindqvist --- freeciv/apply_patches.sh | 4 ++ ..._agent_set-Send-unit-info-only-if-ss.patch | 42 +++++++++++++++++++ 2 files changed, 46 insertions(+) create mode 100644 freeciv/patches/backports/0045-unit_server_side_agent_set-Send-unit-info-only-if-ss.patch diff --git a/freeciv/apply_patches.sh b/freeciv/apply_patches.sh index e068f8700..98d5a1a18 100755 --- a/freeciv/apply_patches.sh +++ b/freeciv/apply_patches.sh @@ -12,6 +12,9 @@ # 0048-Make-action-selection-dialog-to-appear-on-airlift.patch # Action list popup fix # RM #1028 +# 0045-unit_server_side_agent_set-Send-unit-info-only-if-ss.patch +# Focus unit fix +# RM #1104 # Not in the upstream Freeciv server # ---------------------------------- @@ -34,6 +37,7 @@ declare -a GIT_PATCHLIST=( declare -a PATCHLIST=( "backports/0046-Fix-combat-veterancy-chance" "backports/0048-Make-action-selection-dialog-to-appear-on-airlift" + "backports/0045-unit_server_side_agent_set-Send-unit-info-only-if-ss" "RevertAmplio2ExtraUnits" "meson_webperimental" "metachange" diff --git a/freeciv/patches/backports/0045-unit_server_side_agent_set-Send-unit-info-only-if-ss.patch b/freeciv/patches/backports/0045-unit_server_side_agent_set-Send-unit-info-only-if-ss.patch new file mode 100644 index 000000000..35197b325 --- /dev/null +++ b/freeciv/patches/backports/0045-unit_server_side_agent_set-Send-unit-info-only-if-ss.patch @@ -0,0 +1,42 @@ +From 384543aee1c82ad874ded6da78e632d514ad58f9 Mon Sep 17 00:00:00 2001 +From: Marko Lindqvist +Date: Mon, 11 Nov 2024 05:09:02 +0200 +Subject: [PATCH 45/78] unit_server_side_agent_set(): Send unit info only if + ssa_agent really changed + +Saves some CPU cycles. More importantly for now mitigates +a problem that when a unit with an activity is selected on +the client side, it won't stay on focus if server sends +this unit info packet before the activity has been cleared +to be ACTIVITY_IDLE. + +Focus problems reported by bard and Helge + +See RM #1104 + +Signed-off-by: Marko Lindqvist +--- + server/unithand.c | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +diff --git a/server/unithand.c b/server/unithand.c +index a449223d83..87e51052d7 100644 +--- a/server/unithand.c ++++ b/server/unithand.c +@@ -6585,9 +6585,10 @@ bool unit_server_side_agent_set(struct player *pplayer, + break; + } + +- punit->ssa_controller = agent; +- +- send_unit_info(NULL, punit); ++ if (punit->ssa_controller != agent) { ++ punit->ssa_controller = agent; ++ send_unit_info(NULL, punit); ++ } + + return TRUE; + } +-- +2.45.2 +