mirror of
https://github.com/lubosz/overte.git
synced 2025-04-24 09:23:17 +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) {
|
||||
auto entityID = QUuid::fromRfc4122(receivedMessage->read(NUM_BYTES_RFC4122_UUID));
|
||||
|
||||
quint16 methodLength;
|
||||
receivedMessage->readPrimitive(&methodLength);
|
||||
auto methodData = receivedMessage->read(methodLength);
|
||||
auto method = QString::fromUtf8(methodData);
|
||||
auto method = receivedMessage->readString();
|
||||
|
||||
quint16 paramCount;
|
||||
receivedMessage->readPrimitive(¶mCount);
|
||||
|
||||
QStringList params;
|
||||
for (int param = 0; param < paramCount; param++) {
|
||||
quint16 paramLength;
|
||||
receivedMessage->readPrimitive(¶mLength);
|
||||
auto paramData = receivedMessage->read(paramLength);
|
||||
auto paramString = QString::fromUtf8(paramData);
|
||||
auto paramString = receivedMessage->readString();
|
||||
params << paramString;
|
||||
}
|
||||
|
||||
|
|
|
@ -79,19 +79,13 @@ void EntityScriptClient::callEntityServerMethod(QUuid entityID, const QString& m
|
|||
|
||||
packetList->write(entityID.toRfc4122());
|
||||
|
||||
auto methodUtf8 = method.toUtf8();
|
||||
quint16 methodLength = methodUtf8.length();
|
||||
packetList->writePrimitive(methodLength);
|
||||
packetList->write(methodUtf8);
|
||||
packetList->writeString(method);
|
||||
|
||||
quint16 paramCount = params.length();
|
||||
packetList->writePrimitive(paramCount);
|
||||
|
||||
foreach(const QString& param, params) {
|
||||
auto paramUtf8 = param.toUtf8();
|
||||
quint16 paramLength = paramUtf8.length();
|
||||
packetList->writePrimitive(paramLength);
|
||||
packetList->write(paramUtf8);
|
||||
packetList->writeString(param);
|
||||
}
|
||||
|
||||
nodeList->sendPacketList(std::move(packetList), *entityScriptServer);
|
||||
|
|
Loading…
Reference in a new issue