mirror of
https://github.com/overte-org/overte.git
synced 2025-04-25 00:56:48 +02:00
move handling of get all operation to sep method
This commit is contained in:
parent
bfb9801b22
commit
063826638e
2 changed files with 15 additions and 7 deletions
|
@ -190,13 +190,7 @@ void AssetServer::handleAssetMappingOperation(QSharedPointer<ReceivedMessage> me
|
|||
break;
|
||||
}
|
||||
case AssetMappingOperationType::GetAll: {
|
||||
replyPacket->writePrimitive(AssetServerError::NoError);
|
||||
auto count = _fileMappings.size();
|
||||
replyPacket->writePrimitive(count);
|
||||
for (auto it = _fileMappings.cbegin(); it != _fileMappings.cend(); ++ it) {
|
||||
replyPacket->writeString(it.key());
|
||||
replyPacket->write(QByteArray::fromHex(it.value().toString().toLocal8Bit()));
|
||||
}
|
||||
handleGetAllMappingOperation(*message, senderNode, *replyPacket);
|
||||
break;
|
||||
}
|
||||
case AssetMappingOperationType::Set: {
|
||||
|
@ -229,6 +223,19 @@ void AssetServer::handleGetMappingOperation(ReceivedMessage& message, SharedNode
|
|||
}
|
||||
}
|
||||
|
||||
void AssetServer::handleGetAllMappingOperation(ReceivedMessage& message, SharedNodePointer senderNode, NLPacketList& replyPacket) {
|
||||
replyPacket.writePrimitive(AssetServerError::NoError);
|
||||
|
||||
auto count = _fileMappings.size();
|
||||
|
||||
replyPacket.writePrimitive(count);
|
||||
|
||||
for (auto it = _fileMappings.cbegin(); it != _fileMappings.cend(); ++ it) {
|
||||
replyPacket.writeString(it.key());
|
||||
replyPacket.write(QByteArray::fromHex(it.value().toString().toUtf8()));
|
||||
}
|
||||
}
|
||||
|
||||
void AssetServer::handleSetMappingOperation(ReceivedMessage& message, SharedNodePointer senderNode, NLPacketList& replyPacket) {
|
||||
if (senderNode->getCanRez()) {
|
||||
QString assetPath = message.readString();
|
||||
|
|
|
@ -42,6 +42,7 @@ private:
|
|||
using Mappings = QVariantHash;
|
||||
|
||||
void handleGetMappingOperation(ReceivedMessage& message, SharedNodePointer senderNode, NLPacketList& replyPacket);
|
||||
void handleGetAllMappingOperation(ReceivedMessage& message, SharedNodePointer senderNode, NLPacketList& replyPacket);
|
||||
void handleSetMappingOperation(ReceivedMessage& message, SharedNodePointer senderNode, NLPacketList& replyPacket);
|
||||
void handleDeleteMappingOperation(ReceivedMessage& message, SharedNodePointer senderNode, NLPacketList& replyPacket);
|
||||
|
||||
|
|
Loading…
Reference in a new issue