Skip to content

Commit

Permalink
Fix startApp
Browse files Browse the repository at this point in the history
  • Loading branch information
martenrichter committed Dec 28, 2024
1 parent e9c5b39 commit 0cc1c04
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/data.js
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ export class Container extends Sink {

dataview.setUint8(0, 10) // major command type, startApp is 10

dataview.setUint16(1, 96) // length 1..2
dataview.setUint16(1, 80) // length 1..2
dataview.setUint8(3, 0) // reserved 3
dataview.setFloat64(4, time) // 4..11
// positioning
Expand All @@ -359,9 +359,9 @@ export class Container extends Sink {
dest++
}
// parse uuid
dest = 65 // 65-96
dest = 65 // 65-80
for (let i = 0; i < 36; i += 2) {
if (appid.substr(i, 2) === '-') i++
if (appid.substr(i, 1) === '-') i++
dataview.setUint8(dest, parseInt(appid.substr(i, 2), 16))
dest++
}
Expand Down Expand Up @@ -536,7 +536,7 @@ export class MemContainer extends Container {
time = dataview.getFloat64(position + 8)
break
case 10:
if (position + 96 > this.storageSize) return 0 // should never happen
if (position + 80 > this.storageSize) return 0 // should never happen
time = dataview.getFloat64(position + 4)
break
case 11:
Expand Down Expand Up @@ -603,7 +603,7 @@ export class MemContainer extends Container {
objnum = dataview.getUint32(position + 4)
break
case 10:
if (position + 96 > this.storageSize) return 0 // should never happen
if (position + 80 > this.storageSize) return 0 // should never happen
break
case 11:
if (position + 12 > this.storageSize) return 0 // should never happen
Expand Down Expand Up @@ -839,7 +839,7 @@ export class MemContainer extends Container {
case 10:
{
// now replay the data
if (length < 96) {
if (length < 80) {
// console.log("damaged data1",length,pos);
return -1 // damaged data
}
Expand All @@ -856,7 +856,7 @@ export class MemContainer extends Container {
src++
}
// now the uuid
src = 65 // 65-96
src = 65 // 65-80
let appid = ''
for (let i = 0; i < 32; i += 2) {
const number = dataview.getUint8(pos + src)
Expand Down

0 comments on commit 0cc1c04

Please sign in to comment.