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

Function addpckserver

source/src/autodownload.cpp:38–51  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

36COMMAND(resetpckservers, "");
37
38void addpckserver(char *host, char *priority) // add/adjust a package server
39{
40 sem_pckservers.wait();
41 if(*host)
42 {
43 pckserver *s = NULL;
44 loopv(pckservers) if(!strcmp(host, pckservers[i]->host)) s = pckservers[i];
45 DEBUG((s ? "updated" : "new") << " host " << host << ", priority " << priority);
46 if(!s) s = pckservers.add(new pckserver);
47 copystring(s->host, host);
48 if(*priority) s->priority = atoi(priority);
49 }
50 sem_pckservers.post();
51}
52COMMAND(addpckserver, "ss");
53
54void getpckserver() // return a table of all package servers with four columns

Callers

nothing calls this directly

Calls 5

copystringFunction · 0.85
waitMethod · 0.80
postMethod · 0.80
loopvFunction · 0.70
addMethod · 0.45

Tested by

no test coverage detected