Showing the changes to assignment-client/src/scripts/EntityScriptServer.cpp (1 of 2 files). Show all
Unified · Split
| @@ -237,20 +237,14 @@ void EntityScriptServer::handleEntityScriptCallMethodPacket(QSharedPointer<Recei · 236 unmodified lines | |||
| 237 | if (_entitiesScriptEngine && _entityViewer.getTree() && !_shuttingDown) { | 237 | if (_entitiesScriptEngine && _entityViewer.getTree() && !_shuttingDown) { |
| 238 | auto entityID = QUuid::fromRfc4122(receivedMessage->read(NUM_BYTES_RFC4122_UUID)); | 238 | auto entityID = QUuid::fromRfc4122(receivedMessage->read(NUM_BYTES_RFC4122_UUID)); |
| 239 | 239 | ||
| 240 | quint16 methodLength; | 240 | auto method = receivedMessage->readString(); |
| 241 | receivedMessage->readPrimitive(&methodLength); | ||
| 242 | auto methodData = receivedMessage->read(methodLength); | ||
| 243 | auto method = QString::fromUtf8(methodData); | ||
| 244 | 241 | ||
| 245 | quint16 paramCount; | 242 | quint16 paramCount; |
| 246 | receivedMessage->readPrimitive(¶mCount); | 243 | receivedMessage->readPrimitive(¶mCount); |
| 247 | 244 | ||
| 248 | QStringList params; | 245 | QStringList params; |
| 249 | for (int param = 0; param < paramCount; param++) { | 246 | for (int param = 0; param < paramCount; param++) { |
| 250 | quint16 paramLength; | 247 | auto paramString = receivedMessage->readString(); |
| 251 | receivedMessage->readPrimitive(¶mLength); | ||
| 252 | auto paramData = receivedMessage->read(paramLength); | ||
| 253 | auto paramString = QString::fromUtf8(paramData); | ||
| 254 | params << paramString; | 248 | params << paramString; |
| 255 | } | 249 | } |
| 256 | 250 | ||