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
86 this, "handleOctreePacket");86 this, "handleOctreePacket");
87 packetReceiver.registerListener(PacketType::SelectedAudioFormat, this, "handleSelectedAudioFormat");87 packetReceiver.registerListener(PacketType::SelectedAudioFormat, this, "handleSelectedAudioFormat");
88 88
89 auto avatarHashMap = DependencyManager::set<AvatarHashMap>();
90
91 packetReceiver.registerListener(PacketType::ReloadEntityServerScript, this, "handleReloadEntityServerScriptPacket");89 packetReceiver.registerListener(PacketType::ReloadEntityServerScript, this, "handleReloadEntityServerScriptPacket");
92 packetReceiver.registerListener(PacketType::EntityScriptGetStatus, this, "handleEntityScriptGetStatusPacket");90 packetReceiver.registerListener(PacketType::EntityScriptGetStatus, this, "handleEntityScriptGetStatusPacket");
93 packetReceiver.registerListener(PacketType::EntityServerScriptLog, this, "handleEntityServerScriptLogPacket");91 packetReceiver.registerListener(PacketType::EntityServerScriptLog, this, "handleEntityServerScriptLogPacket");
@@ -255,6 +253,7 @@ void EntityScriptServer::handleEntityScriptCallMethodPacket(QSharedPointer<Recei · 161 unmodified lines
255void EntityScriptServer::run() {253void EntityScriptServer::run() {
256 DependencyManager::set<ScriptEngines>(ScriptEngine::ENTITY_SERVER_SCRIPT);254 DependencyManager::set<ScriptEngines>(ScriptEngine::ENTITY_SERVER_SCRIPT);
257 DependencyManager::set<EntityScriptServerServices>();255 DependencyManager::set<EntityScriptServerServices>();
256 DependencyManager::set<AvatarHashMap>();
258 257
259 // make sure we request our script once the agent connects to the domain258 // make sure we request our script once the agent connects to the domain
260 auto nodeList = DependencyManager::get<NodeList>();259 auto nodeList = DependencyManager::get<NodeList>();
@@ -448,6 +447,7 @@ void EntityScriptServer::resetEntitiesScriptEngine() { · 187 unmodified lines
448 newEngine->globalObject().setProperty("WebSocketServer", webSocketServerConstructorValue);447 newEngine->globalObject().setProperty("WebSocketServer", webSocketServerConstructorValue);
449 448
450 newEngine->registerGlobalObject("SoundCache", DependencyManager::get<SoundCacheScriptingInterface>().data());449 newEngine->registerGlobalObject("SoundCache", DependencyManager::get<SoundCacheScriptingInterface>().data());
450 newEngine->registerGlobalObject("AvatarList", DependencyManager::get<AvatarHashMap>().data());
451 451
452 // connect this script engines printedMessage signal to the global ScriptEngines these various messages452 // connect this script engines printedMessage signal to the global ScriptEngines these various messages
453 auto scriptEngines = DependencyManager::get<ScriptEngines>().data();453 auto scriptEngines = DependencyManager::get<ScriptEngines>().data();