diff --git a/TODO.txt b/TODO.txt index 237207082..988623570 100644 --- a/TODO.txt +++ b/TODO.txt @@ -187,9 +187,11 @@ * REFACTOR: move canbuild to player DONE 11/17/2024 * BUG: can build destroyer on land DONE 11/17/2024 * fix pathfinding bug DONE 11/20/2024 -* make two nukes: atom & hydrogen DONE 11/202/2024 -* NPC builds ports +* make two nukes: atom & hydrogen DONE 11/20/2024 +* NPC builds ports DONE 11/20/2024 +* BUG: fix matchmaking * destroyer can capture trade ships +* make NPC difficult scale better (not just start troops) * add battleship * add defense post * add radiation from nuke diff --git a/src/client/index.html b/src/client/index.html index 6308f2e05..94f83e584 100644 --- a/src/client/index.html +++ b/src/client/index.html @@ -28,7 +28,7 @@

OpenFront.io

-

(v0.8.0)

+

(v0.8.1)

diff --git a/src/server/Server.ts b/src/server/Server.ts index 06374fffd..42e72d7e1 100644 --- a/src/server/Server.ts +++ b/src/server/Server.ts @@ -1,22 +1,22 @@ -import express, {json} from 'express'; +import express, { json } from 'express'; import http from 'http'; -import {WebSocketServer} from 'ws'; +import { WebSocketServer } from 'ws'; import path from 'path'; -import {fileURLToPath} from 'url'; -import {GameManager} from './GameManager'; -import {ClientMessage, ClientMessageSchema} from '../core/Schemas'; -import {getConfig} from '../core/configuration/Config'; -import {LogSeverity, slog} from './StructuredLog'; -import {Client} from './Client'; -import {GamePhase, GameServer} from './GameServer'; -import {v4 as uuidv4} from 'uuid'; +import { fileURLToPath } from 'url'; +import { GameManager } from './GameManager'; +import { ClientMessage, ClientMessageSchema } from '../core/Schemas'; +import { getConfig } from '../core/configuration/Config'; +import { LogSeverity, slog } from './StructuredLog'; +import { Client } from './Client'; +import { GamePhase, GameServer } from './GameServer'; +import { v4 as uuidv4 } from 'uuid'; const __filename = fileURLToPath(import.meta.url); const __dirname = path.dirname(__filename); const app = express(); const server = http.createServer(app); -const wss = new WebSocketServer({server}); +const wss = new WebSocketServer({ server }); // Serve static files from the 'out' directory app.use(express.static(path.join(__dirname, '../../out'))); @@ -28,12 +28,12 @@ app.get('/lobbies', (req, res) => { const now = Date.now() res.json({ lobbies: gm.gamesByPhase(GamePhase.Lobby) - .map(g => ({id: g.id, msUntilStart: g.startTime() - now, numClients: g.numClients()})) - // .sort((a, b) => a.startTime - b.startTime), + .filter(g => g.isPublic) + .map(g => ({ id: g.id, msUntilStart: g.startTime() - now, numClients: g.numClients() })) + .sort((a, b) => a.msUntilStart - b.msUntilStart), }); }); - app.post('/private_lobby', (req, res) => { const id = gm.createPrivateGame() console.log('creating private lobby with id ${id}') @@ -49,7 +49,7 @@ app.post('/start_private_lobby/:id', (req, res) => { app.put('/private_lobby/:id', (req, res) => { const lobbyID = req.params.id - gm.updateGameConfig(lobbyID, {gameMap: req.body.gameMap, difficulty: req.body.difficulty}) + gm.updateGameConfig(lobbyID, { gameMap: req.body.gameMap, difficulty: req.body.difficulty }) }); app.get('/lobby/:id/exists', (req, res) => {