Can select map on private lobbies

This commit is contained in:
evanpelle
2024-10-16 20:34:57 -07:00
parent d92dc9eba6
commit 206f6d3333
6 changed files with 55 additions and 14 deletions
+3 -3
View File
@@ -23,8 +23,6 @@ app.use(express.static(path.join(__dirname, '../../out')));
app.use(express.json())
const gm = new GameManager(getConfig())
const privateGames = new Map<string, GameServer>()
// New GET endpoint to list lobbies
app.get('/lobbies', (req, res) => {
const now = Date.now()
@@ -35,6 +33,7 @@ app.get('/lobbies', (req, res) => {
});
});
app.post('/private_lobby', (req, res) => {
const id = gm.createPrivateGame()
console.log('creating private lobby with id ${id}')
@@ -48,8 +47,9 @@ app.post('/start_private_lobby/:id', (req, res) => {
gm.startPrivateGame(req.params.id)
});
app.put('/private_lobby/:id', (req, res) => {
const lobbyID = req.params.id
gm.updateGameConfig(lobbyID, {gameMap: req.body.gameMap})
});
app.get('/lobby/:id/exists', (req, res) => {