recycle the reconnect error to warn about the default Ryujinx profile ID

This commit is contained in:
Robin C. Ladiges 2023-07-08 20:45:53 +02:00
parent c736878df1
commit 45cd4442c8
No known key found for this signature in database
GPG key ID: B494D3DF92661B99
3 changed files with 45 additions and 2 deletions

View file

@ -16,6 +16,7 @@
#include "al/LiveActor/LiveActor.h"
#include "al/layout/LayoutInitInfo.h"
#include "al/layout/SimpleLayoutAppearWaitEnd.h"
#include "al/layout/WindowConfirmWait.h"
#include "al/util.hpp"
#include "al/layout/LayoutActor.h"
#include "al/gamepad/util.h"
@ -173,6 +174,9 @@ class Client {
static bool openKeyboardIP();
static bool openKeyboardPort();
static void showUIMessage(const char16_t* msg);
static void hideUIMessage();
void resetCollectedShines();
void removeShine(int shineId);
@ -232,7 +236,7 @@ class Client {
bool mIsFirstConnect = true;
// --- Game Layouts ---
al::WindowConfirmWait* mUIMessage;
al::SimpleLayoutAppearWaitEnd *mConnectStatus;
// --- Game Info ---

View file

@ -72,10 +72,13 @@ Client::Client() {
void Client::init(al::LayoutInitInfo const &initInfo, GameDataHolderAccessor holder) {
mConnectStatus = new (mHeap) al::SimpleLayoutAppearWaitEnd("", "SaveMessage", initInfo, 0, false);
al::setPaneString(mConnectStatus, "TxtSave", u"Connecting to Server.", 0);
al::setPaneString(mConnectStatus, "TxtSaveSh", u"Connecting to Server.", 0);
mUIMessage = new (mHeap) al::WindowConfirmWait("ServerWaitConnect", "WindowConfirmWait", initInfo);
mUIMessage->setTxtMessage(u"a");
mUIMessage->setTxtMessageConfirm(u"b");
mHolder = holder;
startThread();
@ -250,6 +253,33 @@ bool Client::openKeyboardPort() {
return isFirstConnect;
}
void Client::showUIMessage(const char16_t* msg) {
if (!sInstance) {
return;
}
sInstance->mUIMessage->setTxtMessageConfirm(msg);
al::hidePane(sInstance->mUIMessage, "Page01"); // hide A button prompt
if (!sInstance->mUIMessage->mIsAlive) {
sInstance->mUIMessage->appear();
sInstance->mUIMessage->playLoop();
}
al::startAction(sInstance->mUIMessage, "Confirm", "State");
}
void Client::hideUIMessage() {
if (!sInstance) {
return;
}
sInstance->mUIMessage->tryEnd();
}
/**
* @brief main thread function for read thread, responsible for processing packets from server
*

View file

@ -109,6 +109,15 @@ StageSceneStateServerConfig::StageSceneStateServerConfig(const char *name, al::S
void StageSceneStateServerConfig::init() {
initNerve(&nrvStageSceneStateServerConfigMainMenu, 0);
#ifdef EMU
char ryujinx[0x10] = { 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
nn::account::Uid user;
nn::account::GetLastOpenedUser(&user);
if (memcmp(user.data, ryujinx, 0x10) == 0) {
Client::showUIMessage(u"Error: Ryujinx default profile detected.\nYou have to create a new user profile!");
}
#endif
}
void StageSceneStateServerConfig::appear(void) {