arch codereview
This commit is contained in:
+33
-6
@@ -4,6 +4,7 @@
|
||||
#include <const.h>
|
||||
#include <client.hpp>
|
||||
#include <server.hpp>
|
||||
#include <TransferOverlay.hpp>
|
||||
|
||||
static std::vector<uint64_t> accSids, devSids, bcatSids, cacheSids;
|
||||
|
||||
@@ -44,9 +45,21 @@ namespace ui {
|
||||
auto result = io::backup(index, g_currentUId);
|
||||
if (std::get<0>(result)) {
|
||||
printf("path is %s\n", std::get<2>(result).c_str());
|
||||
std::string path = std::get<2>(result);
|
||||
std::string path = std::get<2>(result);
|
||||
auto directory = std::filesystem::path(path);
|
||||
transfer_files(directory);
|
||||
auto ovl = TransferOverlay::New("Transferring save data...");
|
||||
mainApp->StartOverlay(ovl);
|
||||
while (!isClientTransferDone()) {
|
||||
ovl->SetStatus(getClientStatusText());
|
||||
ovl->SetProgress(getClientProgress());
|
||||
mainApp->CallForRender();
|
||||
if (mainApp->GetButtonsDown() & HidNpadButton_B) {
|
||||
cancelClientTransfer();
|
||||
}
|
||||
svcSleepThread(16666666LL);
|
||||
}
|
||||
mainApp->EndOverlay();
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -56,11 +69,25 @@ namespace ui {
|
||||
int result = startSendingThread();
|
||||
printf("result is %i\n", result);
|
||||
if (result == 0) {
|
||||
auto restoreResult = io::restore(index, g_currentUId, 0, title.name());
|
||||
if (std::get<0>(restoreResult)) {
|
||||
printf("%s\n", std::get<2>(restoreResult).c_str());
|
||||
} else {
|
||||
printf("Failed to restore with error %s\n", std::get<2>(restoreResult).c_str());
|
||||
auto ovl = TransferOverlay::New("Receiving save data...");
|
||||
mainApp->StartOverlay(ovl);
|
||||
while (!isServerTransferDone()) {
|
||||
ovl->SetStatus(getServerStatusText());
|
||||
ovl->SetProgress(getServerProgress());
|
||||
mainApp->CallForRender();
|
||||
if (mainApp->GetButtonsDown() & HidNpadButton_B) {
|
||||
cancelServerTransfer();
|
||||
}
|
||||
svcSleepThread(16666666LL);
|
||||
}
|
||||
mainApp->EndOverlay();
|
||||
if (!isServerTransferCancelled()) {
|
||||
auto restoreResult = io::restore(index, g_currentUId, 0, title.name());
|
||||
if (std::get<0>(restoreResult)) {
|
||||
printf("%s\n", std::get<2>(restoreResult).c_str());
|
||||
} else {
|
||||
printf("Failed to restore with error %s\n", std::get<2>(restoreResult).c_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user