MCPcopy Create free account
hub / github.com/ddnet/ddnet / RequestDDNetInfo

Method RequestDDNetInfo

src/engine/client/client.cpp:5074–5097  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5072}
5073
5074void CClient::RequestDDNetInfo()
5075{
5076 if(m_pDDNetInfoTask && !m_pDDNetInfoTask->Done())
5077 return;
5078
5079 char aUrl[256];
5080 str_copy(aUrl, DDNET_INFO_URL);
5081
5082 if(g_Config.m_BrIndicateFinished)
5083 {
5084 char aEscaped[128];
5085 EscapeUrl(aEscaped, sizeof(aEscaped), PlayerName());
5086 str_append(aUrl, "?name=");
5087 str_append(aUrl, aEscaped);
5088 }
5089
5090 m_pDDNetInfoTask = HttpGetFile(aUrl, Storage(), DDNET_INFO_FILE, IStorage::TYPE_SAVE);
5091 m_pDDNetInfoTask->Timeout(CTimeout{10000, 0, 500, 10});
5092 m_pDDNetInfoTask->SkipByFileTime(false); // Always re-download.
5093 // Use ipv4 so we can know the ingame ip addresses of players before they join game servers
5094 m_pDDNetInfoTask->IpResolve(IPRESOLVE::V4);
5095 Http()->Run(m_pDDNetInfoTask);
5096 m_InfoState = EInfoState::LOADING;
5097}
5098
5099int CClient::GetPredictionTime()
5100{

Callers 3

RenderPopupFullscreenMethod · 0.80
RefreshBrowserTabMethod · 0.80
RenderSettingsDDNetMethod · 0.80

Calls 10

HttpGetFileFunction · 0.85
StorageFunction · 0.85
TimeoutMethod · 0.80
SkipByFileTimeMethod · 0.80
IpResolveMethod · 0.80
str_copyFunction · 0.50
EscapeUrlFunction · 0.50
str_appendFunction · 0.50
DoneMethod · 0.45
RunMethod · 0.45

Tested by

no test coverage detected