remove debug, fix asset find bug for incorrect folder

This commit is contained in:
Stephen Birarda 2016-03-09 14:24:35 -08:00
parent 96ba57a946
commit e2b976d9f1

View file

@ -220,12 +220,10 @@ void AssetServer::handleGetMappingOperation(ReceivedMessage& message, SharedNode
auto it = _fileMappings.find(assetPath); auto it = _fileMappings.find(assetPath);
if (it != _fileMappings.end()) { if (it != _fileMappings.end()) {
auto assetHash = it->toString(); auto assetHash = it->toString();
qDebug() << "Found mapping for: " << assetPath << "=>" << assetHash;
replyPacket.writePrimitive(AssetServerError::NoError); replyPacket.writePrimitive(AssetServerError::NoError);
replyPacket.write(QByteArray::fromHex(assetHash.toUtf8())); replyPacket.write(QByteArray::fromHex(assetHash.toUtf8()));
} }
else { else {
qDebug() << "Mapping not found for: " << assetPath;
replyPacket.writePrimitive(AssetServerError::AssetNotFound); replyPacket.writePrimitive(AssetServerError::AssetNotFound);
} }
} }
@ -314,7 +312,7 @@ void AssetServer::handleAssetGetInfo(QSharedPointer<ReceivedMessage> message, Sh
replyPacket->write(assetHash); replyPacket->write(assetHash);
QString fileName = QString(hexHash); QString fileName = QString(hexHash);
QFileInfo fileInfo { _resourcesDirectory.filePath(fileName) }; QFileInfo fileInfo { _filesDirectory.filePath(fileName) };
if (fileInfo.exists() && fileInfo.isReadable()) { if (fileInfo.exists() && fileInfo.isReadable()) {
qDebug() << "Opening file: " << fileInfo.filePath(); qDebug() << "Opening file: " << fileInfo.filePath();