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

Method load

source/src/serverfiles.h:1811–1831  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1809struct serverparameter : serverconfigfile
1810{
1811 bool load()
1812 {
1813 if(serverconfigfile::load())
1814 {
1815 int line = 0;
1816 char *b, *l, *p = buf, *kb, *k, *v;
1817 servpar *id;
1818 while(p < buf + filelen)
1819 {
1820 l = p; p += strlen(p) + 1; line++;
1821 l = strtok_r(l, " ", &b);
1822 if(l && (k = strtok_r(l, ":", &kb)) && (v = strtok_r(NULL, ":", &kb)) && (id = servpars->access(k)) && id->fromfile)
1823 {
1824 if(id->type == SID_STR && (v - k) - strlen(k) > 1) filterrichtext(v, v);
1825 id->nextvalue(v);
1826 }
1827 }
1828 return true;
1829 }
1830 return false;
1831 }
1832
1833 void read()
1834 { // in mainloop: update values from shadow values

Callers

nothing calls this directly

Calls 4

strtok_rFunction · 0.85
filterrichtextFunction · 0.85
accessMethod · 0.80
nextvalueMethod · 0.80

Tested by

no test coverage detected