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

Function writeservercfg

source/src/serverbrowser.cpp:1428–1440  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1426COMMAND(updatefrommaster, "i");
1427
1428void writeservercfg()
1429{
1430 stream *f = openfile(path("config/servers.cfg", true), "w");
1431 if(!f) return;
1432 f->printf("// servers connected to are added here automatically\n");
1433 loopvrev(servers)
1434 {
1435 f->printf("\naddserver %s %d", servers[i]->name, servers[i]->port);
1436 if(servers[i]->msweight) f->printf(" %d", servers[i]->msweight);
1437 }
1438 f->printf("\n");
1439 delete f;
1440}

Callers 1

quitFunction · 0.85

Calls 3

openfileFunction · 0.85
pathFunction · 0.85
printfMethod · 0.45

Tested by

no test coverage detected