Fixes room list, adds OpenGraph so link previews look good

This commit is contained in:
Cam Spry 2026-03-02 01:30:02 -05:00
parent 8b9a434be3
commit c87654ed7c
2 changed files with 10 additions and 0 deletions

View File

@ -3,6 +3,8 @@
<head>
<meta charset="UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<meta property="og:title" content="Y.A.R.N HTML5" />
<meta property="og:description" content="A collaborative story-writing game. Remake of the 2000s GameSpy Arcade classic." />
<title>Y.A.R.N. 2026</title>
<!-- re-use the same CSS-variables and base look -->

View File

@ -352,6 +352,14 @@ app.get('/', (req, res) => {
res.sendFile(path.join(__dirname, 'public', 'menu.html'));
});
app.get('/api/rooms', (req, res) => {
const roomList = Object.keys(games).map(name => ({
name,
playerCount: games[name].players.length
}));
res.json({ rooms: roomList });
});
// Socket.IO connection handling
io.on('connection', (socket) => {
let currentRoom = null;