madden-franchise 3.0.1 → 3.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -96,6 +96,7 @@ class FranchiseFileTable extends EventEmitter {
96
96
 
97
97
  bufferArrays.push(this.data.slice(currentOffset, recordOffset));
98
98
  const recordHexData = record.hexData;
99
+
99
100
  bufferArrays.push(recordHexData);
100
101
  currentOffset = recordOffset + recordHexData.length;
101
102
  }
@@ -153,6 +154,7 @@ class FranchiseFileTable extends EventEmitter {
153
154
  record.isEmpty = isEmptyReference;
154
155
  });
155
156
 
157
+
156
158
  // We need to determine the starting node.
157
159
  // To do that, we need to find the empty record which no other empty record points to.
158
160
  const unreachableRecords = this.records.filter((record) => { return record.isEmpty; }).filter((record) => {
@@ -430,8 +432,8 @@ class FranchiseFileTable extends EventEmitter {
430
432
  // If so, then the record is still considered empty.
431
433
 
432
434
  // We need to check the buffer because the first field is not always a reference.
433
- const referenceData = utilService.getReferenceDataFromBuffer(object.data.slice(0, 4));
434
- if (referenceData.tableId !== 0) {
435
+ // const referenceData = utilService.getReferenceDataFromBuffer(object.data.slice(0, 4));
436
+ // if (referenceData.tableId !== 0 || referenceData.rowNumber > this.header.recordCapacity) {
435
437
 
436
438
  // Delete the empty record entry because it is no longer empty
437
439
  this.emptyRecords.delete(object.index);
@@ -476,7 +478,7 @@ class FranchiseFileTable extends EventEmitter {
476
478
  if (!previousEmptyReference && !nextEmptyReference) {
477
479
  this.setNextRecordToUse(this.header.recordCapacity);
478
480
  }
479
- }
481
+ // }
480
482
  }
481
483
  }
482
484
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "madden-franchise",
3
- "version": "3.0.1",
3
+ "version": "3.0.2",
4
4
  "description": "Tools to read a madden franchise file and get data from it",
5
5
  "main": "FranchiseFile.js",
6
6
  "scripts": {
@@ -1,7 +1,7 @@
1
1
  const fs = require('fs');
2
2
  const zlib = require('zlib');
3
3
 
4
- const filePath = 'D:\\Projects\\Madden 22\\Update issue\\Expressions\\Franchise-Expression-binaryMERGED.frt';
4
+ const filePath = 'D:\\Projects\\Madden 23\\FranTkData\\Franchise-Expression-binary.frt';
5
5
  const outputPath = 'D:\\Projects\\Madden 22\\Update issue\\Expressions\\Franchise-Expression-binaryMERGED.FTC'
6
6
 
7
7
  const stream = fs.createReadStream(filePath)
@@ -1,11 +1,11 @@
1
1
  const fs = require('fs');
2
2
  const zlib = require('zlib');
3
3
 
4
- const filePath = 'C:\\Projects\\madden-franchise\\tests\\data\\CAREER-21COMPRESS';
5
- const outputPath = 'C:\\Projects\\madden-franchise\\tests\\data\\21UNCOMPRESS.frt'
4
+ const filePath = 'D:\\Projects\\Madden 23\\FranTkData\\Franchise-Expression-binary.FTC';
5
+ const outputPath = 'D:\\Projects\\Madden 23\\FranTkData\\Franchise-Expression-binary.ftx'
6
6
 
7
7
  const fileData = fs.readFileSync(filePath);
8
- const inflateData = zlib.inflateSync(fileData.slice(0x52));
8
+ const inflateData = zlib.inflateSync(fileData);
9
9
  fs.writeFileSync(outputPath, inflateData);
10
10
 
11
11
  // let notDone = true;
@@ -221,7 +221,7 @@ utilService.toInteger = function (x) {
221
221
  utilService.getReferenceData = function (value) {
222
222
  return {
223
223
  'tableId': utilService.bin2dec(value.substring(0, 15)),
224
- 'rowNumber': utilService.bin2dec(value.substring(16))
224
+ 'rowNumber': utilService.bin2dec(value.substring(15))
225
225
  }
226
226
  };
227
227