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

Method GetPing

src/engine/client/serverbrowser_ping_cache.cpp:148–167  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

146}
147
148int CServerBrowserPingCache::GetPing(const NETADDR *pAddrs, int NumAddrs) const
149{
150 int Ping = -1;
151 for(int i = 0; i < NumAddrs; i++)
152 {
153 NETADDR LookupAddr = pAddrs[i];
154 LookupAddr.type &= ~NETTYPE_TW7;
155 LookupAddr.port = 0;
156 auto Entry = m_Entries.find(LookupAddr);
157 if(Entry == m_Entries.end())
158 {
159 continue;
160 }
161 if(Ping == -1 || Entry->second < Ping)
162 {
163 Ping = Entry->second;
164 }
165 }
166 return Ping;
167}
168
169IServerBrowserPingCache *CreateServerBrowserPingCache(IConsole *pConsole, IStorage *pStorage)
170{

Callers 3

SetLatencyMethod · 0.80
UpdateFromHttpMethod · 0.80
TESTFunction · 0.80

Calls 1

endMethod · 0.80

Tested by 1

TESTFunction · 0.64