add leaderboard announcement
This commit is contained in:
parent
0a9fd2faf9
commit
d810d66f50
3 changed files with 75 additions and 18 deletions
3
index.js
3
index.js
|
@ -19,7 +19,8 @@ app.use('/js', express.static('./common'));
|
|||
app.use(express.static('./static'));
|
||||
|
||||
app.get('/leaderboard', async function (ws, req) {
|
||||
req.send(JSON.stringify(await db.all('SELECT * FROM stats ORDER BY ko DESC LIMIT 100')));
|
||||
let scores = game.scores || [];
|
||||
req.send(scores.map((x,i) => `#${i+1}: ${x[0]} [${x[1]}]`).join('\n'));
|
||||
})
|
||||
|
||||
app.ws('/', function (ws, req) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue