diff options
Diffstat (limited to 'indra')
| -rw-r--r-- | indra/llmessage/llassetstorage.cpp | 2 | ||||
| -rw-r--r-- | indra/llvfs/llvfile.cpp | 16 | ||||
| -rw-r--r-- | indra/llvfs/llvfile.h | 2 | 
3 files changed, 19 insertions, 1 deletions
| diff --git a/indra/llmessage/llassetstorage.cpp b/indra/llmessage/llassetstorage.cpp index d7801b6ddc..56bc1d723a 100644 --- a/indra/llmessage/llassetstorage.cpp +++ b/indra/llmessage/llassetstorage.cpp @@ -443,7 +443,7 @@ void LLAssetStorage::_cleanupRequests(BOOL all, S32 error)  BOOL LLAssetStorage::hasLocalAsset(const LLUUID &uuid, const LLAssetType::EType type)  { -    return mStaticVFS->getExists(uuid, type) || mVFS->getExists(uuid, type); +    return LLVFile::getExists(uuid, type);  }  bool LLAssetStorage::findInStaticVFSAndInvokeCallback(const LLUUID& uuid, LLAssetType::EType type, diff --git a/indra/llvfs/llvfile.cpp b/indra/llvfs/llvfile.cpp index 797b431b93..d05c419d89 100644 --- a/indra/llvfs/llvfile.cpp +++ b/indra/llvfs/llvfile.cpp @@ -124,6 +124,7 @@ const std::string assetTypeToString(LLAssetType::EType at)          { LLAssetType::AT_WIDGET, "WIDGET" },          { LLAssetType::AT_PERSON, "PERSON" },          { LLAssetType::AT_MESH, "MESH" }, +        { LLAssetType::AT_SETTINGS, "SETTINGS" },          { LLAssetType::AT_UNKNOWN, "UNKNOWN" }      }; @@ -154,6 +155,21 @@ const std::string idToFilepath(const std::string id, LLAssetType::EType at)      return filepath;  } +bool LLVFile::getExists(const LLUUID &file_id, const LLAssetType::EType file_type) +{ +	std::string id_str; +	file_id.toString(id_str); +	const std::string filename = idToFilepath(id_str, file_type); + +	std::ifstream file(filename, std::ios::binary); +	if (file.is_open()) +	{ +		file.seekg(0, std::ios::end); +		return file.tellg() > 0; +	} +	return false; +} +  BOOL LLVFile::read(U8 *buffer, S32 bytes, BOOL async, F32 priority)  {      //CP BEGIN diff --git a/indra/llvfs/llvfile.h b/indra/llvfs/llvfile.h index 4aeb9c9630..71dd273404 100644 --- a/indra/llvfs/llvfile.h +++ b/indra/llvfs/llvfile.h @@ -58,6 +58,8 @@ public:  	bool isLocked(EVFSLock lock);  	void waitForLock(EVFSLock lock); + +	static bool getExists(const LLUUID &file_id, const LLAssetType::EType file_type);  	static void initClass(LLVFSThread* vfsthread = NULL);  	static void cleanupClass(); | 
