mirror of
https://github.com/jwetzell/aas-js.git
synced 2026-09-07 13:19:02 +00:00
add horn flag to all sports
This commit is contained in:
@@ -165,6 +165,9 @@ class Console {
|
|||||||
this.state.time.showTenths = bufferHex.at(8) === '1';
|
this.state.time.showTenths = bufferHex.at(8) === '1';
|
||||||
this.state.time.display = `${this.state.time.minutes}:${this.state.time.seconds}`;
|
this.state.time.display = `${this.state.time.minutes}:${this.state.time.seconds}`;
|
||||||
|
|
||||||
|
const hornBinaryFlags = buffer.at(4).toString(2).padStart(8, '0');
|
||||||
|
this.state.horn = hornBinaryFlags[0] === '1';
|
||||||
|
|
||||||
const seqNum = bufferHex.substring(20, 22);
|
const seqNum = bufferHex.substring(20, 22);
|
||||||
if (seqNum === '11') {
|
if (seqNum === '11') {
|
||||||
const homeBinaryInfo = buffer.at(12).toString(2).padStart(8, '0');
|
const homeBinaryInfo = buffer.at(12).toString(2).padStart(8, '0');
|
||||||
@@ -245,6 +248,9 @@ class Console {
|
|||||||
|
|
||||||
this.state.playClock.seconds = bufferHex.substring(16, 18);
|
this.state.playClock.seconds = bufferHex.substring(16, 18);
|
||||||
|
|
||||||
|
const hornBinaryFlags = buffer.at(4).toString(2).padStart(8, '0');
|
||||||
|
this.state.horn = hornBinaryFlags[0] === '1';
|
||||||
|
|
||||||
const seqNum = bufferHex.substring(20, 22);
|
const seqNum = bufferHex.substring(20, 22);
|
||||||
if (seqNum === '11') {
|
if (seqNum === '11') {
|
||||||
const homeBinaryInfo = buffer.at(12).toString(2).padStart(8, '0');
|
const homeBinaryInfo = buffer.at(12).toString(2).padStart(8, '0');
|
||||||
@@ -294,6 +300,9 @@ class Console {
|
|||||||
this.state.time.showTenths = bufferHex.at(8) === '1';
|
this.state.time.showTenths = bufferHex.at(8) === '1';
|
||||||
this.state.time.display = `${this.state.time.minutes}:${this.state.time.seconds}`;
|
this.state.time.display = `${this.state.time.minutes}:${this.state.time.seconds}`;
|
||||||
|
|
||||||
|
const hornBinaryFlags = buffer.at(4).toString(2).padStart(8, '0');
|
||||||
|
this.state.horn = hornBinaryFlags[0] === '1';
|
||||||
|
|
||||||
const seqNum = bufferHex.substring(20, 22);
|
const seqNum = bufferHex.substring(20, 22);
|
||||||
if (seqNum === '11') {
|
if (seqNum === '11') {
|
||||||
const homeBinaryInfo = buffer.at(12).toString(2).padStart(8, '0');
|
const homeBinaryInfo = buffer.at(12).toString(2).padStart(8, '0');
|
||||||
@@ -361,6 +370,8 @@ class Console {
|
|||||||
this.state.shotClock.display = `${this.state.shotClock.seconds}.${this.state.shotClock.tenths}`;
|
this.state.shotClock.display = `${this.state.shotClock.seconds}.${this.state.shotClock.tenths}`;
|
||||||
|
|
||||||
const seqNum = bufferHex.substring(20, 22);
|
const seqNum = bufferHex.substring(20, 22);
|
||||||
|
const hornBinaryFlags = buffer.at(4).toString(2).padStart(8, '0');
|
||||||
|
this.state.horn = hornBinaryFlags[0] === '1';
|
||||||
if (seqNum === '11') {
|
if (seqNum === '11') {
|
||||||
const homeBinaryInfo = buffer.at(12).toString(2).padStart(8, '0');
|
const homeBinaryInfo = buffer.at(12).toString(2).padStart(8, '0');
|
||||||
const guestBinaryInfo = buffer.at(14).toString(2).padStart(8, '0');
|
const guestBinaryInfo = buffer.at(14).toString(2).padStart(8, '0');
|
||||||
@@ -391,6 +402,8 @@ class Console {
|
|||||||
|
|
||||||
this.state.period = parseInt(bufferHex.substring(31, 32), 10);
|
this.state.period = parseInt(bufferHex.substring(31, 32), 10);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO(jwetzell): decode player stats in seqNum >= 22
|
||||||
}
|
}
|
||||||
|
|
||||||
toJSON() {
|
toJSON() {
|
||||||
|
|||||||
Reference in New Issue
Block a user