v3.0.0: Umschalten wartet nicht mehr aufs Auffrischen (abbrechbar, CA-Abruf zuletzt), schnellere Prüfintervalle

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Nico Meister
2026-10-19 21:13:44 +02:00
co-authored by Claude Opus 5.5
parent c384c20558
commit f5fc0861c7
11 changed files with 113 additions and 53 deletions
+5 -5
View File
@@ -92,20 +92,20 @@ static Result unload(void)
Result rc = step("Offline gehen (exklusiv)", NDMU_EnterExclusiveState(NDM_EXCLUSIVE_STATE_LOCAL_COMMUNICATIONS));
if (R_FAILED(rc)) return rc;
for (int i = 0; i < 150; i++) { // höchstens 15 Sekunden
for (int i = 0; i < 1500; i++) { // höchstens 15 Sekunden, alle 10 ms nachsehen
bool online = true;
if (R_FAILED(FRD_IsOnline(&online)) || !online) break;
svcSleepThread(100 * 1000 * 1000);
svcSleepThread(10 * 1000 * 1000);
}
// Hängt der Freunde-Dienst noch an einer Anfrage, kurz wiederholen
for (int attempt = 1; attempt <= 40; attempt++) {
if (attempt == 21) note("Freunde-Dienst erneut abmelden", FRD_Logout());
for (int attempt = 1; attempt <= 200; attempt++) { // alle 100 ms, höchstens 20 s
if (attempt == 100) note("Freunde-Dienst erneut abmelden", FRD_Logout());
rc = FRDA_UnloadLocalAccount();
if (R_SUCCEEDED(rc)) {
if (logf) fprintf(logf, "%-36s %08lX (Versuch %d)\n", "Freundekonto abmelden", (unsigned long)rc, attempt);
return rc;
}
svcSleepThread(500 * 1000 * 1000);
svcSleepThread(100 * 1000 * 1000);
}
return step("Freundekonto abmelden (20 s)", rc);
}