mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-07-02 03:28:27 +00:00
Can select map on private lobbies
This commit is contained in:
@@ -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) => {
|
||||
|
||||
Reference in New Issue
Block a user