Core/Network: Change SocketMgr.StartNetwork to take the thread count by arg instead of config

AuthSocketMgr doesn't need "Network.Threads" config

Fixes "Missing name Network.Threads in config file authserver.conf"

Ref #16859
This commit is contained in:
DDuarte
2016-03-28 02:02:29 +01:00
committed by Aokromes
parent 6cc4cc362d
commit 4e4cbad69f
5 changed files with 17 additions and 15 deletions

View File

@@ -221,7 +221,15 @@ extern int main(int argc, char** argv)
uint16 worldPort = uint16(sWorld->getIntConfig(CONFIG_PORT_WORLD));
std::string worldListener = sConfigMgr->GetStringDefault("BindIP", "0.0.0.0");
sWorldSocketMgr.StartNetwork(_ioService, worldListener, worldPort);
int networkThreads = sConfigMgr->GetIntDefault("Network.Threads", 1);
if (networkThreads <= 0)
{
TC_LOG_ERROR("server.worldserver", "Network.Threads cannot be less than 0");
return false;
}
sWorldSocketMgr.StartNetwork(_ioService, worldListener, worldPort, networkThreads);
// Set server online (allow connecting now)
LoginDatabase.DirectPExecute("UPDATE realmlist SET flag = flag & ~%u, population = 0 WHERE id = '%u'", REALM_FLAG_OFFLINE, realm.Id.Realm);