feat(server): achievements pay out server-side, snapshots carry opponent connection state
This commit is contained in:
@@ -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');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user