Wrong read length on uInt read

This commit is contained in:
Emily 2019-07-31 17:14:15 +02:00
parent 2463cc3dbc
commit 59709ec34c

View File

@ -47,8 +47,8 @@ class FLYSocket {
let ret = [];
let length = data.getUint8(this.pointer++);
for (let i = 0; i < length; i++) {
ret.push( data.getUint16(this.pointer) );
this.pointer += 2;
ret.push( data.getUint32(this.pointer) );
this.pointer += 4;
}
return ret;
}
@ -64,7 +64,7 @@ class FLYSocket {
// I: FlightUUID
// ?: Subscribed to flight data
let ret = [];
ret.push( data.getUint16(this.pointer) ); this.pointer += 2;
ret.push( data.getUint32(this.pointer) ); this.pointer += 4;
ret.push( data.getUint8(this.pointer++) != 0 );
return ret;
}
@ -81,7 +81,7 @@ class FLYSocket {
// I: FlightUUID
// ?: Flight active
let ret = [];
ret.push( data.getUint16(this.pointer) ); this.pointer += 2;
ret.push( data.getUint32(this.pointer) ); this.pointer += 4;
ret.push( data.getUint8(this.pointer++) != 0 );
return ret;
}