From f3edd45becbf3371212eb8f8d8584d3eef629dbe Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Tue, 13 Jul 2021 00:19:51 +0300 Subject: [PATCH 32/32] Log game ending reason Show game ending reason (victory type) also in server console, so that one running server-only autogame get to know it. See osdn #42618 Signed-off-by: Marko Lindqvist --- server/srv_main.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/server/srv_main.c b/server/srv_main.c index 24c6177561..1e24ef74c1 100644 --- a/server/srv_main.c +++ b/server/srv_main.c @@ -375,6 +375,7 @@ bool check_for_game_over(void) notify_conn(game.est_connections, NULL, E_GAME_END, ftc_server, /* TRANS: There can be several winners listed */ _("Scenario victory to %s."), astr_str(&str)); + log_normal(_("Scenario victory to %s."), astr_str(&str)); astr_free(&str); return TRUE; } @@ -403,6 +404,7 @@ bool check_for_game_over(void) if (0 == candidates) { notify_conn(game.est_connections, NULL, E_GAME_END, ftc_server, _("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 @@ -437,6 +439,7 @@ bool check_for_game_over(void) 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; @@ -493,6 +496,7 @@ bool check_for_game_over(void) notify_conn(game.est_connections, NULL, E_GAME_END, ftc_server, /* TRANS: There can be several winners listed */ _("Allied victory to %s."), astr_str(&str)); + log_normal(_("Allied victory to %s."), astr_str(&str)); astr_free(&str); player_list_destroy(winner_list); return TRUE; @@ -519,6 +523,7 @@ bool check_for_game_over(void) if (found) { notify_conn(game.est_connections, NULL, E_GAME_END, ftc_server, _("Game ended in conquest victory for %s."), player_name(victor)); + log_normal(_("Game ended in conquest victory for %s."), player_name(victor)); victor->is_winner = TRUE; return TRUE; } @@ -550,6 +555,8 @@ bool check_for_game_over(void) notify_conn(game.est_connections, NULL, E_GAME_END, ftc_server, _("Game ended in cultural domination victory for %s."), player_name(best)); + log_normal(_("Game ended in cultural domination victory for %s."), + player_name(best)); best->is_winner = TRUE; return TRUE; @@ -560,6 +567,7 @@ bool check_for_game_over(void) if (game.info.turn > game.server.end_turn) { notify_conn(game.est_connections, NULL, E_GAME_END, ftc_server, _("Game ended as the turn limit was exceeded.")); + log_normal(_("Game ended as the turn limit was exceeded.")); return TRUE; } else if (game.info.turn == game.server.end_turn) { /* Give them a chance to decide to extend the game */ -- 2.30.2