Implement Client::setLastUsedPort

This commit is contained in:
Somebody Whoisbored 2022-06-18 21:42:59 -07:00
parent f8b4bd690d
commit 9b275da22b
1 changed files with 23 additions and 0 deletions

View File

@ -1361,6 +1361,18 @@ const char* Client::getCurrentIP() {
return nullptr;
}
/**
* @brief
*
* @return const int
*/
const int Client::getCurrentPort() {
if (sInstance) {
return sInstance->mServerPort;
}
return -1;
}
/**
* @brief sets server IP to supplied string, used specifically for loading IP from the save file.
*
@ -1372,6 +1384,17 @@ void Client::setLastUsedIP(const char* ip) {
}
}
/**
* @brief sets server port to supplied string, used specifically for loading port from the save file.
*
* @param port
*/
void Client::setLastUsedPort(const int port) {
if (sInstance) {
sInstance->mServerPort = port;
}
}
/**
* @brief creates new scene info and copies supplied info to the new info, as well as stores a const ptr to the current stage scene.
*