Model Server to Entity Server Refactoring
Showing the changes to libraries/script-engine/src/ScriptEngine.cpp (1 of 158 files). Show all
Unified · Split
| @@ -22,7 +22,7 @@ · 21 unmodified lines | ||
| 22 | 22 | #include <AvatarData.h> |
| 23 | 23 | #include <Bitstream.h> |
| 24 | 24 | #include <CollisionInfo.h> |
| 25 | −#include <ModelsScriptingInterface.h> | |
| 25 | +#include <EntityScriptingInterface.h> | |
| 26 | 26 | #include <NetworkAccessManager.h> |
| 27 | 27 | #include <NodeList.h> |
| 28 | 28 | #include <PacketHeaders.h> |
| @@ -44,7 +44,7 @@ · 15 unmodified lines | ||
| 44 | 44 | |
| 45 | 45 | VoxelsScriptingInterface ScriptEngine::_voxelsScriptingInterface; |
| 46 | 46 | ParticlesScriptingInterface ScriptEngine::_particlesScriptingInterface; |
| 47 | −ModelsScriptingInterface ScriptEngine::_modelsScriptingInterface; | |
| 47 | +EntityScriptingInterface ScriptEngine::_entityScriptingInterface; | |
| 48 | 48 | |
| 49 | 49 | static QScriptValue soundConstructor(QScriptContext* context, QScriptEngine* engine) { |
| 50 | 50 | QUrl soundURL = QUrl(context->argument(0).toString()); |
| @@ -249,10 +249,10 @@ void ScriptEngine::init() { · 198 unmodified lines | ||
| 249 | 249 | qScriptRegisterMetaType(this, ParticleIDtoScriptValue, ParticleIDfromScriptValue); |
| 250 | 250 | qScriptRegisterSequenceMetaType<QVector<ParticleID> >(this); |
| 251 | 251 | |
| 252 | − qScriptRegisterMetaType(this, ModelItemPropertiesToScriptValue, ModelItemPropertiesFromScriptValue); | |
| 253 | − qScriptRegisterMetaType(this, ModelItemIDtoScriptValue, ModelItemIDfromScriptValue); | |
| 254 | − qScriptRegisterMetaType(this, RayToModelIntersectionResultToScriptValue, RayToModelIntersectionResultFromScriptValue); | |
| 255 | − qScriptRegisterSequenceMetaType<QVector<ModelItemID> >(this); | |
| 252 | + qScriptRegisterMetaType(this, EntityItemPropertiesToScriptValue, EntityItemPropertiesFromScriptValue); | |
| 253 | + qScriptRegisterMetaType(this, EntityItemIDtoScriptValue, EntityItemIDfromScriptValue); | |
| 254 | + qScriptRegisterMetaType(this, RayToEntityIntersectionResultToScriptValue, RayToEntityIntersectionResultFromScriptValue); | |
| 255 | + qScriptRegisterSequenceMetaType<QVector<EntityItemID> >(this); | |
| 256 | 256 | |
| 257 | 257 | qScriptRegisterSequenceMetaType<QVector<glm::vec2> >(this); |
| 258 | 258 | qScriptRegisterSequenceMetaType<QVector<glm::quat> >(this); |
| @@ -282,7 +282,7 @@ void ScriptEngine::init() { · 23 unmodified lines | ||
| 282 | 282 | registerGlobalObject("Script", this); |
| 283 | 283 | registerGlobalObject("Audio", &_audioScriptingInterface); |
| 284 | 284 | registerGlobalObject("Controller", _controllerScriptingInterface); |
| 285 | − registerGlobalObject("Models", &_modelsScriptingInterface); | |
| 285 | + registerGlobalObject("Entities", &_entityScriptingInterface); | |
| 286 | 286 | registerGlobalObject("Particles", &_particlesScriptingInterface); |
| 287 | 287 | registerGlobalObject("Quat", &_quatLibrary); |
| 288 | 288 | registerGlobalObject("Vec3", &_vec3Library); |
| @@ -428,13 +428,13 @@ void ScriptEngine::run() { · 139 unmodified lines | ||
| 428 | 428 | } |
| 429 | 429 | } |
| 430 | 430 | |
| 431 | − if (_modelsScriptingInterface.getModelPacketSender()->serversExist()) { | |
| 431 | + if (_entityScriptingInterface.getEntityPacketSender()->serversExist()) { | |
| 432 | 432 | // release the queue of edit voxel messages. |
| 433 | − _modelsScriptingInterface.getModelPacketSender()->releaseQueuedMessages(); | |
| 433 | + _entityScriptingInterface.getEntityPacketSender()->releaseQueuedMessages(); | |
| 434 | 434 | |
| 435 | 435 | // since we're in non-threaded mode, call process so that the packets are sent |
| 436 | − if (!_modelsScriptingInterface.getModelPacketSender()->isThreaded()) { | |
| 437 | − _modelsScriptingInterface.getModelPacketSender()->process(); | |
| 436 | + if (!_entityScriptingInterface.getEntityPacketSender()->isThreaded()) { | |
| 437 | + _entityScriptingInterface.getEntityPacketSender()->process(); | |
| 438 | 438 | } |
| 439 | 439 | } |
| 440 | 440 | |
| @@ -570,13 +570,13 @@ void ScriptEngine::run() { · 129 unmodified lines | ||
| 570 | 570 | } |
| 571 | 571 | } |
| 572 | 572 | |
| 573 | − if (_modelsScriptingInterface.getModelPacketSender()->serversExist()) { | |
| 574 | − // release the queue of edit voxel messages. | |
| 575 | − _modelsScriptingInterface.getModelPacketSender()->releaseQueuedMessages(); | |
| 573 | + if (_entityScriptingInterface.getEntityPacketSender()->serversExist()) { | |
| 574 | + // release the queue of edit entity messages. | |
| 575 | + _entityScriptingInterface.getEntityPacketSender()->releaseQueuedMessages(); | |
| 576 | 576 | |
| 577 | 577 | // since we're in non-threaded mode, call process so that the packets are sent |
| 578 | − if (!_modelsScriptingInterface.getModelPacketSender()->isThreaded()) { | |
| 579 | − _modelsScriptingInterface.getModelPacketSender()->process(); | |
| 578 | + if (!_entityScriptingInterface.getEntityPacketSender()->isThreaded()) { | |
| 579 | + _entityScriptingInterface.getEntityPacketSender()->process(); | |
| 580 | 580 | } |
| 581 | 581 | } |
| 582 | 582 | |