magmastream 2.9.0-dev.29 → 2.9.0-dev.30

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.d.ts CHANGED
@@ -1878,6 +1878,8 @@ declare class Player {
1878
1878
  isAutoplay: boolean;
1879
1879
  /** The number of times to try autoplay before emitting queueEnd. */
1880
1880
  autoplayTries: number;
1881
+ /** The cluster ID for the player. */
1882
+ clusterId: number;
1881
1883
  private readonly data;
1882
1884
  private dynamicLoopInterval;
1883
1885
  dynamicRepeatIntervalMs: number | null;
@@ -453,6 +453,8 @@ class Manager extends events_1.EventEmitter {
453
453
  await promises_1.default.access(filePath); // Check if the file exists
454
454
  const data = await promises_1.default.readFile(filePath, "utf-8");
455
455
  const state = JSON.parse(data);
456
+ if (state.clusterId !== this.options.clusterId)
457
+ continue;
456
458
  if (state && typeof state === "object" && state.guildId && state.node.options.identifier === nodeId) {
457
459
  const lavaPlayer = info.find((player) => player.guildId === state.guildId);
458
460
  if (!lavaPlayer) {
@@ -617,7 +619,7 @@ class Manager extends events_1.EventEmitter {
617
619
  if (!data)
618
620
  continue;
619
621
  const state = JSON.parse(data);
620
- if (!state || typeof state !== "object")
622
+ if (!state || typeof state !== "object" || state.clusterId !== this.options.clusterId)
621
623
  continue;
622
624
  const guildId = key.split(":").pop();
623
625
  if (!guildId)
@@ -52,6 +52,8 @@ class Player {
52
52
  isAutoplay = false;
53
53
  /** The number of times to try autoplay before emitting queueEnd. */
54
54
  autoplayTries = 3;
55
+ /** The cluster ID for the player. */
56
+ clusterId = 0;
55
57
  data = {};
56
58
  dynamicLoopInterval = null;
57
59
  dynamicRepeatIntervalMs = null;
@@ -68,6 +70,7 @@ class Player {
68
70
  this.manager = Utils_1.Structure.get("Player")._manager;
69
71
  if (!this.manager)
70
72
  throw new RangeError("Manager has not been initiated.");
73
+ this.clusterId = this.manager.options.clusterId || 0;
71
74
  // Check the player options for errors.
72
75
  (0, playerCheck_1.default)(options);
73
76
  // Set the guild ID and voice state.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "magmastream",
3
- "version": "2.9.0-dev.29",
3
+ "version": "2.9.0-dev.30",
4
4
  "description": "A user-friendly Lavalink client designed for NodeJS.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",