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

Function resolvercheck

source/src/serverbrowser.cpp:120–143  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

118}
119
120bool resolvercheck(const char **name, ENetAddress *address)
121{
122 bool resolved = false;
123 SDL_LockMutex(resolvermutex);
124 if(!resolverresults.empty())
125 {
126 resolverresult &rr = resolverresults.pop();
127 *name = rr.query;
128 address->host = rr.address.host;
129 resolved = true;
130 }
131 else loopv(resolverthreads)
132 {
133 resolverthread &rt = resolverthreads[i];
134 if(rt.query && totalmillis - rt.starttime > RESOLVERLIMIT)
135 {
136 resolverstop(rt);
137 *name = rt.query;
138 resolved = true;
139 }
140 }
141 SDL_UnlockMutex(resolvermutex);
142 return resolved;
143}
144
145extern bool isdedicated;
146

Callers 1

checkresolverFunction · 0.85

Calls 3

resolverstopFunction · 0.85
loopvFunction · 0.70
emptyMethod · 0.45

Tested by

no test coverage detected