mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 12:43:54 +02:00
Add Entities.reloadServerScripts
This commit is contained in:
parent
142c7da523
commit
812aaee48c
3 changed files with 24 additions and 1 deletions
|
@ -670,6 +670,26 @@ RayToEntityIntersectionResult EntityScriptingInterface::findRayIntersectionWorke
|
|||
return result;
|
||||
}
|
||||
|
||||
bool EntityScriptingInterface::reloadServerScripts(QUuid entityID) {
|
||||
// Send packet to entity script server
|
||||
auto nodeList = DependencyManager::get<NodeList>();
|
||||
SharedNodePointer entityScriptServer = nodeList->soloNodeOfType(NodeType::AssetServer);
|
||||
|
||||
if (entityScriptServer) {
|
||||
auto id = entityID.toByteArray();
|
||||
auto payloadSize = id.size();
|
||||
auto packet = NLPacket::create(PacketType::ReloadEntityServerScript, payloadSize, true);
|
||||
|
||||
packet->write(id);
|
||||
|
||||
if (nodeList->sendPacket(std::move(packet), *entityScriptServer) != -1) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void EntityScriptingInterface::setLightsArePickable(bool value) {
|
||||
LightEntityItem::setLightsArePickable(value);
|
||||
}
|
||||
|
|
|
@ -210,6 +210,8 @@ public slots:
|
|||
/// order to return an accurate result
|
||||
Q_INVOKABLE RayToEntityIntersectionResult findRayIntersectionBlocking(const PickRay& ray, bool precisionPicking = false, const QScriptValue& entityIdsToInclude = QScriptValue(), const QScriptValue& entityIdsToDiscard = QScriptValue());
|
||||
|
||||
Q_INVOKABLE bool reloadServerScripts(QUuid entityID);
|
||||
|
||||
Q_INVOKABLE void setLightsArePickable(bool value);
|
||||
Q_INVOKABLE bool getLightsArePickable() const;
|
||||
|
||||
|
|
|
@ -107,7 +107,8 @@ public:
|
|||
RequestsDomainListData,
|
||||
ExitingSpaceBubble,
|
||||
PerAvatarGainSet,
|
||||
LAST_PACKET_TYPE = PerAvatarGainSet
|
||||
ReloadEntityServerScript,
|
||||
LAST_PACKET_TYPE = ReloadEntityServerScript
|
||||
};
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue