History

Merge remote-tracking branch 'upstream/master' into kasenvr-kpi-v1-modkit-rc-merge

humbletim committed 7 years ago

Commit 271fac42 parents bad32e9 96f67931529 files · +58136 −6493Browse files

Showing the changes to libraries/script-engine/src/ScriptEngine.cpp (1 of 1529 files). Show all

Unified · Split

libraries/script-engine/src/ScriptEngine.cpp+12−5
@@ -427,6 +427,12 @@ void ScriptEngine::waitTillDoneRunning() { · 426 unmodified lines
427 if (isEvaluating()) {427 if (isEvaluating()) {
428 qCWarning(scriptengine) << "Script Engine has been running too long, aborting:" << getFilename();428 qCWarning(scriptengine) << "Script Engine has been running too long, aborting:" << getFilename();
429 abortEvaluation();429 abortEvaluation();
430 } else {
431 auto context = currentContext();
432 if (context) {
433 qCWarning(scriptengine) << "Script Engine has been running too long, throwing:" << getFilename();
434 context->throwError("Timed out during shutdown");
435 }
430 }436 }
431 437
432 // Wait for the scripting thread to stop running, as438 // Wait for the scripting thread to stop running, as
@@ -449,9 +455,9 @@ void ScriptEngine::waitTillDoneRunning() { · 16 unmodified lines
449 qCWarning(scriptengine) << "Script Engine has been running too long, aborting:" << getFilename();455 qCWarning(scriptengine) << "Script Engine has been running too long, aborting:" << getFilename();
450 abortEvaluation();456 abortEvaluation();
451 } else {457 } else {
452 qCWarning(scriptengine) << "Script Engine has been running too long, throwing:" << getFilename();
453 auto context = currentContext();458 auto context = currentContext();
454 if (context) {459 if (context) {
460 qCWarning(scriptengine) << "Script Engine has been running too long, throwing:" << getFilename();
455 context->throwError("Timed out during shutdown");461 context->throwError("Timed out during shutdown");
456 }462 }
457 }463 }
@@ -2209,7 +2215,7 @@ void ScriptEngine::loadEntityScript(const EntityItemID& entityID, const QString& · 1751 unmodified lines
2209/**jsdoc2215/**jsdoc
2210 * Triggered when the script starts for a user. See also, {@link Script.entityScriptPreloadFinished}.2216 * Triggered when the script starts for a user. See also, {@link Script.entityScriptPreloadFinished}.
2211 * <p>Note: Can only be connected to via <code>this.preload = function (...) { ... }</code> in the entity script.</p>2217 * <p>Note: Can only be connected to via <code>this.preload = function (...) { ... }</code> in the entity script.</p>
2212 * <table><tr><th>Available in:</th><td>Client Entity Scripts</td><td>Server Entity Scripts</td></tr></table>2218 * <p class="availableIn"><strong>Supported Script Types:</strong> Client Entity Scripts &bull; Server Entity Scripts</p>
2213 * @function Entities.preload2219 * @function Entities.preload
2214 * @param {Uuid} entityID - The ID of the entity that the script is running in.2220 * @param {Uuid} entityID - The ID of the entity that the script is running in.
2215 * @returns {Signal}2221 * @returns {Signal}
@@ -2415,7 +2421,7 @@ void ScriptEngine::entityScriptContentAvailable(const EntityItemID& entityID, co · 199 unmodified lines
2415/**jsdoc2421/**jsdoc
2416 * Triggered when the script terminates for a user.2422 * Triggered when the script terminates for a user.
2417 * <p>Note: Can only be connected to via <code>this.unoad = function () { ... }</code> in the entity script.</p>2423 * <p>Note: Can only be connected to via <code>this.unoad = function () { ... }</code> in the entity script.</p>
2418 * <table><tr><th>Available in:</th><td>Client Entity Scripts</td><td>Server Entity Scripts</td></tr></table>2424 * <p class="availableIn"><strong>Supported Script Types:</strong> Client Entity Scripts &bull; Server Entity Scripts</p>
2419 * @function Entities.unload2425 * @function Entities.unload
2420 * @param {Uuid} entityID - The ID of the entity that the script is running in.2426 * @param {Uuid} entityID - The ID of the entity that the script is running in.
2421 * @returns {Signal}2427 * @returns {Signal}
@@ -2475,13 +2481,14 @@ QList<EntityItemID> ScriptEngine::getListOfEntityScriptIDs() { · 53 unmodified lines
2475 return _entityScripts.keys();2481 return _entityScripts.keys();
2476}2482}
2477 2483
2478void ScriptEngine::unloadAllEntityScripts() {2484void ScriptEngine::unloadAllEntityScripts(bool blockingCall) {
2479 if (QThread::currentThread() != thread()) {2485 if (QThread::currentThread() != thread()) {
2480#ifdef THREAD_DEBUGGING2486#ifdef THREAD_DEBUGGING
2481 qCDebug(scriptengine) << "*** WARNING *** ScriptEngine::unloadAllEntityScripts() called on wrong thread [" << QThread::currentThread() << "], invoking on correct thread [" << thread() << "]";2487 qCDebug(scriptengine) << "*** WARNING *** ScriptEngine::unloadAllEntityScripts() called on wrong thread [" << QThread::currentThread() << "], invoking on correct thread [" << thread() << "]";
2482#endif2488#endif
2483 2489
2484 QMetaObject::invokeMethod(this, "unloadAllEntityScripts");2490 QMetaObject::invokeMethod(this, "unloadAllEntityScripts",
2491 blockingCall ? Qt::BlockingQueuedConnection : Qt::QueuedConnection);
2485 return;2492 return;
2486 }2493 }
2487#ifdef THREAD_DEBUGGING2494#ifdef THREAD_DEBUGGING

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t