mirror of
https://github.com/CraftyBoss/SuperMarioOdysseyOnline.git
synced 2024-11-22 03:05:16 +00:00
[mod menu] new: tell the user to restart the game after changing the server
This commit is contained in:
parent
82cc6ffe91
commit
8797d58c94
3 changed files with 25 additions and 0 deletions
|
@ -135,6 +135,8 @@ class Client {
|
|||
|
||||
static const int getCurrentPort();
|
||||
|
||||
static const bool hasServerChanged();
|
||||
|
||||
static int getConnectCount() {
|
||||
if (sInstance) {
|
||||
return sInstance->mConnectCount;
|
||||
|
|
|
@ -1305,6 +1305,21 @@ const int Client::getCurrentPort() {
|
|||
return -1;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief
|
||||
*
|
||||
* @return const bool
|
||||
*/
|
||||
const bool Client::hasServerChanged() {
|
||||
if (!sInstance) {
|
||||
return false;
|
||||
}
|
||||
return (
|
||||
getCurrentPort() != sInstance->mSocket->getPort()
|
||||
|| strcmp(getCurrentIP(), sInstance->mSocket->getIP()) != 0
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief sets server IP to supplied string, used specifically for loading IP from the save file.
|
||||
*
|
||||
|
|
|
@ -109,6 +109,14 @@ void StageSceneStateServerConfig::appear(void) {
|
|||
void StageSceneStateServerConfig::kill(void) {
|
||||
mCurrentMenu->startEnd("End");
|
||||
al::NerveStateBase::kill();
|
||||
|
||||
if (Client::hasServerChanged()) {
|
||||
#if EMU
|
||||
Client::showUIMessage(u"You changed the server and have to restart the emulator now.");
|
||||
#else
|
||||
Client::showUIMessage(u"You changed the server and have to restart the game now.");
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
al::MessageSystem* StageSceneStateServerConfig::getMessageSystem(void) const {
|
||||
|
|
Loading…
Reference in a new issue