From: Holger Schemel Date: Sun, 12 Sep 2021 11:13:45 +0000 (+0200) Subject: added sending timestamp of batch tape uploads to score server X-Git-Tag: 4.3.0.0~63 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=e6f748f5628abdd08d3d55e879de5b0d495a4a08;p=rocksndiamonds.git added sending timestamp of batch tape uploads to score server --- diff --git a/src/files.c b/src/files.c index 1ff0a4d5..c14d8396 100644 --- a/src/files.c +++ b/src/files.c @@ -9358,6 +9358,7 @@ static void UploadScoreToServerExt(struct HttpRequest *request, "{\n" "%s" " \"game_version\": \"%s\",\n" + " \"batch_time\": \"%d\",\n" " \"levelset_identifier\": \"%s\",\n" " \"levelset_name\": \"%s\",\n" " \"levelset_author\": \"%s\",\n" @@ -9376,6 +9377,7 @@ static void UploadScoreToServerExt(struct HttpRequest *request, "}\n", getPasswordJSON(setup.api_server_password), getProgramRealVersionString(), + (int)global.autoplay_time, levelset_identifier, levelset_name, levelset_author, diff --git a/src/main.h b/src/main.h index f29e8b12..bdb2836c 100644 --- a/src/main.h +++ b/src/main.h @@ -3270,6 +3270,7 @@ struct GlobalInfo int autoplay_level[MAX_TAPES_PER_SET]; int autoplay_mode; boolean autoplay_all; + time_t autoplay_time; char *patchtapes_mode; char *patchtapes_leveldir; diff --git a/src/tape.c b/src/tape.c index cb6a9f92..e7a87852 100644 --- a/src/tape.c +++ b/src/tape.c @@ -1615,6 +1615,9 @@ static int AutoPlayTapesExt(boolean initialize) if (global.autoplay_mode == AUTOPLAY_MODE_FIX) options.mytapes = TRUE; + // set timestamp for batch tape upload + global.autoplay_time = time(NULL); + num_tapes = 0; init_level_set = TRUE; @@ -1823,6 +1826,9 @@ static int AutoPlayTapesExt(boolean initialize) return num_tapes; } + // clear timestamp for batch tape upload (required after interactive upload) + global.autoplay_time = 0; + if (program.headless) CloseAllAndExit(0);