1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-01-12 02:28:11 +02:00

Merge pull request #1093 from Nordsoft91/port-override

Write port override
This commit is contained in:
Andrii Danylchenko 2022-10-31 07:21:01 +02:00 committed by GitHub
commit 80ce205d94
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -278,10 +278,16 @@ void CServerHandler::justConnectToServer(const std::string & addr, const ui16 po
c->handler = std::make_shared<boost::thread>(&CServerHandler::threadHandleConnection, this);
if(addr.empty() || addr == localhostAddress)
return;
Settings serverAddress = settings.write["server"]["server"];
serverAddress->String() = addr;
if(!addr.empty() && addr != localhostAddress)
{
Settings serverAddress = settings.write["server"]["server"];
serverAddress->String() = addr;
}
if(port && port != getDefaultPort())
{
Settings serverPort = settings.write["server"]["port"];
serverPort->Integer() = port;
}
}
void CServerHandler::applyPacksOnLobbyScreen()