v3.0.7: ACT_Initialize mit SDK-Version und Speicherblock (sonst lehnt act Server-Anfragen ab)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
f7590a939e
commit
4cc3329dab
@@ -17,7 +17,7 @@ SOURCES := source
|
||||
INCLUDES := source
|
||||
|
||||
# Bei jedem Release erhöhen - das Auto-Update vergleicht diese Nummer
|
||||
VERSION := 3.0.6
|
||||
VERSION := 3.0.7
|
||||
|
||||
APP_TITLE := MBMNET
|
||||
APP_DESCRIPTION := Dein eigenes 3DS-Netzwerk
|
||||
|
||||
+23
-1
@@ -6,6 +6,8 @@
|
||||
// vorher in /3ds/mbmnet/alte-nnid.txt gesichert.
|
||||
#include <3ds.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <malloc.h>
|
||||
#include <string.h>
|
||||
#include <strings.h>
|
||||
#include <sys/stat.h>
|
||||
@@ -18,16 +20,36 @@
|
||||
|
||||
static bool ready;
|
||||
|
||||
// Für Anfragen an den Account-Server (Konto-Abgleich, Anmelde-Nachweis) muss sich die App bei act anmelden:
|
||||
// SDK-Version und ein gemeinsamer Speicherblock, den act als Arbeitsspeicher nutzt. actInit() aus libctru macht
|
||||
// das nicht - ohne lehnte act jede Server-Anfrage mit "ungültiger Zustand" ab (C8A14F4B, E0A14CCE).
|
||||
#define ACT_SDK_VERSION 0xB0502C8
|
||||
#define ACT_SHMEM_SIZE 0x20000
|
||||
static u8 *actShm;
|
||||
static Handle actShmBlock;
|
||||
|
||||
Result nnid_init(void)
|
||||
{
|
||||
Result rc = actInit(false); // false = act:a (Verwaltung)
|
||||
ready = R_SUCCEEDED(rc);
|
||||
if (!ready) return rc;
|
||||
actShm = memalign(0x1000, ACT_SHMEM_SIZE);
|
||||
if (actShm) {
|
||||
memset(actShm, 0, ACT_SHMEM_SIZE);
|
||||
if (R_SUCCEEDED(svcCreateMemoryBlock(&actShmBlock, (u32)actShm, ACT_SHMEM_SIZE, 0, MEMPERM_READ | MEMPERM_WRITE)))
|
||||
ACT_Initialize(ACT_SDK_VERSION, ACT_SHMEM_SIZE, actShmBlock);
|
||||
else { free(actShm); actShm = NULL; }
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
|
||||
void nnid_exit(void)
|
||||
{
|
||||
if (ready) actExit();
|
||||
if (!ready) return;
|
||||
actExit();
|
||||
if (actShmBlock) svcCloseHandle(actShmBlock);
|
||||
free(actShm);
|
||||
actShm = NULL;
|
||||
}
|
||||
|
||||
static u8 current_slot(void)
|
||||
|
||||
Reference in New Issue
Block a user