remove bad example image, sort examples to back, fix started fix
This commit is contained in:
parent
11907c1452
commit
800ca0cc54
3 changed files with 5 additions and 5 deletions
Binary file not shown.
|
Before Width: | Height: | Size: 603 KiB |
|
|
@ -25,7 +25,7 @@ function loadAllGames() {
|
||||||
const contents = fs.readFileSync(file, 'utf-8')
|
const contents = fs.readFileSync(file, 'utf-8')
|
||||||
const game = JSON.parse(contents)
|
const game = JSON.parse(contents)
|
||||||
if (typeof game.puzzle.data.started === 'undefined') {
|
if (typeof game.puzzle.data.started === 'undefined') {
|
||||||
game.puzzle.data.started = Math.round(fs.statSync(file).atimeMs)
|
game.puzzle.data.started = Math.round(fs.statSync(file).ctimeMs)
|
||||||
}
|
}
|
||||||
if (typeof game.puzzle.data.finished === 'undefined') {
|
if (typeof game.puzzle.data.finished === 'undefined') {
|
||||||
let unfinished = game.puzzle.tiles.map(Util.decodeTile).find(t => t.owner !== -1)
|
let unfinished = game.puzzle.tiles.map(Util.decodeTile).find(t => t.owner !== -1)
|
||||||
|
|
|
||||||
|
|
@ -11,14 +11,14 @@ import twing from 'twing'
|
||||||
import bodyParser from 'body-parser'
|
import bodyParser from 'body-parser'
|
||||||
|
|
||||||
const allImages = () => [
|
const allImages = () => [
|
||||||
...fs.readdirSync('./../game/example-images/').map(f => ({
|
|
||||||
file: `./../game/example-images/${f}`,
|
|
||||||
url: `/example-images/${f}`,
|
|
||||||
})),
|
|
||||||
...fs.readdirSync('./../data/uploads/').map(f => ({
|
...fs.readdirSync('./../data/uploads/').map(f => ({
|
||||||
file: `./../data/uploads/${f}`,
|
file: `./../data/uploads/${f}`,
|
||||||
url: `/uploads/${f}`,
|
url: `/uploads/${f}`,
|
||||||
})),
|
})),
|
||||||
|
...fs.readdirSync('./../game/example-images/').map(f => ({
|
||||||
|
file: `./../game/example-images/${f}`,
|
||||||
|
url: `/example-images/${f}`,
|
||||||
|
})),
|
||||||
]
|
]
|
||||||
|
|
||||||
const port = config.http.port
|
const port = config.http.port
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue