History

Implement DEV-257: Allow scripts running on the ESS to access avatar info via the AvatarHashMap

Zach Fox committed 7 years ago

Commit f325cef1 parent 99aeb4a2 files · +3 −3Browse files

Showing the changes to assignment-client/src/scripts/EntityScriptServer.cpp (1 of 2 files). Show all

Unified · Split

assignment-client/src/scripts/EntityScriptServer.cpp+2−2
@@ -86,8 +86,6 @@ EntityScriptServer::EntityScriptServer(ReceivedMessage& message) : ThreadedAssig · 85 unmodified lines
8686 this, "handleOctreePacket");
8787 packetReceiver.registerListener(PacketType::SelectedAudioFormat, this, "handleSelectedAudioFormat");
8888
89− auto avatarHashMap = DependencyManager::set<AvatarHashMap>();
90−
9189 packetReceiver.registerListener(PacketType::ReloadEntityServerScript, this, "handleReloadEntityServerScriptPacket");
9290 packetReceiver.registerListener(PacketType::EntityScriptGetStatus, this, "handleEntityScriptGetStatusPacket");
9391 packetReceiver.registerListener(PacketType::EntityServerScriptLog, this, "handleEntityServerScriptLogPacket");
@@ -255,6 +253,7 @@ void EntityScriptServer::handleEntityScriptCallMethodPacket(QSharedPointer<Recei · 161 unmodified lines
255253 void EntityScriptServer::run() {
256254 DependencyManager::set<ScriptEngines>(ScriptEngine::ENTITY_SERVER_SCRIPT);
257255 DependencyManager::set<EntityScriptServerServices>();
256+ DependencyManager::set<AvatarHashMap>();
258257
259258 // make sure we request our script once the agent connects to the domain
260259 auto nodeList = DependencyManager::get<NodeList>();
@@ -448,6 +447,7 @@ void EntityScriptServer::resetEntitiesScriptEngine() { · 187 unmodified lines
448447 newEngine->globalObject().setProperty("WebSocketServer", webSocketServerConstructorValue);
449448
450449 newEngine->registerGlobalObject("SoundCache", DependencyManager::get<SoundCacheScriptingInterface>().data());
450+ newEngine->registerGlobalObject("AvatarList", DependencyManager::get<AvatarHashMap>().data());
451451
452452 // connect this script engines printedMessage signal to the global ScriptEngines these various messages
453453 auto scriptEngines = DependencyManager::get<ScriptEngines>().data();