Fix packet version conflict

This commit is contained in:
Atlante45 2017-08-25 15:31:18 -07:00
parent 8a291f16ff
commit eaa2b9fda8
4 changed files with 5 additions and 10 deletions

View file

@ -516,7 +516,7 @@ void AssetServer::handleGetAllMappingOperation(ReceivedMessage& message, SharedN
for (auto it = _fileMappings.cbegin(); it != _fileMappings.cend(); ++ it) {
replyPacket.writeString(it.key());
replyPacket.write(QByteArray::fromHex(it.value().toString().toUtf8()));
replyPacket.writePrimitive(getAssetStatus(it.value().toString()));
replyPacket.writePrimitive(getAssetStatus(it.key(), it.value().toString()));
}
}
@ -1157,7 +1157,7 @@ bool AssetServer::createMetaFile(AssetHash originalAssetHash) {
}
}
void AssetServer::setBakingEnabled(const AssetPathList& paths, bool enabled) {
bool AssetServer::setBakingEnabled(const AssetPathList& paths, bool enabled) {
for (const auto& path : paths) {
auto it = _fileMappings.find(path);
if (it != _fileMappings.end()) {
@ -1189,4 +1189,5 @@ void AssetServer::setBakingEnabled(const AssetPathList& paths, bool enabled) {
}
}
}
return true;
}

View file

@ -82,7 +82,7 @@ private:
/// Rename mapping from `oldPath` to `newPath`. Returns true if successful
bool renameMapping(AssetPath oldPath, AssetPath newPath);
void setBakingEnabled(const AssetPathList& paths, bool enabled);
bool setBakingEnabled(const AssetPathList& paths, bool enabled);
/// Delete any unmapped files from the local asset directory
void cleanupUnmappedFiles();

View file

@ -42,6 +42,7 @@ PacketVersion versionForPacketType(PacketType packetType) {
return static_cast<PacketVersion>(MessageDataVersion::TextOrBinaryData);
case PacketType::ICEServerHeartbeat:
return 18; // ICE Server Heartbeat signing
case PacketType::AssetMappingOperation:
case PacketType::AssetMappingOperationReply:
return static_cast<PacketVersion>(AssetServerPacketVersion::RedirectedMappings);
case PacketType::AssetGetInfo:
@ -67,9 +68,6 @@ PacketVersion versionForPacketType(PacketType packetType) {
case PacketType::MicrophoneAudioWithEcho:
case PacketType::AudioStreamStats:
return static_cast<PacketVersion>(AudioVersion::HighDynamicRangeVolume);
case PacketType::AssetMappingOperation:
case PacketType::AssetMappingOperationReply:
return static_cast<PacketVersion>(AssetMappingOperationVersion::SetBakingEnabledOperation);
default:
return 17;
}

View file

@ -337,8 +337,4 @@ enum class MessageDataVersion : PacketVersion {
TextOrBinaryData = 18
};
enum class AssetMappingOperationVersion : PacketVersion {
SetBakingEnabledOperation = 18
};
#endif // hifi_PacketHeaders_h