mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 19:59:28 +02:00
CR feedback
This commit is contained in:
parent
934c9479af
commit
fb7f6df694
2 changed files with 4 additions and 16 deletions
|
@ -237,20 +237,14 @@ void EntityScriptServer::handleEntityScriptCallMethodPacket(QSharedPointer<Recei
|
||||||
if (_entitiesScriptEngine && _entityViewer.getTree() && !_shuttingDown) {
|
if (_entitiesScriptEngine && _entityViewer.getTree() && !_shuttingDown) {
|
||||||
auto entityID = QUuid::fromRfc4122(receivedMessage->read(NUM_BYTES_RFC4122_UUID));
|
auto entityID = QUuid::fromRfc4122(receivedMessage->read(NUM_BYTES_RFC4122_UUID));
|
||||||
|
|
||||||
quint16 methodLength;
|
auto method = receivedMessage->readString();
|
||||||
receivedMessage->readPrimitive(&methodLength);
|
|
||||||
auto methodData = receivedMessage->read(methodLength);
|
|
||||||
auto method = QString::fromUtf8(methodData);
|
|
||||||
|
|
||||||
quint16 paramCount;
|
quint16 paramCount;
|
||||||
receivedMessage->readPrimitive(¶mCount);
|
receivedMessage->readPrimitive(¶mCount);
|
||||||
|
|
||||||
QStringList params;
|
QStringList params;
|
||||||
for (int param = 0; param < paramCount; param++) {
|
for (int param = 0; param < paramCount; param++) {
|
||||||
quint16 paramLength;
|
auto paramString = receivedMessage->readString();
|
||||||
receivedMessage->readPrimitive(¶mLength);
|
|
||||||
auto paramData = receivedMessage->read(paramLength);
|
|
||||||
auto paramString = QString::fromUtf8(paramData);
|
|
||||||
params << paramString;
|
params << paramString;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -79,19 +79,13 @@ void EntityScriptClient::callEntityServerMethod(QUuid entityID, const QString& m
|
||||||
|
|
||||||
packetList->write(entityID.toRfc4122());
|
packetList->write(entityID.toRfc4122());
|
||||||
|
|
||||||
auto methodUtf8 = method.toUtf8();
|
packetList->writeString(method);
|
||||||
quint16 methodLength = methodUtf8.length();
|
|
||||||
packetList->writePrimitive(methodLength);
|
|
||||||
packetList->write(methodUtf8);
|
|
||||||
|
|
||||||
quint16 paramCount = params.length();
|
quint16 paramCount = params.length();
|
||||||
packetList->writePrimitive(paramCount);
|
packetList->writePrimitive(paramCount);
|
||||||
|
|
||||||
foreach(const QString& param, params) {
|
foreach(const QString& param, params) {
|
||||||
auto paramUtf8 = param.toUtf8();
|
packetList->writeString(param);
|
||||||
quint16 paramLength = paramUtf8.length();
|
|
||||||
packetList->writePrimitive(paramLength);
|
|
||||||
packetList->write(paramUtf8);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
nodeList->sendPacketList(std::move(packetList), *entityScriptServer);
|
nodeList->sendPacketList(std::move(packetList), *entityScriptServer);
|
||||||
|
|
Loading…
Reference in a new issue