-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Further remove selects from elo_updates; Remove dbreinit on every are…
…na start
- Loading branch information
1 parent
03422fe
commit c0be661
Showing
5 changed files
with
148 additions
and
139 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,14 @@ | ||
|
||
High: | ||
- Login system - send a special link to the email | ||
- Cmndr: Finish the "your bots" page - add button to decommision bot | ||
- Optimize the query in backend/arena.ts: pickBotByNumberOfGamesPlayed. | ||
It counts the number of games played by each bot, and then picks a bot. | ||
Takes 200ms, should be more like 2ms. | ||
|
||
Mid: | ||
- Add "fen" string view on the game page | ||
- Add timer to live games. | ||
- Add token count to each bot in the db | ||
- Add animation when live games "die" | ||
- Optimzie the renderer in the live games page | ||
|
||
Low: | ||
[4] - Some kind of captcha for uploading new bots | ||
- Make the timer update if you leave the page open overnight. | ||
- Add "fork me on github" ribbon | ||
- Maybe optimize with websockets? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,7 @@ | ||
import { tmpdir } from "node:os"; | ||
import { randomBytes } from "node:crypto"; | ||
import sql from "./db"; | ||
|
||
export function makeTmpDir() { | ||
const rnd = randomBytes(16).toString('base64url'); | ||
return `${tmpdir()}/chess-${rnd}`; | ||
} | ||
|
||
export async function getElo(botId: number): Promise<number> { | ||
const res = await sql`SELECT SUM(change)::float FROM elo_updates WHERE bot_id = ${botId}`; | ||
return res[0].sum; | ||
} |