Showing the changes to libraries/entities/src/EntityScriptingInterface.cpp (1 of 3 files). Show all
Unified · Split
| @@ -670,6 +670,26 @@ RayToEntityIntersectionResult EntityScriptingInterface::findRayIntersectionWorke · 669 unmodified lines | ||
| 670 | 670 | return result; |
| 671 | 671 | } |
| 672 | 672 | |
| 673 | +bool EntityScriptingInterface::reloadServerScripts(QUuid entityID) { | |
| 674 | + // Send packet to entity script server | |
| 675 | + auto nodeList = DependencyManager::get<NodeList>(); | |
| 676 | + SharedNodePointer entityScriptServer = nodeList->soloNodeOfType(NodeType::AssetServer); | |
| 677 | + | |
| 678 | + if (entityScriptServer) { | |
| 679 | + auto id = entityID.toByteArray(); | |
| 680 | + auto payloadSize = id.size(); | |
| 681 | + auto packet = NLPacket::create(PacketType::ReloadEntityServerScript, payloadSize, true); | |
| 682 | + | |
| 683 | + packet->write(id); | |
| 684 | + | |
| 685 | + if (nodeList->sendPacket(std::move(packet), *entityScriptServer) != -1) { | |
| 686 | + return true; | |
| 687 | + } | |
| 688 | + } | |
| 689 | + | |
| 690 | + return false; | |
| 691 | +} | |
| 692 | + | |
| 673 | 693 | void EntityScriptingInterface::setLightsArePickable(bool value) { |
| 674 | 694 | LightEntityItem::setLightsArePickable(value); |
| 675 | 695 | } |