mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
Fix crash in serverbrowser initialization
Another missing commit. Fixes #3875. CC #3772 #3855
This commit is contained in:
parent
67bb0c3c07
commit
26a577b891
|
@ -3103,6 +3103,7 @@ void CClient::Run()
|
|||
}
|
||||
|
||||
GameClient()->OnInit();
|
||||
m_ServerBrowser.OnInit();
|
||||
|
||||
char aBuf[256];
|
||||
str_format(aBuf, sizeof(aBuf), "version %s", GameClient()->NetVersion());
|
||||
|
|
|
@ -106,6 +106,11 @@ void CServerBrowser::SetBaseInfo(class CNetClient *pClient, const char *pNetVers
|
|||
RegisterCommands();
|
||||
}
|
||||
|
||||
void CServerBrowser::OnInit()
|
||||
{
|
||||
m_pHttp = CreateServerBrowserHttp(m_pEngine, m_pConsole, m_pStorage, g_Config.m_BrCachedBestServerinfoUrl);
|
||||
}
|
||||
|
||||
void CServerBrowser::RegisterCommands()
|
||||
{
|
||||
m_pConsole->Register("leak_ip_address_to_all_servers", "", CFGFLAG_CLIENT, Con_LeakIpAddress, this, "Leaks your IP address to all servers by pinging each of them, also acquiring the latency in the process");
|
||||
|
@ -1145,11 +1150,6 @@ void CServerBrowser::Update(bool ForceResort)
|
|||
int64 Timeout = time_freq();
|
||||
int64 Now = time_get();
|
||||
|
||||
if(!m_pHttp)
|
||||
{
|
||||
m_pHttp = CreateServerBrowserHttp(m_pEngine, m_pConsole, m_pStorage, g_Config.m_BrCachedBestServerinfoUrl);
|
||||
}
|
||||
|
||||
const char *pHttpBestUrl;
|
||||
if(!m_pHttp->GetBestUrl(&pHttpBestUrl) && pHttpBestUrl != m_pHttpPrevBestUrl)
|
||||
{
|
||||
|
|
|
@ -136,6 +136,7 @@ public:
|
|||
void SetCurrentServerPing(const NETADDR &Addr, int Ping);
|
||||
|
||||
void SetBaseInfo(class CNetClient *pClient, const char *pNetVersion);
|
||||
void OnInit();
|
||||
|
||||
void RequestImpl64(const NETADDR &Addr, CServerEntry *pEntry) const;
|
||||
void QueueRequest(CServerEntry *pEntry);
|
||||
|
|
Loading…
Reference in a new issue