Merge branch 'master' into Playerbot

This commit is contained in:
Yunfan Li
2024-05-07 22:22:40 +08:00
8 changed files with 248 additions and 13 deletions

View File

@@ -114,5 +114,13 @@ void WorldSocketMgr::OnSocketOpen(tcp::socket&& sock, uint32 threadIndex)
NetworkThread<WorldSocket>* WorldSocketMgr::CreateThreads() const
{
return new WorldSocketThread[GetNetworkThreadCount()];
NetworkThread<WorldSocket>* threads = new WorldSocketThread[GetNetworkThreadCount()];
bool proxyProtocolEnabled = sConfigMgr->GetOption<bool>("Network.EnableProxyProtocol", false, true);
if (proxyProtocolEnabled)
for (int i = 0; i < GetNetworkThreadCount(); i++)
threads[i].EnableProxyProtocol();
return threads;
}