feat(server): achievements pay out server-side, snapshots carry opponent connection state

This commit is contained in:
Benjamin Oezcan
2026-11-19 02:09:12 +01:00
parent 85a19ba242
commit 0202a08b8d
5 changed files with 13 additions and 4 deletions

View File

@@ -86,6 +86,9 @@ test('full live match over WebSocket: both get start, snapshots, and mirrored re
if (ea.result.winner === -1) assert.ok(la === -1 && lb === -1);
else assert.ok((la === 0) !== (lb === 0), 'exactly one player won');
assert.equal(ea.save.games, 1);
assert.ok(Array.isArray(ea.reward.ach), 'achievements decided on the server');
const winner = la === 0 ? ea : lb === 0 ? eb : null;
if (winner) assert.ok(winner.reward.ach.some(x => x.id === 'first_win'), 'first win pays out');
assert.equal(eb.save.games, 1);
assert.ok(ca.inbox.some(m => m.t === 'snap'), 'snapshots arrived before the end');