mirror of https://github.com/dirtbags/moth.git
Merge branch 'master' of woozle.org:/home/neale/projects/ctf/base
This commit is contained in:
commit
7aa076d950
11
bin/points
11
bin/points
|
@ -17,14 +17,14 @@ BEGIN {
|
||||||
teamno = ++nteams;
|
teamno = ++nteams;
|
||||||
teams[hash] = teamno;
|
teams[hash] = teamno;
|
||||||
|
|
||||||
getline teamnames[teamno] < ("state/teams/" hash)
|
getline teamnames[hash] < ("state/teams/" hash)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (NR > 1) {
|
if (NR > 1) {
|
||||||
# JSON sucks.
|
# JSON sucks.
|
||||||
print ",";
|
print ",";
|
||||||
}
|
}
|
||||||
printf("[%d, \"%d\", \"%s\", %d]", ts, teamno, cat, points);
|
printf("[%d, \"%s\", \"%s\", %d]", ts, hash, cat, points);
|
||||||
}
|
}
|
||||||
|
|
||||||
END {
|
END {
|
||||||
|
@ -32,11 +32,12 @@ END {
|
||||||
print " ],";
|
print " ],";
|
||||||
print " \"teams\": {";
|
print " \"teams\": {";
|
||||||
|
|
||||||
for (i = 1; i <= nteams; i += 1) {
|
i = 0
|
||||||
if (i > 1) {
|
for (hash in teamnames) {
|
||||||
|
if (i++) {
|
||||||
print ",";
|
print ",";
|
||||||
}
|
}
|
||||||
printf("\"%d\": \"%s\"", i, teamnames[i]);
|
printf("\"%s\": \"%s\"", hash, teamnames[hash]);
|
||||||
}
|
}
|
||||||
|
|
||||||
print "";
|
print "";
|
||||||
|
|
Loading…
Reference in New Issue