mirror of
https://github.com/CraftyBoss/SuperMarioOdysseyOnline.git
synced 2024-11-24 12:15:16 +00:00
remove reconnect button
This commit is contained in:
parent
4339847da5
commit
366ad5e888
4 changed files with 6 additions and 138 deletions
|
@ -29,7 +29,6 @@ class StageSceneStateServerConfig : public al::HostStateBase<al::Scene>, public
|
||||||
enum ServerConfigOption {
|
enum ServerConfigOption {
|
||||||
GAMEMODECONFIG,
|
GAMEMODECONFIG,
|
||||||
GAMEMODESWITCH,
|
GAMEMODESWITCH,
|
||||||
RECONNECT,
|
|
||||||
SETIP,
|
SETIP,
|
||||||
SETPORT
|
SETPORT
|
||||||
};
|
};
|
||||||
|
@ -42,11 +41,9 @@ class StageSceneStateServerConfig : public al::HostStateBase<al::Scene>, public
|
||||||
void exeMainMenu();
|
void exeMainMenu();
|
||||||
void exeOpenKeyboardIP();
|
void exeOpenKeyboardIP();
|
||||||
void exeOpenKeyboardPort();
|
void exeOpenKeyboardPort();
|
||||||
void exeRestartServer();
|
|
||||||
void exeGamemodeConfig();
|
void exeGamemodeConfig();
|
||||||
void exeGamemodeSelect();
|
void exeGamemodeSelect();
|
||||||
void exeSaveData();
|
void exeSaveData();
|
||||||
void exeConnectError();
|
|
||||||
|
|
||||||
void endSubMenu();
|
void endSubMenu();
|
||||||
|
|
||||||
|
@ -63,7 +60,7 @@ class StageSceneStateServerConfig : public al::HostStateBase<al::Scene>, public
|
||||||
|
|
||||||
SimpleLayoutMenu* mCurrentMenu = nullptr;
|
SimpleLayoutMenu* mCurrentMenu = nullptr;
|
||||||
CommonVerticalList* mCurrentList = nullptr;
|
CommonVerticalList* mCurrentList = nullptr;
|
||||||
// Root Page, contains buttons for gamemode config, server reconnecting, and server ip address changing
|
// Root Page, contains buttons for gamemode config, and server ip address changing
|
||||||
SimpleLayoutMenu* mMainOptions = nullptr;
|
SimpleLayoutMenu* mMainOptions = nullptr;
|
||||||
CommonVerticalList *mMainOptionsList = nullptr;
|
CommonVerticalList *mMainOptionsList = nullptr;
|
||||||
// Sub-Page of Mode config, used to select a gamemode for the client to use
|
// Sub-Page of Mode config, used to select a gamemode for the client to use
|
||||||
|
@ -86,9 +83,7 @@ namespace {
|
||||||
NERVE_HEADER(StageSceneStateServerConfig, MainMenu)
|
NERVE_HEADER(StageSceneStateServerConfig, MainMenu)
|
||||||
NERVE_HEADER(StageSceneStateServerConfig, OpenKeyboardIP)
|
NERVE_HEADER(StageSceneStateServerConfig, OpenKeyboardIP)
|
||||||
NERVE_HEADER(StageSceneStateServerConfig, OpenKeyboardPort)
|
NERVE_HEADER(StageSceneStateServerConfig, OpenKeyboardPort)
|
||||||
NERVE_HEADER(StageSceneStateServerConfig, RestartServer)
|
|
||||||
NERVE_HEADER(StageSceneStateServerConfig, GamemodeConfig)
|
NERVE_HEADER(StageSceneStateServerConfig, GamemodeConfig)
|
||||||
NERVE_HEADER(StageSceneStateServerConfig, GamemodeSelect)
|
NERVE_HEADER(StageSceneStateServerConfig, GamemodeSelect)
|
||||||
NERVE_HEADER(StageSceneStateServerConfig, SaveData)
|
NERVE_HEADER(StageSceneStateServerConfig, SaveData)
|
||||||
NERVE_HEADER(StageSceneStateServerConfig, ConnectError)
|
}
|
||||||
}
|
|
||||||
|
|
|
@ -16,7 +16,6 @@
|
||||||
#include "al/LiveActor/LiveActor.h"
|
#include "al/LiveActor/LiveActor.h"
|
||||||
#include "al/layout/LayoutInitInfo.h"
|
#include "al/layout/LayoutInitInfo.h"
|
||||||
#include "al/layout/SimpleLayoutAppearWaitEnd.h"
|
#include "al/layout/SimpleLayoutAppearWaitEnd.h"
|
||||||
#include "al/layout/WindowConfirmWait.h"
|
|
||||||
#include "al/util.hpp"
|
#include "al/util.hpp"
|
||||||
#include "al/layout/LayoutActor.h"
|
#include "al/layout/LayoutActor.h"
|
||||||
#include "al/gamepad/util.h"
|
#include "al/gamepad/util.h"
|
||||||
|
@ -88,7 +87,6 @@ class Client {
|
||||||
|
|
||||||
bool startThread();
|
bool startThread();
|
||||||
void readFunc();
|
void readFunc();
|
||||||
static void restartConnection();
|
|
||||||
|
|
||||||
static bool isSocketActive() { return sInstance ? sInstance->mSocket->isConnected() : false; };
|
static bool isSocketActive() { return sInstance ? sInstance->mSocket->isConnected() : false; };
|
||||||
bool isPlayerConnected(int index) { return mPuppetInfoArr[index]->isConnected; }
|
bool isPlayerConnected(int index) { return mPuppetInfoArr[index]->isConnected; }
|
||||||
|
@ -175,12 +173,6 @@ class Client {
|
||||||
static bool openKeyboardIP();
|
static bool openKeyboardIP();
|
||||||
static bool openKeyboardPort();
|
static bool openKeyboardPort();
|
||||||
|
|
||||||
static void showConnect();
|
|
||||||
|
|
||||||
static void showConnectError(const char16_t* msg);
|
|
||||||
|
|
||||||
static void hideConnect();
|
|
||||||
|
|
||||||
void resetCollectedShines();
|
void resetCollectedShines();
|
||||||
|
|
||||||
void removeShine(int shineId);
|
void removeShine(int shineId);
|
||||||
|
@ -241,8 +233,6 @@ class Client {
|
||||||
|
|
||||||
// --- Game Layouts ---
|
// --- Game Layouts ---
|
||||||
|
|
||||||
al::WindowConfirmWait* mConnectionWait;
|
|
||||||
|
|
||||||
al::SimpleLayoutAppearWaitEnd *mConnectStatus;
|
al::SimpleLayoutAppearWaitEnd *mConnectStatus;
|
||||||
|
|
||||||
// --- Game Info ---
|
// --- Game Info ---
|
||||||
|
|
|
@ -71,13 +71,8 @@ Client::Client() {
|
||||||
*/
|
*/
|
||||||
void Client::init(al::LayoutInitInfo const &initInfo, GameDataHolderAccessor holder) {
|
void Client::init(al::LayoutInitInfo const &initInfo, GameDataHolderAccessor holder) {
|
||||||
|
|
||||||
mConnectionWait = new (mHeap) al::WindowConfirmWait("ServerWaitConnect", "WindowConfirmWait", initInfo);
|
|
||||||
|
|
||||||
mConnectStatus = new (mHeap) al::SimpleLayoutAppearWaitEnd("", "SaveMessage", initInfo, 0, false);
|
mConnectStatus = new (mHeap) al::SimpleLayoutAppearWaitEnd("", "SaveMessage", initInfo, 0, false);
|
||||||
|
|
||||||
mConnectionWait->setTxtMessage(u"Connecting to Server.");
|
|
||||||
mConnectionWait->setTxtMessageConfirm(u"Failed to Connect!");
|
|
||||||
|
|
||||||
al::setPaneString(mConnectStatus, "TxtSave", u"Connecting to Server.", 0);
|
al::setPaneString(mConnectStatus, "TxtSave", u"Connecting to Server.", 0);
|
||||||
al::setPaneString(mConnectStatus, "TxtSaveSh", u"Connecting to Server.", 0);
|
al::setPaneString(mConnectStatus, "TxtSaveSh", u"Connecting to Server.", 0);
|
||||||
|
|
||||||
|
@ -105,44 +100,6 @@ bool Client::startThread() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief restarts currently active connection to server
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
void Client::restartConnection() {
|
|
||||||
|
|
||||||
if (!sInstance) {
|
|
||||||
Logger::log("Static Instance is null!\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
sead::ScopedCurrentHeapSetter setter(sInstance->mHeap);
|
|
||||||
|
|
||||||
Logger::log("Sending Disconnect.\n");
|
|
||||||
|
|
||||||
PlayerDC *playerDC = new PlayerDC();
|
|
||||||
|
|
||||||
playerDC->mUserID = sInstance->mUserID;
|
|
||||||
|
|
||||||
sInstance->mSocket->queuePacket(playerDC);
|
|
||||||
|
|
||||||
if (sInstance->mSocket->closeSocket()) {
|
|
||||||
Logger::log("Sucessfully Closed Socket.\n");
|
|
||||||
}
|
|
||||||
|
|
||||||
sInstance->mConnectCount = 0;
|
|
||||||
|
|
||||||
sInstance->mIsConnectionActive = sInstance->mSocket->init(sInstance->mServerIP.cstr(), sInstance->mServerPort).isSuccess();
|
|
||||||
|
|
||||||
if(sInstance->mSocket->getLogState() == SOCKET_LOG_CONNECTED) {
|
|
||||||
|
|
||||||
Logger::log("Reconnect Sucessful!\n");
|
|
||||||
|
|
||||||
} else {
|
|
||||||
Logger::log("Reconnect Unsuccessful.\n");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief starts a connection using client's TCP socket class, pulling up the software keyboard for user inputted IP if save file does not have one saved.
|
* @brief starts a connection using client's TCP socket class, pulling up the software keyboard for user inputted IP if save file does not have one saved.
|
||||||
*
|
*
|
||||||
|
@ -1393,37 +1350,3 @@ Shine* Client::findStageShine(int shineID) {
|
||||||
}
|
}
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Client::showConnectError(const char16_t* msg) {
|
|
||||||
if (!sInstance)
|
|
||||||
return;
|
|
||||||
|
|
||||||
sInstance->mConnectionWait->setTxtMessageConfirm(msg);
|
|
||||||
|
|
||||||
al::hidePane(sInstance->mConnectionWait, "Page01"); // hide A button prompt
|
|
||||||
|
|
||||||
if (!sInstance->mConnectionWait->mIsAlive) {
|
|
||||||
sInstance->mConnectionWait->appear();
|
|
||||||
|
|
||||||
sInstance->mConnectionWait->playLoop();
|
|
||||||
}
|
|
||||||
|
|
||||||
al::startAction(sInstance->mConnectionWait, "Confirm", "State");
|
|
||||||
}
|
|
||||||
|
|
||||||
void Client::showConnect() {
|
|
||||||
if (!sInstance)
|
|
||||||
return;
|
|
||||||
|
|
||||||
sInstance->mConnectionWait->appear();
|
|
||||||
|
|
||||||
sInstance->mConnectionWait->playLoop();
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void Client::hideConnect() {
|
|
||||||
if (!sInstance)
|
|
||||||
return;
|
|
||||||
|
|
||||||
sInstance->mConnectionWait->tryEnd();
|
|
||||||
}
|
|
||||||
|
|
|
@ -41,14 +41,13 @@ StageSceneStateServerConfig::StageSceneStateServerConfig(const char *name, al::S
|
||||||
|
|
||||||
mMainOptionsList->unkInt1 = 1;
|
mMainOptionsList->unkInt1 = 1;
|
||||||
|
|
||||||
mMainOptionsList->initDataNoResetSelected(5);
|
mMainOptionsList->initDataNoResetSelected(4);
|
||||||
|
|
||||||
sead::SafeArray<sead::WFixedSafeString<0x200>, 5>* mainMenuOptions =
|
sead::SafeArray<sead::WFixedSafeString<0x200>, 4>* mainMenuOptions =
|
||||||
new sead::SafeArray<sead::WFixedSafeString<0x200>, 5>();
|
new sead::SafeArray<sead::WFixedSafeString<0x200>, 4>();
|
||||||
|
|
||||||
mainMenuOptions->mBuffer[ServerConfigOption::GAMEMODECONFIG].copy(u"Gamemode Config");
|
mainMenuOptions->mBuffer[ServerConfigOption::GAMEMODECONFIG].copy(u"Gamemode Config");
|
||||||
mainMenuOptions->mBuffer[ServerConfigOption::GAMEMODESWITCH].copy(u"Change Gamemode");
|
mainMenuOptions->mBuffer[ServerConfigOption::GAMEMODESWITCH].copy(u"Change Gamemode");
|
||||||
mainMenuOptions->mBuffer[ServerConfigOption::RECONNECT].copy(u"Reconnect to Server");
|
|
||||||
mainMenuOptions->mBuffer[ServerConfigOption::SETIP].copy(u"Change Server IP");
|
mainMenuOptions->mBuffer[ServerConfigOption::SETIP].copy(u"Change Server IP");
|
||||||
mainMenuOptions->mBuffer[ServerConfigOption::SETPORT].copy(u"Change Server Port");
|
mainMenuOptions->mBuffer[ServerConfigOption::SETPORT].copy(u"Change Server Port");
|
||||||
|
|
||||||
|
@ -176,10 +175,6 @@ void StageSceneStateServerConfig::exeMainMenu() {
|
||||||
al::setNerve(this, &nrvStageSceneStateServerConfigGamemodeSelect);
|
al::setNerve(this, &nrvStageSceneStateServerConfigGamemodeSelect);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case ServerConfigOption::RECONNECT: {
|
|
||||||
al::setNerve(this, &nrvStageSceneStateServerConfigRestartServer);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case ServerConfigOption::SETIP: {
|
case ServerConfigOption::SETIP: {
|
||||||
al::setNerve(this, &nrvStageSceneStateServerConfigOpenKeyboardIP);
|
al::setNerve(this, &nrvStageSceneStateServerConfigOpenKeyboardIP);
|
||||||
break;
|
break;
|
||||||
|
@ -233,27 +228,6 @@ void StageSceneStateServerConfig::exeOpenKeyboardPort() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void StageSceneStateServerConfig::exeRestartServer() {
|
|
||||||
if (al::isFirstStep(this)) {
|
|
||||||
mCurrentList->deactivate();
|
|
||||||
|
|
||||||
Client::showConnect();
|
|
||||||
|
|
||||||
Client::restartConnection();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (Client::isSocketActive()) {
|
|
||||||
|
|
||||||
Client::hideConnect();
|
|
||||||
|
|
||||||
al::startHitReaction(mCurrentMenu, "リセット", 0);
|
|
||||||
|
|
||||||
al::setNerve(this, &nrvStageSceneStateServerConfigMainMenu);
|
|
||||||
} else {
|
|
||||||
al::setNerve(this, &nrvStageSceneStateServerConfigConnectError);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void StageSceneStateServerConfig::exeGamemodeConfig() {
|
void StageSceneStateServerConfig::exeGamemodeConfig() {
|
||||||
if (al::isFirstStep(this)) {
|
if (al::isFirstStep(this)) {
|
||||||
mGamemodeConfigMenu = &mGamemodeConfigMenus[GameModeManager::instance()->getGameMode()];
|
mGamemodeConfigMenu = &mGamemodeConfigMenus[GameModeManager::instance()->getGameMode()];
|
||||||
|
@ -290,18 +264,6 @@ void StageSceneStateServerConfig::exeGamemodeSelect() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void StageSceneStateServerConfig::exeConnectError() {
|
|
||||||
if (al::isFirstStep(this)) {
|
|
||||||
Client::showConnectError(u"Failed to Reconnect!");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (al::isGreaterEqualStep(this, 60)) { // close after 1 second
|
|
||||||
Client::hideConnect();
|
|
||||||
al::startHitReaction(mCurrentMenu, "リセット", 0);
|
|
||||||
al::setNerve(this, &nrvStageSceneStateServerConfigMainMenu);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void StageSceneStateServerConfig::exeSaveData() {
|
void StageSceneStateServerConfig::exeSaveData() {
|
||||||
|
|
||||||
if (al::isFirstStep(this)) {
|
if (al::isFirstStep(this)) {
|
||||||
|
@ -373,9 +335,7 @@ namespace {
|
||||||
NERVE_IMPL(StageSceneStateServerConfig, MainMenu)
|
NERVE_IMPL(StageSceneStateServerConfig, MainMenu)
|
||||||
NERVE_IMPL(StageSceneStateServerConfig, OpenKeyboardIP)
|
NERVE_IMPL(StageSceneStateServerConfig, OpenKeyboardIP)
|
||||||
NERVE_IMPL(StageSceneStateServerConfig, OpenKeyboardPort)
|
NERVE_IMPL(StageSceneStateServerConfig, OpenKeyboardPort)
|
||||||
NERVE_IMPL(StageSceneStateServerConfig, RestartServer)
|
|
||||||
NERVE_IMPL(StageSceneStateServerConfig, GamemodeConfig)
|
NERVE_IMPL(StageSceneStateServerConfig, GamemodeConfig)
|
||||||
NERVE_IMPL(StageSceneStateServerConfig, GamemodeSelect)
|
NERVE_IMPL(StageSceneStateServerConfig, GamemodeSelect)
|
||||||
NERVE_IMPL(StageSceneStateServerConfig, SaveData)
|
NERVE_IMPL(StageSceneStateServerConfig, SaveData)
|
||||||
NERVE_IMPL(StageSceneStateServerConfig, ConnectError)
|
}
|
||||||
}
|
|
||||||
|
|
Loading…
Reference in a new issue