-
Notifications
You must be signed in to change notification settings - Fork 334
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #825 from cazfi/srvup
- Loading branch information
Showing
7 changed files
with
212 additions
and
93 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
109 changes: 109 additions & 0 deletions
109
freeciv/patches/backports/0002-Fix-allied-victory-of-all-players.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
From 012bd29227e9ac423ac84e5956fca208f0347cda Mon Sep 17 00:00:00 2001 | ||
From: Marko Lindqvist <[email protected]> | ||
Date: Thu, 21 Mar 2024 20:20:24 +0200 | ||
Subject: [PATCH 02/57] Fix allied victory of all players | ||
|
||
Allied victory was not occurring if nobody had been defeated | ||
beforehand, i.e., if all the players just got in to the same alliance. | ||
|
||
See RM #324 | ||
|
||
Signed-off-by: Marko Lindqvist <[email protected]> | ||
--- | ||
server/srv_main.c | 76 ++++++++++++++++++++++++----------------------- | ||
1 file changed, 39 insertions(+), 37 deletions(-) | ||
|
||
diff --git a/server/srv_main.c b/server/srv_main.c | ||
index 7edf693839..7538a17181 100644 | ||
--- a/server/srv_main.c | ||
+++ b/server/srv_main.c | ||
@@ -424,47 +424,49 @@ bool check_for_game_over(void) | ||
_("Game is over.")); | ||
log_normal(_("Game is over.")); | ||
return TRUE; | ||
- } else if (0 < defeated) { | ||
- /* If nobody conceded the game, it mays be a solo game or a single team | ||
- * game. */ | ||
- fc_assert(NULL != victor); | ||
- | ||
- /* Quit if we have team victory. */ | ||
- if (1 < team_count()) { | ||
- teams_iterate(pteam) { | ||
- const struct player_list *members = team_members(pteam); | ||
- int team_candidates = 0, team_defeated = 0; | ||
- | ||
- if (1 == player_list_size(members)) { | ||
- /* This is not really a team, single players are handled below. */ | ||
- continue; | ||
- } | ||
- | ||
- player_list_iterate(members, pplayer) { | ||
- if (pplayer->is_alive | ||
- && !player_status_check((pplayer), PSTATUS_SURRENDER)) { | ||
- team_candidates++; | ||
- } else { | ||
- team_defeated++; | ||
+ } else { | ||
+ if (0 < defeated) { | ||
+ /* If nobody conceded the game, it mays be a solo game or a single team | ||
+ * game. */ | ||
+ fc_assert(NULL != victor); | ||
+ | ||
+ /* Quit if we have team victory. */ | ||
+ if (1 < team_count()) { | ||
+ teams_iterate(pteam) { | ||
+ const struct player_list *members = team_members(pteam); | ||
+ int team_candidates = 0, team_defeated = 0; | ||
+ | ||
+ if (1 == player_list_size(members)) { | ||
+ /* This is not really a team, single players are handled below. */ | ||
+ continue; | ||
} | ||
- } player_list_iterate_end; | ||
|
||
- fc_assert(team_candidates + team_defeated | ||
- == player_list_size(members)); | ||
- | ||
- if (team_candidates == candidates && team_defeated < defeated) { | ||
- /* We need a player in a other team to conced the game here. */ | ||
- notify_conn(game.est_connections, NULL, E_GAME_END, ftc_server, | ||
- _("Team victory to %s."), | ||
- team_name_translation(pteam)); | ||
- log_normal(_("Team victory to %s."), team_name_translation(pteam)); | ||
- /* All players of the team win, even dead and surrended ones. */ | ||
player_list_iterate(members, pplayer) { | ||
- pplayer->is_winner = TRUE; | ||
+ if (pplayer->is_alive | ||
+ && !player_status_check((pplayer), PSTATUS_SURRENDER)) { | ||
+ team_candidates++; | ||
+ } else { | ||
+ team_defeated++; | ||
+ } | ||
} player_list_iterate_end; | ||
- return TRUE; | ||
- } | ||
- } teams_iterate_end; | ||
+ | ||
+ fc_assert(team_candidates + team_defeated | ||
+ == player_list_size(members)); | ||
+ | ||
+ if (team_candidates == candidates && team_defeated < defeated) { | ||
+ /* We need a player in a other team to conced the game here. */ | ||
+ notify_conn(game.est_connections, NULL, E_GAME_END, ftc_server, | ||
+ _("Team victory to %s."), | ||
+ team_name_translation(pteam)); | ||
+ log_normal(_("Team victory to %s."), team_name_translation(pteam)); | ||
+ /* All players of the team win, even dead and surrended ones. */ | ||
+ player_list_iterate(members, pplayer) { | ||
+ pplayer->is_winner = TRUE; | ||
+ } player_list_iterate_end; | ||
+ return TRUE; | ||
+ } | ||
+ } teams_iterate_end; | ||
+ } | ||
} | ||
|
||
/* Check for allied victory. */ | ||
-- | ||
2.43.0 | ||
|
30 changes: 0 additions & 30 deletions
30
freeciv/patches/backports/0037-Correct-action_post_success_forced_ruleset_var_name-.patch
This file was deleted.
Oops, something went wrong.
87 changes: 87 additions & 0 deletions
87
freeciv/patches/backports/0041-Stop-sending-hidden-resources-to-the-client.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
From 2eed4eddb6623022dbcdf90270694d53f6f7ddaa Mon Sep 17 00:00:00 2001 | ||
From: Marko Lindqvist <[email protected]> | ||
Date: Sun, 24 Mar 2024 08:47:11 +0200 | ||
Subject: [PATCH 41/42] Stop sending hidden resources to the client | ||
|
||
Hidden extras were not sent in the extras array, | ||
but if they happened to be also a tile resource, | ||
the resource information was still sent. | ||
|
||
See RM #350 | ||
|
||
Signed-off-by: Marko Lindqvist <[email protected]> | ||
--- | ||
server/maphand.c | 28 +++++++++++++++++++++------- | ||
1 file changed, 21 insertions(+), 7 deletions(-) | ||
|
||
diff --git a/server/maphand.c b/server/maphand.c | ||
index ce4a086a49..68dcb7fa49 100644 | ||
--- a/server/maphand.c | ||
+++ b/server/maphand.c | ||
@@ -527,6 +527,8 @@ void send_tile_info(struct conn_list *dest, struct tile *ptile, | ||
} | ||
|
||
if (pplayer == NULL || (known && map_is_also_seen(ptile, pplayer, V_MAIN))) { | ||
+ struct extra_type *resource; | ||
+ | ||
info.known = TILE_KNOWN_SEEN; | ||
info.continent = tile_continent(ptile); | ||
owner = tile_owner(ptile); | ||
@@ -540,9 +542,16 @@ void send_tile_info(struct conn_list *dest, struct tile *ptile, | ||
info.terrain = (NULL != tile_terrain(ptile)) | ||
? terrain_number(tile_terrain(ptile)) | ||
: terrain_count(); | ||
- info.resource = (NULL != tile_resource(ptile)) | ||
- ? extra_number(tile_resource(ptile)) | ||
- : MAX_EXTRA_TYPES; | ||
+ | ||
+ resource = tile_resource(ptile); | ||
+ if (resource != NULL | ||
+ && (pplayer == NULL | ||
+ || player_knows_extra_exist(pplayer, resource, ptile))) { | ||
+ info.resource = extra_number(resource); | ||
+ } else { | ||
+ info.resource = MAX_EXTRA_TYPES; | ||
+ } | ||
+ | ||
info.placing = (NULL != ptile->placing) | ||
? extra_number(ptile->placing) | ||
: -1; | ||
@@ -778,17 +787,17 @@ void map_show_tile(struct player *src_player, struct tile *ptile) | ||
if (!map_is_known_and_seen(ptile, pplayer, V_MAIN)) { | ||
map_set_known(ptile, pplayer); | ||
|
||
- /* as the tile may be fogged send_tile_info won't always do this for us */ | ||
+ /* As the tile may be fogged send_tile_info won't always do this for us */ | ||
update_player_tile_knowledge(pplayer, ptile); | ||
update_player_tile_last_seen(pplayer, ptile); | ||
|
||
send_tile_info(pplayer->connections, ptile, FALSE); | ||
|
||
- /* remove old cities that exist no more */ | ||
+ /* Remove old cities that exist no more */ | ||
reality_check_city(pplayer, ptile); | ||
|
||
if ((pcity = tile_city(ptile))) { | ||
- /* as the tile may be fogged send_city_info won't do this for us */ | ||
+ /* As the tile may be fogged send_city_info won't do this for us */ | ||
update_dumb_city(pplayer, pcity); | ||
send_city_info(pplayer, pcity); | ||
} | ||
@@ -1406,7 +1415,12 @@ bool update_player_tile_knowledge(struct player *pplayer, struct tile *ptile) | ||
dbv_clr(&(plrtile->extras), extra_number(pextra)); | ||
} | ||
} extra_type_iterate_end; | ||
- plrtile->resource = ptile->resource; | ||
+ if (ptile->resource != NULL | ||
+ && player_knows_extra_exist(pplayer, ptile->resource, ptile)) { | ||
+ plrtile->resource = ptile->resource; | ||
+ } else { | ||
+ plrtile->resource = NULL; | ||
+ } | ||
plrtile->owner = tile_owner(ptile); | ||
plrtile->extras_owner = extra_owner(ptile); | ||
|
||
-- | ||
2.43.0 | ||
|
46 changes: 0 additions & 46 deletions
46
freeciv/patches/backports/0046-Fix-auto_arrange_workers-garbage-cmp.minimal_surplus.patch
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters