Skip to content

Commit

Permalink
Merge pull request #51 from duncte123/fix/zlib-decode
Browse files Browse the repository at this point in the history
UBJSON: decode uint8
  • Loading branch information
featherbear authored Jan 30, 2025
2 parents b8d4e4e + 66bd3ad commit ce54e7e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
__pycache__/
node_modules/
/dist/
.idea/
14 changes: 13 additions & 1 deletion src/lib/util/zlib/zlibDeserialiser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,18 @@ export function zlibDeserialiseBuffer(buf: Buffer): ZlibPayload {
break
}

// uint8
case 0x55 /* U */: {
length = 1
break
}

// int32
case 0x6c /* l */: {
length = 4
break
}

// int64
case 0x4c /* L */: {
length = 8
Expand Down Expand Up @@ -133,6 +139,12 @@ export function zlibDeserialiseBuffer(buf: Buffer): ZlibPayload {
break
}

// uint8
case 0x55 /* U */: {
value = valueData.readUInt8()
break
}

// int32
case 0x6c /* l */: {
value = valueData.readInt32BE()
Expand Down

0 comments on commit ce54e7e

Please sign in to comment.