mirror of https://github.com/dirtbags/moth.git
lua compat; register.cgi - add link to puzzles
This commit is contained in:
parent
2a3970d5e3
commit
42bae17f16
2
bin/once
2
bin/once
|
@ -7,8 +7,6 @@ else
|
|||
fi
|
||||
basedir=$(pwd)
|
||||
|
||||
printf "Updating moth instance in %s\n" $(pwd)
|
||||
|
||||
# Do nothing if `disabled` is present
|
||||
if [ -f disabled ]; then
|
||||
exit
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#! /usr/bin/lua5.3
|
||||
#! /usr/bin/lua5.1
|
||||
|
||||
local basedir = arg[1]
|
||||
local statedir = basedir .. "/state"
|
||||
|
@ -10,7 +10,7 @@ local nteams = 0
|
|||
local NR = 0
|
||||
|
||||
for line in io.lines(statedir .. "/points.log") do
|
||||
local ts, hash, cat, points = line:match("(%d+) (%g+) (%g+) (%d+)")
|
||||
local ts, hash, cat, points = line:match("(%d+) ([^%s]+) ([^%s]+) (%d+)")
|
||||
local teamno = teams[hash]
|
||||
|
||||
if not teamno then
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#! /usr/bin/lua5.3
|
||||
#! /usr/bin/lua5.1
|
||||
|
||||
local basedir = arg[1]
|
||||
local statedir = basedir .. "/state"
|
||||
|
@ -9,7 +9,7 @@ for cat in io.lines(statedir .. "/categories.txt") do
|
|||
end
|
||||
|
||||
for line in io.lines(statedir .. "/points.log") do
|
||||
local ts, team, cat, points = line:match("^(%d+) (%g+) (%g+) (%d+)")
|
||||
local ts, team, cat, points = line:match("^(%d+) ([^%s]+) ([^%s]+) (%d+)")
|
||||
points = tonumber(points) or 0
|
||||
|
||||
-- Skip scores for removed categories
|
||||
|
|
|
@ -30,4 +30,4 @@ end
|
|||
f:write(team)
|
||||
f:close()
|
||||
|
||||
koth.page("Success", "Okay, your team has been named and you may begin using your hash!")
|
||||
koth.page("Success", "Okay, your team has been named and you may begin using your hash! <a href='/puzzles.html'>Puzzles</a>")
|
||||
|
|
Loading…
Reference in New Issue