mirror of
https://github.com/jwetzell/aas-js.git
synced 2026-08-21 04:49:06 +00:00
add function to parse their weirdly packed ints
This commit is contained in:
@@ -314,6 +314,20 @@ class Console {
|
|||||||
|
|
||||||
// TODO(jwetzell): decode player stats in seqNum >= 22
|
// TODO(jwetzell): decode player stats in seqNum >= 22
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param {Buffer} buffer
|
||||||
|
*/
|
||||||
|
getWeirdInt(buffer) {
|
||||||
|
let num = ((buffer >> 4) & 15) * 10;
|
||||||
|
if (num > 90) {
|
||||||
|
num = 0;
|
||||||
|
}
|
||||||
|
if ((buffer & 15) > 9) {
|
||||||
|
buffer = 0x00;
|
||||||
|
}
|
||||||
|
return num + (buffer & 15);
|
||||||
|
}
|
||||||
|
|
||||||
toJSON() {
|
toJSON() {
|
||||||
return {
|
return {
|
||||||
|
|||||||
Reference in New Issue
Block a user