@momo2555/koppeliajs 0.0.171 → 0.0.173
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.
|
package/dist/scripts/koppelia.js
CHANGED
|
@@ -293,6 +293,22 @@ 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 = playsRawList.map((playData) => new Play(this._console, playData.id, playData));
|
|
308
|
+
resolve(plays);
|
|
309
|
+
});
|
|
310
|
+
});
|
|
311
|
+
}
|
|
296
312
|
/**
|
|
297
313
|
* Asynchronously executes a named API function on the master peer with the given arguments.
|
|
298
314
|
* @param functionName The name of the API function to invoke.
|