snprintf(request->body, MAX_HTTP_BODY_SIZE,
"{\n"
"%s"
+ " \"game_version\": \"%s\",\n"
" \"name\": \"%s\",\n"
" \"uuid\": \"%s\"\n"
"}\n",
getPasswordJSON(setup.api_server_password),
+ getProgramRealVersionString(),
player_name,
player_uuid);
if (game_status != GAME_MODE_PLAYING)
return;
- GameActions(); // main game loop
+ GameActions(); // main game loop
if (tape.auto_play && !tape.playing)
- AutoPlayTapes(); // continue automatically playing next tape
+ AutoPlayTapesContinue(); // continue automatically playing next tape
}
}
}
}
+
+static int UploadTapes(void)
+{
+ SetGameStatus(GAME_MODE_LOADING);
+
+ FadeSetEnterScreen();
+ FadeOut(REDRAW_ALL);
+
+ ClearRectangle(drawto, 0, 0, WIN_XSIZE, WIN_YSIZE);
+
+ FadeIn(REDRAW_ALL);
+
+ DrawInitTextHead("Uploading tapes");
+
+ global.autoplay_mode = AUTOPLAY_MODE_UPLOAD;
+ global.autoplay_leveldir = "ALL";
+ global.autoplay_all = TRUE;
+
+ int num_tapes_uploaded = AutoPlayTapes();
+
+ global.autoplay_mode = AUTOPLAY_MODE_NONE;
+ global.autoplay_leveldir = NULL;
+ global.autoplay_all = FALSE;
+
+ SetGameStatus(GAME_MODE_MAIN);
+
+ DrawMainMenu();
+
+ return num_tapes_uploaded;
+}
+
+void CheckUploadTapes(void)
+{
+ if (!setup.ask_for_uploading_tapes)
+ return;
+
+ if (directoryExists(getTapeDir(NULL)))
+ {
+ if (Request("Upload all your tapes to the high score server now?", REQ_ASK))
+ {
+ int num_tapes_uploaded = UploadTapes();
+ char message[100];
+
+ sprintf(message, "%d tapes uploaded!", num_tapes_uploaded);
+
+ Request(message, REQ_CONFIRM);
+ }
+ else
+ {
+ Request("You can upload your tapes from the setup menu later!", REQ_CONFIRM);
+ }
+ }
+
+ setup.ask_for_uploading_tapes = FALSE;
+
+ SaveSetup();
+}