mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-10-10 09:28:06 +00:00
Changed how the TryParse function works (and also did some general cleanup along the way)
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
@@ -134,7 +134,7 @@ private:
|
||||
Logger* mLogger;
|
||||
std::string mExternalIP;
|
||||
std::vector<Instance*> m_Instances;
|
||||
unsigned short m_LastPort = 3000;
|
||||
uint16_t m_LastPort = 3000;
|
||||
LWOINSTANCEID m_LastInstanceID;
|
||||
|
||||
/**
|
||||
|
@@ -89,9 +89,8 @@ int main(int argc, char** argv) {
|
||||
if (!dConfig::Exists("worldconfig.ini")) LOG("Could not find worldconfig.ini, using default settings");
|
||||
|
||||
|
||||
uint32_t clientNetVersion = 171022;
|
||||
const auto clientNetVersionString = Game::config->GetValue("client_net_version");
|
||||
if (!clientNetVersionString.empty()) GeneralUtils::TryParse(clientNetVersionString, clientNetVersion);
|
||||
const uint32_t clientNetVersion = GeneralUtils::TryParse<uint32_t>(clientNetVersionString).value_or(171022);
|
||||
|
||||
LOG("Using net version %i", clientNetVersion);
|
||||
|
||||
|
Reference in New Issue
Block a user