madden-franchise 2.5.3 → 2.5.6

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.
package/FranchiseFile.js CHANGED
@@ -113,7 +113,7 @@ class FranchiseFile extends EventEmitter {
113
113
 
114
114
  for (let i = 0; i < tableIndicies.length; i++) {
115
115
  const currentTable = tableIndicies[i];
116
- const nextTable = tableIndicies.length >= i+1 ? tableIndicies[i+1] : null;
116
+ const nextTable = tableIndicies.length > i+1 ? tableIndicies[i+1] : this.unpackedFileContents.length - 8; // Ignore trailing 8 bytes on last table
117
117
 
118
118
  const tableData = this.unpackedFileContents.slice(currentTable, nextTable);
119
119
 
@@ -190,14 +190,26 @@ class FranchiseFile extends EventEmitter {
190
190
 
191
191
  _packFile(this.unpackedFileContents, options).then((data) => {
192
192
  const dataToSave = this.strategy.file.postPackFile(this.packedFileContents, data);
193
- _save(destination, dataToSave, (err) => {
193
+
194
+ if (options && options.sync) {
195
+ _saveSync(destination, dataToSave);
196
+ postSaveActions();
197
+ }
198
+ else {
199
+ _save(destination, dataToSave, (err) => {
200
+ postSaveActions(err);
201
+ });
202
+ }
203
+
204
+ function postSaveActions(err) {
194
205
  if (err) {
195
206
  reject(err);
196
207
  that.emit('save-error');
197
208
  }
209
+
198
210
  resolve('saved');
199
211
  that.emit('saved');
200
- });
212
+ }
201
213
  });
202
214
  });
203
215
  };
@@ -361,6 +373,10 @@ function _save (destination, packedContents, callback) {
361
373
  fs.writeFile(destination, packedContents, callback);
362
374
  };
363
375
 
376
+ function _saveSync (destination, packedContents) {
377
+ fs.writeFileSync(destination, packedContents);
378
+ };
379
+
364
380
  function getFileType(data) {
365
381
  const isDataCompressed = isCompressed(data);
366
382
  const format = getFormat(data, isDataCompressed);
Binary file
@@ -675,5 +675,179 @@
675
675
  "maxValue": "59"
676
676
  }
677
677
  ]
