@slot-engine/core 0.1.11 → 0.1.12

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.mjs CHANGED
@@ -1301,7 +1301,11 @@ var Book = class {
1301
1301
  */
1302
1302
  addEvent(event) {
1303
1303
  const index = this.events.length + 1;
1304
- this.events.push({ index, ...event });
1304
+ this.events.push({
1305
+ index,
1306
+ type: event.type,
1307
+ data: copy(event.data)
1308
+ });
1305
1309
  }
1306
1310
  /**
1307
1311
  * Intended for internal use only.
@@ -1726,7 +1730,7 @@ Simulating game mode: ${mode}`);
1726
1730
  createDirIfNotExists(path.join(this.PATHS.base, TEMP_FOLDER));
1727
1731
  this.recordsWriteStream = fs2.createWriteStream(tempRecordsPath, {
1728
1732
  highWaterMark: this.maxHighWaterMark
1729
- });
1733
+ }).setMaxListeners(30);
1730
1734
  const criteriaCounts = ResultSet.getNumberOfSimsForCriteria(this, mode);
1731
1735
  const totalSims = Object.values(criteriaCounts).reduce((a, b) => a + b, 0);
1732
1736
  assert7(
@@ -1829,6 +1833,7 @@ Simulating game mode: ${mode}`);
1829
1833
  type: "done",
1830
1834
  workerNum: index
1831
1835
  });
1836
+ parentPort?.removeAllListeners();
1832
1837
  parentPort?.close();
1833
1838
  }
1834
1839
  }
@@ -2058,7 +2063,7 @@ ${error.stack}
2058
2063
  ctx.state.totalFreespinAmount = 0;
2059
2064
  ctx.state.triggeredMaxWin = false;
2060
2065
  ctx.state.triggeredFreespins = false;
2061
- ctx.state.userData = ctx.config.userState || {};
2066
+ ctx.state.userData = copy(ctx.config.userState);
2062
2067
  }
2063
2068
  /**
2064
2069
  * Contains and executes the entire game logic: