mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-07-30 06:49:44 +00:00
used msUntil start because server has different time than client
This commit is contained in:
@@ -24,8 +24,11 @@ const gm = new GameManager(getConfig())
|
||||
|
||||
// New GET endpoint to list lobbies
|
||||
app.get('/lobbies', (req, res) => {
|
||||
const now = Date.now()
|
||||
res.json({
|
||||
lobbies: gm.gamesByPhase(GamePhase.Lobby).map(g => ({id: g.id, startTime: g.startTime(), numClients: g.numClients()})),
|
||||
lobbies: gm.gamesByPhase(GamePhase.Lobby)
|
||||
.map(g => ({id: g.id, msUntilStart: g.startTime() - now, numClients: g.numClients()}))
|
||||
// .sort((a, b) => a.startTime - b.startTime),
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user