mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-09 09:38:19 +00:00
Compare commits
4 commits
9f278979e5
...
d5e81ca78d
Author | SHA1 | Date | |
---|---|---|---|
d5e81ca78d | |||
128ffd2313 | |||
af1b32d296 | |||
0ad1c08c22 |
|
@ -2929,6 +2929,24 @@ void CClient::Run()
|
|||
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
|
||||
m_pGraphics = CreateEngineGraphicsThreaded();
|
||||
Kernel()->RegisterInterface(m_pGraphics); // IEngineGraphics
|
||||
|
@ -2952,24 +2970,6 @@ void CClient::Run()
|
|||
CVideo::Init();
|
||||
#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
|
||||
m_pTextRender = Kernel()->RequestInterface<IEngineTextRender>();
|
||||
m_pTextRender->Init();
|
||||
|
|
|
@ -70,18 +70,18 @@ void CEcon::Init(CConfig *pConfig, IConsole *pConsole, CNetBan *pNetBan)
|
|||
}
|
||||
|
||||
NETADDR BindAddr;
|
||||
if(g_Config.m_EcBindaddr[0] == '\0')
|
||||
if(g_Config.m_EcBindaddr[0] && net_host_lookup(g_Config.m_EcBindaddr, &BindAddr, NETTYPE_ALL) == 0)
|
||||
{
|
||||
mem_zero(&BindAddr, sizeof(BindAddr));
|
||||
// got bindaddr
|
||||
BindAddr.port = g_Config.m_EcPort;
|
||||
}
|
||||
else if(net_host_lookup(g_Config.m_EcBindaddr, &BindAddr, NETTYPE_ALL) != 0)
|
||||
else
|
||||
{
|
||||
char aBuf[256];
|
||||
str_format(aBuf, sizeof(aBuf), "The configured bindaddr '%s' cannot be resolved.", g_Config.m_Bindaddr);
|
||||
str_format(aBuf, sizeof(aBuf), "The configured bindaddr '%s' cannot be resolved.", g_Config.m_EcBindaddr);
|
||||
Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "econ", aBuf);
|
||||
return;
|
||||
}
|
||||
BindAddr.type = NETTYPE_ALL;
|
||||
BindAddr.port = g_Config.m_EcPort;
|
||||
|
||||
if(m_NetConsole.Open(BindAddr, pNetBan))
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue