Serve game modes from extracted mission data

Publish stable mode IDs and matching responses in the stock format.
Build the mission pools from the multiplayer mission data and provide
required fields and localized names. Load datasets before listening and
reuse cached results when the source file digests match.

Preserve invalid UTF-8 bytes when round-tripping BLK strings and names.
The game mode list appeared in the offline client.
This commit is contained in:
N0VAN0M4LY committed 2026-11-24 11:02:30 +08:00
1 parent 6ed498e4d0
commit 40af06edad
26 files changed
+943 -28

No files matched your search

@@ -6,6 +6,7 @@
* to the HTTP server.
*/
import { createServer, type Server, type Socket } from 'node:net';
import type { MatchingRequestTable } from '../matching/matching-requests.ts';
import { MatchingService } from '../matching/matching-service.ts';
import { startsMatchingPacket } from '../matching/matching-frame.ts';
import type { TrafficLog } from '../traffic-log/traffic-log.ts';
@@ -18,12 +19,12 @@ export interface PortListener {
destroyConnections(): void;
}
export function createPortListener(router: Router, log: TrafficLog): PortListener {
export function createPortListener(router: Router, matchingRequests: MatchingRequestTable, log: TrafficLog): PortListener {
const numbers = new WeakMap<Socket, number>();
const open = new Set<Socket>();
let lastNumber = 0;
const http = createHttpServer(router, log, (socket) => numbers.get(socket) ?? 0);
const matching = new MatchingService(log);
const matching = new MatchingService(matchingRequests, log);
const server = createServer((socket) => {
lastNumber += 1;