Merge pull request #8932 from Robyt3/Client-Network-Before-Graphics

Initialize client networking before graphics
This commit is contained in:
Jupeyy 2024-09-11 18:07:20 +00:00 committed by GitHub
commit d5e81ca78d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -2929,6 +2929,24 @@ void CClient::Run()
g_UuidManager.DebugDump(); g_UuidManager.DebugDump();
} }
#ifndef CONF_WEBASM
char aNetworkError[256];
if(!InitNetworkClient(aNetworkError, sizeof(aNetworkError)))
{
log_error("client", "%s", aNetworkError);
ShowMessageBox("Network Error", aNetworkError);
return;
}
#endif
if(!m_Http.Init(std::chrono::seconds{1}))
{
const char *pErrorMessage = "Failed to initialize the HTTP client.";
log_error("client", "%s", pErrorMessage);
ShowMessageBox("HTTP Error", pErrorMessage);
return;
}
// init graphics // init graphics
m_pGraphics = CreateEngineGraphicsThreaded(); m_pGraphics = CreateEngineGraphicsThreaded();
Kernel()->RegisterInterface(m_pGraphics); // IEngineGraphics Kernel()->RegisterInterface(m_pGraphics); // IEngineGraphics
@ -2952,24 +2970,6 @@ void CClient::Run()
CVideo::Init(); CVideo::Init();
#endif #endif
#ifndef CONF_WEBASM
char aNetworkError[256];
if(!InitNetworkClient(aNetworkError, sizeof(aNetworkError)))
{
log_error("client", "%s", aNetworkError);
ShowMessageBox("Network Error", aNetworkError);
return;
}
#endif
if(!m_Http.Init(std::chrono::seconds{1}))
{
const char *pErrorMessage = "Failed to initialize the HTTP client.";
log_error("client", "%s", pErrorMessage);
ShowMessageBox("HTTP Error", pErrorMessage);
return;
}
// init text render // init text render
m_pTextRender = Kernel()->RequestInterface<IEngineTextRender>(); m_pTextRender = Kernel()->RequestInterface<IEngineTextRender>();
m_pTextRender->Init(); m_pTextRender->Init();