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