Showing the changes to libraries/script-engine/src/ScriptEngine.cpp (1 of 36 files). Show all
Unified · Split
| @@ -40,7 +40,8 @@ static QScriptValue soundConstructor(QScriptContext* context, QScriptEngine* eng · 39 unmodified lines | ||
| 40 | 40 | } |
| 41 | 41 | |
| 42 | 42 | |
| 43 | −ScriptEngine::ScriptEngine(const QString& scriptContents, bool wantMenuItems, const QString& fileNameString, AbstractMenuInterface* menu, | |
| 43 | +ScriptEngine::ScriptEngine(const QString& scriptContents, bool wantMenuItems, const QString& fileNameString, | |
| 44 | + AbstractMenuInterface* menu, | |
| 44 | 45 | AbstractControllerScriptingInterface* controllerScriptingInterface) : |
| 45 | 46 | _isAvatar(false), |
| 46 | 47 | _dataServerScriptingInterface(), |
| @@ -137,7 +138,7 @@ void ScriptEngine::init() { · 90 unmodified lines | ||
| 137 | 138 | QScriptValue timerValue = _engine.scriptValueFromQMetaObject<QTimer>(); |
| 138 | 139 | _engine.globalObject().setProperty("Timer", timerValue); |
| 139 | 140 | |
| 140 | − registerGlobalObject("Agent", this); | |
| 141 | + registerGlobalObject("Script", this); | |
| 141 | 142 | registerGlobalObject("Audio", &_audioScriptingInterface); |
| 142 | 143 | registerGlobalObject("Controller", _controllerScriptingInterface); |
| 143 | 144 | registerGlobalObject("Data", &_dataServerScriptingInterface); |
| @@ -264,6 +265,27 @@ void ScriptEngine::run() { · 120 unmodified lines | ||
| 264 | 265 | } |
| 265 | 266 | } |
| 266 | 267 | emit scriptEnding(); |
| 268 | + | |
| 269 | + if (_voxelsScriptingInterface.getVoxelPacketSender()->serversExist()) { | |
| 270 | + // release the queue of edit voxel messages. | |
| 271 | + _voxelsScriptingInterface.getVoxelPacketSender()->releaseQueuedMessages(); | |
| 272 | + | |
| 273 | + // since we're in non-threaded mode, call process so that the packets are sent | |
| 274 | + if (!_voxelsScriptingInterface.getVoxelPacketSender()->isThreaded()) { | |
| 275 | + _voxelsScriptingInterface.getVoxelPacketSender()->process(); | |
| 276 | + } | |
| 277 | + } | |
| 278 | + | |
| 279 | + if (_particlesScriptingInterface.getParticlePacketSender()->serversExist()) { | |
| 280 | + // release the queue of edit voxel messages. | |
| 281 | + _particlesScriptingInterface.getParticlePacketSender()->releaseQueuedMessages(); | |
| 282 | + | |
| 283 | + // since we're in non-threaded mode, call process so that the packets are sent | |
| 284 | + if (!_particlesScriptingInterface.getParticlePacketSender()->isThreaded()) { | |
| 285 | + _particlesScriptingInterface.getParticlePacketSender()->process(); | |
| 286 | + } | |
| 287 | + } | |
| 288 | + | |
| 267 | 289 | cleanMenuItems(); |
| 268 | 290 | |
| 269 | 291 | // If we were on a thread, then wait till it's done |