mirror of
https://github.com/wiiu-env/wiiload_plugin.git
synced 2024-11-21 18:19:15 +01:00
Prevent loading homebre when currently no account is loaded
This commit is contained in:
parent
2b28fd3afa
commit
8854ff3f90
@ -9,6 +9,7 @@
|
||||
#include <coreinit/dynload.h>
|
||||
#include <coreinit/title.h>
|
||||
#include <cstring>
|
||||
#include <nn/act.h>
|
||||
#include <notifications/notifications.h>
|
||||
#include <rpxloader/rpxloader.h>
|
||||
#include <sysapp/launch.h>
|
||||
@ -123,6 +124,9 @@ void TcpReceiver::executeThread() {
|
||||
case LAUNCH_FAILED:
|
||||
NotificationModule_AddErrorNotification("Wiiload plugin: Failed to launch homebrew. Launching will be aborted.");
|
||||
break;
|
||||
case NO_ACTIVE_ACCOUNT:
|
||||
NotificationModule_AddErrorNotification("Wiiload plugin: Failed to launch homebrew. No active account loaded.");
|
||||
break;
|
||||
}
|
||||
|
||||
if (result == SUCCESS) {
|
||||
@ -233,6 +237,15 @@ TcpReceiver::eLoadResults TcpReceiver::loadBinary(void *data, uint32_t fileSize)
|
||||
if (error != SUCCESS) {
|
||||
return error;
|
||||
}
|
||||
|
||||
nn::act::Initialize();
|
||||
bool accountLoaded = nn::act::IsSlotOccupied(nn::act::GetSlotNo());
|
||||
nn::act::Finalize();
|
||||
|
||||
if (!accountLoaded) {
|
||||
return NO_ACTIVE_ACCOUNT;
|
||||
}
|
||||
|
||||
RPXLoaderStatus launchRes;
|
||||
if ((launchRes = RPXLoader_LaunchHomebrew(loadedPath.c_str())) != RPX_LOADER_RESULT_SUCCESS) {
|
||||
DEBUG_FUNCTION_LINE_ERR("Failed to start %s %s", loadedPath.c_str(), RPXLoader_GetStatusStr(launchRes));
|
||||
|
@ -18,6 +18,7 @@ public:
|
||||
NOT_ENOUGH_MEMORY = -6,
|
||||
RECV_ERROR = -7,
|
||||
LAUNCH_FAILED = -8,
|
||||
NO_ACTIVE_ACCOUNT = -9,
|
||||
};
|
||||
|
||||
explicit TcpReceiver(int32_t port);
|
||||
|
Loading…
Reference in New Issue
Block a user