History

Server side entity script messages

ksuprynowicz committed 2 years ago

Commit dfbc1d81 parent 274867b11 files · +252 −75Browse files

Showing the changes to libraries/script-engine/src/ScriptManagerScriptingInterface.h (1 of 11 files). Show all

Unified · Split

libraries/script-engine/src/ScriptManagerScriptingInterface.h+19−48
@@ -557,7 +557,25 @@ public: · 556 unmodified lines
557 */557 */
558 Q_INVOKABLE void stopProfilingAndSave();558 Q_INVOKABLE void stopProfilingAndSave();
559 559
560signals:560 /*@jsdoc
561 * After calling this function current script engine will start receiving server-side entity script messages
562 * through signals such as errorEntityMessage. This function can be invoked both from client-side entity scripts
563 * and from interface scripts.
564 * @function Script.subscribeToServerEntityScriptMessages
565 */
566
567 Q_INVOKABLE void requestServerEntityScriptMessages();
568
569 /*@jsdoc
570 * Calling this function signalizes that current script doesn't require stop receiving server-side entity script messages
571 * through signals such as errorEntityMessage. This function can be invoked both from client-side entity scripts
572 * and from interface scripts.
573 * @function Script.unsubscribeFromServerEntityScriptMessages
574 */
575
576 Q_INVOKABLE void removeServerEntityScriptMessagesRequest();
577
578 signals:
561 579
562 /*@jsdoc580 /*@jsdoc
563 * @function Script.scriptLoaded581 * @function Script.scriptLoaded
@@ -644,53 +662,6 @@ signals: · 80 unmodified lines
644 */662 */
645 void infoMessage(const QString& message, const QString& scriptName);663 void infoMessage(const QString& message, const QString& scriptName);
646 664
647 /*@jsdoc
648 * Triggered when a client side entity script prints a message to the program log via {@link print}, {@link Script.print},
649 * {@link console.log}, {@link console.debug}, {@link console.group}, {@link console.groupEnd}, {@link console.time}, or
650 * {@link console.timeEnd}.
651 * @function Script.printedMessage
652 * @param {string} message - The message.
653 * @param {string} fileName - Name of the file in which message was generated. Empty string when no file name is available.
654 * @param {number} lineNumber - Number of the line on which message was generated. -1 if there line number is not available.
655 * @param {Uuid} entityID - Entity ID.
656 * @returns {Signal}
657 */
658 void printedEntityMessage(const QString& message, const QString& fileName, int lineNumber, const EntityItemID& entityID);
659
660 /*@jsdoc
661 * Triggered when a client side entity script generates an error, {@link console.error} or {@link console.exception} is called, or
662 * {@link console.assert} is called and fails.
663 * @function Script.errorMessage
664 * @param {string} message - The error message.
665 * @param {string} fileName - Name of the file in which message was generated. Empty string when no file name is available.
666 * @param {number} lineNumber - Number of the line on which message was generated. -1 if there line number is not available.
667 * @param {Uuid} entityID - Entity ID.
668 * @returns {Signal}
669 */
670 void errorEntityMessage(const QString& message, const QString& fileName, int lineNumber, const EntityItemID& entityID);
671
672 /*@jsdoc
673 * Triggered when a client side entity script generates a warning or {@link console.warn} is called.
674 * @function Script.warningMessage
675 * @param {string} message - The warning message.
676 * @param {string} fileName - Name of the file in which message was generated. Empty string when no file name is available.
677 * @param {number} lineNumber - Number of the line on which message was generated. -1 if there line number is not available.
678 * @param {Uuid} entityID - Entity ID.
679 * @returns {Signal}
680 */
681 void warningEntityMessage(const QString& message, const QString& fileName, int lineNumber, const EntityItemID& entityID);
682
683 /*@jsdoc
684 * Triggered when a client side entity script generates an information message or {@link console.info} is called.
685 * @function Script.infoMessage
686 * @param {string} message - The information message.
687 * @param {string} fileName - Name of the file in which message was generated. Empty string when no file name is available.
688 * @param {number} lineNumber - Number of the line on which message was generated. -1 if there line number is not available.
689 * @param {Uuid} entityID - Entity ID.
690 * @returns {Signal}
691 */
692 void infoEntityMessage(const QString& message, const QString& fileName, int lineNumber, const EntityItemID& entityID);
693
694 /*@jsdoc665 /*@jsdoc
695 * Triggered when the running state of the script changes, e.g., from running to stopping.666 * Triggered when the running state of the script changes, e.g., from running to stopping.
696 * @function Script.runningStateChanged667 * @function Script.runningStateChanged