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

@@ -34,7 +34,7 @@ test('input clamps ranges and coerces flags', () => {
function fakeSnap() {
return {
tick: 10, ack: [4, 7], time: 1, left: 100, pitOpen: 0, pitAlarm: false, endIn: 0,
tick: 10, ack: [4, 7], away: [false, true], time: 1, left: 100, pitOpen: 0, pitAlarm: false, endIn: 0,
result: { winner: 0, reason: 'ko' },
press: { st: 'idle', y: 1 }, crane: { st: 'grab', x: 0, z: 0, who: 1 },
rockets: [{ kind: 'rocket', owner: 0, x: 1, z: 2, y: 0.5, a: 0 }],
@@ -61,6 +61,7 @@ test('toLocal for seat 1 mirrors every robot index', () => {
assert.equal(l.robots[1].grabbedBy, null);
assert.equal(l.result.winner, 1, 'seat 0 won -> for seat 1 the winner is the opponent (local 1)');
assert.equal(l.ack, 7);
assert.deepEqual(l.away, [true, false], 'own connection first');
assert.equal(l.crane.who, 0);
assert.equal(l.rockets[0].owner, 1);
assert.equal(l.mines[0].owner, 0);