Changed how the TryParse function works (and also did some general cleanup along the way)

This commit is contained in:
jadebenn
2024-02-02 17:50:30 -06:00
parent d78b50874c
commit 4f75479a4c
34 changed files with 506 additions and 535 deletions

View File

@@ -17,7 +17,8 @@
InstanceManager::InstanceManager(Logger* logger, const std::string& externalIP) {
mLogger = logger;
mExternalIP = externalIP;
GeneralUtils::TryParse(Game::config->GetValue("world_port_start"), m_LastPort);
m_LastPort =
GeneralUtils::TryParse<decltype(m_LastPort)>(Game::config->GetValue("world_port_start")).value_or(m_LastPort);
m_LastInstanceID = LWOINSTANCEID_INVALID;
}