@momo2555/koppeliajs 0.0.171 → 0.0.172

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.
@@ -123,6 +123,11 @@ export declare class Koppelia {
123
123
  * @returns A promise resolving to the active Play.
124
124
  */
125
125
  getCurrentPlay(): Promise<Play>;
126
+ /**
127
+ * Asynchronously retrieves all currently selected Play instances set on the server.
128
+ * @returns A promise resolving to an array of active Play instances.
129
+ */
130
+ getCurrentPlays(): Promise<Play[]>;
126
131
  /**
127
132
  * Asynchronously executes a named API function on the master peer with the given arguments.
128
133
  * @param functionName The name of the API function to invoke.
@@ -293,6 +293,25 @@ export class Koppelia {
293
293
  });
294
294
  });
295
295
  }
296
+ /**
297
+ * Asynchronously retrieves all currently selected Play instances set on the server.
298
+ * @returns A promise resolving to an array of active Play instances.
299
+ */
300
+ async getCurrentPlays() {
301
+ return new Promise((resolve, reject) => {
302
+ let getCurrentPlaysRequest = new Message();
303
+ getCurrentPlaysRequest.setRequest("getCurrentPlays");
304
+ getCurrentPlaysRequest.setDestination(PeerType.MASTER, "");
305
+ this._console.sendMessage(getCurrentPlaysRequest, (response) => {
306
+ let playsRawList = response.getParam("plays", {});
307
+ let plays = [];
308
+ for (let playId in playsRawList) {
309
+ plays.push(new Play(this._console, playId, playsRawList[playId]));
310
+ }
311
+ resolve(plays);
312
+ });
313
+ });
314
+ }
296
315
  /**
297
316
  * Asynchronously executes a named API function on the master peer with the given arguments.
298
317
  * @param functionName The name of the API function to invoke.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@momo2555/koppeliajs",
3
- "version": "0.0.171",
3
+ "version": "0.0.172",
4
4
  "scripts": {
5
5
  "dev": "vite dev",
6
6
  "build": "vite build && npm run package",