678
+ },
679
+ {
680
+ "name": "Transaction",
681
+ "numMembers": "11",
682
+ "base": "none()",
683
+ "attributes": [{
684
+ "name": "StartStage",
685
+ "type": "Stage"
686
+ },
687
+ {
688
+ "name": "CurrentStage",
689
+ "type": "Stage"
690
+ },
691
+ {
692
+ "name": "TransitionStage",
693
+ "type": "Stage"
694
+ },
695
+ {
696
+ "name": "IsDynamic",
697
+ "type": "bool",
698
+ "default": "False"
699
+ },
700
+ {
701
+ "name": "IsDone",
702
+ "type": "bool()"
703
+ },
704
+ {
705
+ "name": "Process",
706
+ "type": "none()"
707
+ },
708
+ {
709
+ "name": "Sleep",
710
+ "type": "ITransaction_Sleep"
711
+ },
712
+ {
713
+ "name": "Start",
714
+ "type": "none()"
715
+ },
716
+ {
717
+ "name": "IsBlocking",
718
+ "type": "bool",
719
+ "default": "True"
720
+ },
721
+ {
722
+ "name": "TransitionPending",
723
+ "type": "bool",
724
+ "default": "False"
725
+ },
726
+ {
727
+ "name": "TimeScale",
728
+ "type": "float"
729
+ }
730
+ ]
731
+ },
732
+ {
733
+ "name": "Stage",
734
+ "numMembers": "6",
735
+ "base": "none()",
736
+ "attributes": [{
737
+ "name": "Start",
738
+ "type": "Expression"
739
+ },
740
+ {
741
+ "name": "End",
742
+ "type": "Expression"
743
+ },
744
+ {
745
+ "name": "Process",
746
+ "type": "Expression"
747
+ },
748
+ {
749
+ "name": "Transitions",
750
+ "type": "Transition[]"
751
+ },
752
+ {
753
+ "name": "IsExclusive",
754
+ "type": "bool"
755
+ },
756
+ {
757
+ "name": "IsIdle",
758
+ "type": "bool"
759
+ }
760
+ ]
761
+ },
762
+ {
763
+ "name": "UserRegistry",
764
+ "numMembers": "7",
765
+ "base": "none()",
766
+ "attributes": [{
767
+ "name": "RegisterUserEvent",
768
+ "type": "RegisterUserEvent"
769
+ },
770
+ {
771
+ "name": "TransferOwnerUserEvent",
772
+ "type": "TransferOwnerUserEvent"
773
+ },
774
+ {
775
+ "name": "UnregisterUserEvent",
776
+ "type": "UnregisterUserEvent"
777
+ },
778
+ {
779
+ "name": "UpdateUserDefaultRequestActionEvent",
780
+ "type": "UpdateUserDefaultRequestActionEvent"
781
+ },
782
+ {
783
+ "name": "Users",
784
+ "type": "User[]"
785
+ },
786
+ {
787
+ "name": "AddAdminUserEvent",
788
+ "type": "AddAdminUserEvent"
789
+ },
790
+ {
791
+ "name": "RemoveAdminUserEvent",
792
+ "type": "RemoveAdminUserEvent"
793
+ }
794
+ ]
795
+ },
796
+ {
797
+ "name": "User",
798
+ "numMembers": "6",
799
+ "base": "none()",
800
+ "attributes": [{
801
+ "name": "UserIdLower",
802
+ "type": "int",
803
+ "minValue": "0",
804
+ "maxValue": "-1",
805
+ "default": "0"
806
+ },
807
+ {
808
+ "name": "UserIdUpper",
809
+ "type": "int",
810
+ "minValue": "0",
811
+ "maxValue": "-1",
812
+ "default": "0"
813
+ },
814
+ {
815
+ "name": "UserEntity",
816
+ "type": "UserEntity"
817
+ },
818
+ {
819
+ "name": "DefaultRequestAction",
820
+ "type": "Action",
821
+ "enum": "Action",
822
+ "default": "Action:Respond"
823
+ },
824
+ {
825
+ "name": "DefaultRequestActionTimeout",
826
+ "type": "int",
827
+ "minValue": "-2000000",
828
+ "maxValue": "2000000",
829
+ "default": "0"
830
+ },
831
+ {
832
+ "name": "IsRetired",
833
+ "type": "bool",
834
+ "default": "False"
835
+ }
836
+ ]
837
+ },
838
+ {
839
+ "name": "Transition",
840
+ "numMembers": "2",
841
+ "base": "none()",
842
+ "attributes": [
843
+ {
844
+ "name": "Evaluate",
845
+ "type": "Expression"
846
+ },
847
+ {
848
+ "name": "Stage",
849
+ "type": "Stage"
850
+ }
851
+ ]
678
852
  }
679
853
  ]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "madden-franchise",
3
- "version": "2.5.3",
3
+ "version": "2.5.6",
4
4
  "description": "Tools to read a madden franchise file and get data from it",
5
5
  "main": "FranchiseFile.js",
6
6
  "scripts": {
@@ -1,8 +1,8 @@
1
1
  const fs = require('fs');
2
2
  const zlib = require('zlib');
3
3
 
4
- const filePath = 'D:\\Projects\\Madden 22\\Misc\\FTC\\tuning.frt';
5
- const outputPath = 'D:\\Projects\\Madden 22\\Misc\\FTC\\modified-Tuning.FTC'
4
+ const filePath = 'D:\\Projects\\Madden 22\\Update issue\\Expressions\\Franchise-Expression-binaryMERGED.frt';
5
+ const outputPath = 'D:\\Projects\\Madden 22\\Update issue\\Expressions\\Franchise-Expression-binaryMERGED.FTC'
6
6
 
7
7
  const stream = fs.createReadStream(filePath)
8
8
 
@@ -9,7 +9,7 @@ schemaPicker.pick = (gameYear, major, minor, settings) => {
9
9
  let schemaDirectories = [SCHEMA_DIRECTORY];
10
10
 
11
11
  if (settings && settings.schemaDirectory) {
12
- schemaDirectories.push(settings.schemaDirectory);
12
+ schemaDirectories.unshift(settings.schemaDirectory);
13
13
  }
14
14
 
15
15
  const schemasMeta = readSchemaDirectories(schemaDirectories);