Skip to content

Commit

Permalink
Don't return a replay URL for private games.
Browse files Browse the repository at this point in the history
The URL wouldn't work anyway.
  • Loading branch information
Pentarctagon committed Feb 24, 2021
1 parent cd2dd8d commit 387f4ae
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/server/common/dbconn.cpp
Expand Up @@ -125,7 +125,11 @@ std::unique_ptr<simple_wml::document> dbconn::get_game_history(int player_id, in
" IFNULL(era.ID, '') as ERA_ID, "
" IFNULL(GROUP_CONCAT(distinct mods.NAME, '') as MODIFICATION_NAMES, "
" IFNULL(GROUP_CONCAT(distinct mods.ID), '') as MODIFICATION_IDS, "
" concat('https://replays.wesnoth.org/', substring(game.INSTANCE_VERSION, 1, 4), '/', year(game.END_TIME), '/', lpad(month(game.END_TIME), 2, '0'), '/', lpad(day(game.END_TIME), 2, '0'), '/', game.REPLAY_NAME) as REPLAY_URL "
" case "
" when game.PUBLIC = 1 "
" then concat('https://replays.wesnoth.org/', substring(game.INSTANCE_VERSION, 1, 4), '/', year(game.END_TIME), '/', lpad(month(game.END_TIME), 2, '0'), '/', lpad(day(game.END_TIME), 2, '0'), '/', game.REPLAY_NAME) "
" else '' "
" end as REPLAY_URL "
"from "+db_game_info_table_+" game "
"inner join "+db_game_player_info_table_+" player "
" on exists "
Expand Down

0 comments on commit 387f4ae

Please sign in to comment.