MCPcopy Create free account
hub / github.com/assaultcube/AC / checkresolver

Function checkresolver

source/src/serverbrowser.cpp:410–441  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

408}
409
410void checkresolver()
411{
412 int resolving = 0;
413 loopv(servers)
414 {
415 serverinfo &si = *servers[i];
416 if(si.resolved == serverinfo::RESOLVED) continue;
417 if(si.address.host == ENET_HOST_ANY)
418 {
419 if(si.resolved == serverinfo::UNRESOLVED) { si.resolved = serverinfo::RESOLVING; resolverquery(si.name); }
420 resolving++;
421 }
422 }
423 if(!resolving) return;
424
425 const char *name = NULL;
426 ENetAddress addr = { ENET_HOST_ANY, ENET_PORT_ANY };
427 while(resolvercheck(&name, &addr))
428 {
429 loopv(servers)
430 {
431 serverinfo &si = *servers[i];
432 if(name == si.name)
433 {
434 si.resolved = serverinfo::RESOLVED;
435 si.address.host = addr.host;
436 addr.host = ENET_HOST_ANY;
437 break;
438 }
439 }
440 }
441}
442
443#define MAXINFOLINELEN 100 // including color codes
444

Callers 1

refreshserversFunction · 0.85

Calls 1

resolvercheckFunction · 0.85

Tested by

no test coverage detected