@slot-engine/core 0.1.11 → 0.1.13

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/dist/index.js CHANGED
@@ -1353,7 +1353,11 @@ var Book = class {
1353
1353
  */
1354
1354
  addEvent(event) {
1355
1355
  const index = this.events.length + 1;
1356
- this.events.push({ index, ...event });
1356
+ this.events.push({
1357
+ index,
1358
+ type: event.type,
1359
+ data: copy(event.data)
1360
+ });
1357
1361
  }
1358
1362
  /**
1359
1363
  * Intended for internal use only.
@@ -1778,7 +1782,7 @@ Simulating game mode: ${mode}`);
1778
1782
  createDirIfNotExists(import_path.default.join(this.PATHS.base, TEMP_FOLDER));
1779
1783
  this.recordsWriteStream = import_fs2.default.createWriteStream(tempRecordsPath, {
1780
1784
  highWaterMark: this.maxHighWaterMark
1781
- });
1785
+ }).setMaxListeners(30);
1782
1786
  const criteriaCounts = ResultSet.getNumberOfSimsForCriteria(this, mode);
1783
1787
  const totalSims = Object.values(criteriaCounts).reduce((a, b) => a + b, 0);
1784
1788
  (0, import_assert7.default)(
@@ -1881,6 +1885,7 @@ Simulating game mode: ${mode}`);
1881
1885
  type: "done",
1882
1886
  workerNum: index
1883
1887
  });
1888
+ import_worker_threads.parentPort?.removeAllListeners();
1884
1889
  import_worker_threads.parentPort?.close();
1885
1890
  }
1886
1891
  }
@@ -2110,7 +2115,7 @@ ${error.stack}
2110
2115
  ctx.state.totalFreespinAmount = 0;
2111
2116
  ctx.state.triggeredMaxWin = false;
2112
2117
  ctx.state.triggeredFreespins = false;
2113
- ctx.state.userData = ctx.config.userState || {};
2118
+ ctx.state.userData = copy(ctx.config.userState);
2114
2119
  }
2115
2120
  /**
2116
2121
  * Contains and executes the entire game logic:
@@ -3671,7 +3676,7 @@ var GeneratedReelSet = class extends ReelSet {
3671
3676
  `Error generating reels for game mode "${this.associatedGameModeName}". It's not defined in the game config.`
3672
3677
  );
3673
3678
  }
3674
- const outputDir = import_path7.default.join(config.rootDir, config.outputDir);
3679
+ const outputDir = config.rootDir.endsWith(config.outputDir) ? config.rootDir : import_path7.default.join(config.rootDir, config.outputDir);
3675
3680
  const filePath = import_path7.default.join(
3676
3681
  outputDir,
3677
3682
  `reels_${this.associatedGameModeName}-${this.id}.csv`