[Download]: Add flag to disable web server
This commit is contained in:
parent
77e8e1f8d5
commit
c779ae605d
@ -654,29 +654,32 @@ namespace Components
|
|||||||
|
|
||||||
if (Dedicated::IsEnabled())
|
if (Dedicated::IsEnabled())
|
||||||
{
|
{
|
||||||
mg_mgr_init(&Mgr);
|
if (!Flags::HasFlag("disable-mongoose"))
|
||||||
|
|
||||||
Network::OnStart([]
|
|
||||||
{
|
{
|
||||||
const auto* nc = mg_http_listen(&Mgr, Utils::String::VA(":%hu", Network::GetPort()), &EventHandler, &Mgr);
|
mg_mgr_init(&Mgr);
|
||||||
if (!nc)
|
|
||||||
{
|
|
||||||
Logger::PrintError(Game::CON_CHANNEL_ERROR, "Failed to bind TCP socket, mod download won't work!\n");
|
|
||||||
Terminate = true;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
ServerRunning = true;
|
Network::OnStart([]
|
||||||
Terminate = false;
|
|
||||||
ServerThread = Utils::Thread::CreateNamedThread("Mongoose", []
|
|
||||||
{
|
|
||||||
Com_InitThreadData();
|
|
||||||
|
|
||||||
while (!Terminate)
|
|
||||||
{
|
{
|
||||||
mg_mgr_poll(&Mgr, 1000);
|
const auto* nc = mg_http_listen(&Mgr, Utils::String::VA(":%hu", Network::GetPort()), &EventHandler, &Mgr);
|
||||||
}
|
if (!nc)
|
||||||
});
|
{
|
||||||
|
Logger::PrintError(Game::CON_CHANNEL_ERROR, "Failed to bind TCP socket, mod download won't work!\n");
|
||||||
|
Terminate = true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
ServerRunning = true;
|
||||||
|
Terminate = false;
|
||||||
|
ServerThread = Utils::Thread::CreateNamedThread("Mongoose", []
|
||||||
|
{
|
||||||
|
Com_InitThreadData();
|
||||||
|
|
||||||
|
while (!Terminate)
|
||||||
|
{
|
||||||
|
mg_mgr_poll(&Mgr, 1000);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user