Release v0.1.19 2026-07-19
This commit is contained in:
@@ -7,6 +7,7 @@ const SESSION_LIFETIME_MS = 30 * 24 * 60 * 60 * 1000;
|
||||
const MAX_JSON_BYTES = 1024 * 1024;
|
||||
const AUTH_WINDOW_MS = 15 * 60 * 1000;
|
||||
const AUTH_ATTEMPTS_PER_WINDOW = 20;
|
||||
const HOCKEY_PVP_COUNTDOWN_MS = 5_000;
|
||||
const authAttempts = new Map();
|
||||
|
||||
function apiError(message, status = 400) {
|
||||
@@ -650,6 +651,7 @@ export function createGameApiHandler(options = {}) {
|
||||
match: {
|
||||
id: match.id,
|
||||
seed: match.seed,
|
||||
countdownEndsAtMs: match.countdownEndsAtMs,
|
||||
opponentName: opponent.hunterName,
|
||||
role: ticket.side,
|
||||
},
|
||||
@@ -693,6 +695,7 @@ export function createGameApiHandler(options = {}) {
|
||||
id: matchId,
|
||||
seed: randomBytes(4).readUInt32BE(0) || 1,
|
||||
createdAt: now,
|
||||
countdownEndsAtMs: now + HOCKEY_PVP_COUNTDOWN_MS,
|
||||
players: { host: opponent, guest: ticket },
|
||||
snapshots: { host: null, guest: null },
|
||||
};
|
||||
|
||||
@@ -228,6 +228,7 @@ test("Healing Hockey PVP queue pairs players and relays match snapshots", async
|
||||
assert.equal(betaQueue.body.status, "matched");
|
||||
assert.equal(betaQueue.body.match.role, "guest");
|
||||
assert.equal(betaQueue.body.match.opponentName, "Alpha");
|
||||
assert.ok(betaQueue.body.match.countdownEndsAtMs > Date.now());
|
||||
|
||||
const alphaMatched = await json(`/api/hockey-pvp/queue/${alphaQueue.body.ticketId}`, {
|
||||
headers: { Authorization: `Bearer ${alphaToken}` },
|
||||
@@ -236,6 +237,7 @@ test("Healing Hockey PVP queue pairs players and relays match snapshots", async
|
||||
assert.equal(alphaMatched.body.match.role, "host");
|
||||
assert.equal(alphaMatched.body.match.id, betaQueue.body.match.id);
|
||||
assert.equal(alphaMatched.body.match.seed, betaQueue.body.match.seed);
|
||||
assert.equal(alphaMatched.body.match.countdownEndsAtMs, betaQueue.body.match.countdownEndsAtMs);
|
||||
|
||||
const hostSnapshot = { sequence: 1, party: [], puck: { goalSequence: 0 } };
|
||||
await json(`/api/hockey-pvp/matches/${alphaMatched.body.match.id}/state`, {
|
||||
|
||||
Reference in New Issue
Block a user