diff options
Diffstat (limited to 'indra/newview/llinventorymodel.cpp')
-rw-r--r-- | indra/newview/llinventorymodel.cpp | 167 |
1 files changed, 0 insertions, 167 deletions
diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index c34f14a813..f7aa4d4251 100644 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -2092,173 +2092,6 @@ void LLInventoryModel::registerCallbacks(LLMessageSystem* msg) msg->setHandlerFunc("FetchInventoryReply", processFetchInventoryReply); } -/* -//struct LLUpdateInventoryInfo -{ - LLString mFilenameAndPath; - BOOL mIsComplete; -}; - -// static -void LLInventoryModel::processInventoryUpdate(LLMessageSystem* msg, void**) -{ - lldebugs << "LLInventoryModel::processInventoryUpdate()" << llendl; - LLUUID agent_id; - msg->getUUIDFast(_PREHASH_InventoryData, _PREHASH_AgentID, agent_id); - if(agent_id != gAgent.getID()) - { - llwarns << "Got an inventory update for the wrong agent." << llendl; - return; - } - - BOOL is_complete; - msg->getBOOLFast(_PREHASH_InventoryData, _PREHASH_IsComplete, is_complete); - char filename[MAX_STRING]; - msg->getStringFast(_PREHASH_InventoryData, _PREHASH_Filename, MAX_STRING, filename); - - LLUpdateInventoryInfo* info = new LLUpdateInventoryInfo; - info->mFilenameAndPath = gDirUtilp->getExpandedFilename( LL_PATH_TEMP, filename ); - info->mIsComplete = is_complete; - - gXferManager->requestFile(info->mFilenameAndPath, - filename, - LL_PATH_CACHE, // The remote file is in the data directory - gUserServer, - TRUE, // Delete the remote file after the transfer - processInventoryFile, - (void*)info, - LLXferManager::HIGH_PRIORITY); -} - -// static -void LLInventoryModel::processInventoryFile(void** user_data, S32 error_code) -{ - llinfos << "LLInventoryModel::processInventoryFile()" << llendl; - //gInventory.dumpInventory(); - LLUpdateInventoryInfo* info = (LLUpdateInventoryInfo*)user_data; - if(info && (0 == error_code)) - { - if(info->mIsComplete) - { - if(gInventory.isLoaded()) - { - // it's a complete update, and we've already loaded - // everything. Therefore, we need to blow away - // everything. - gInventory.empty(); - } - else - { - // We want to merge with anything that's happened - // before the load. Therefore, we only want to get rid - // of the root category. - gInventory.deleteObject(gAgent.getInventoryRootID()); - } - } - - // decompress if necessary - const char* filename = info->mFilenameAndPath.c_str(); - const char* ext = filename + strlen(filename) - 6; - char dst_filename[LL_MAX_PATH]; - if(0 == strnicmp(ext, "gz", 2)) - { - // it's a gz file. decmpress it. - dst_filename[0] = '\0'; - strncat(dst_filename, filename, (ext - filename)); - strcat(dst_filename, "tmp"); - BOOL success = gunzip_file(filename, dst_filename); - LLFile::remove(filename); - if(!success) - { - llwarns << "Error loading inventory file. Return code: " << error_code << llendl; - LLNotifyBox::showXml("InventoryNetworkCorruption"); - goto exit; - } - filename = dst_filename; - } - -#ifdef DIFF_INVENTORY_FILES - char agent_id_string[UUID_STR_LENGTH]; - char inventory_filename[LL_MAX_PATH]; - gAgent.getID().toString(agent_id_string); - sprintf(inventory_filename, CACHE_FORMAT_STRING, gDirUtilp->getExpandedFilename(LL_PATH_CACHE,agent_id_string).c_str()); - char buffer[MAX_STRING]; - sprintf(buffer, - "c:/cygwin/bin/diff %s %s", - inventory_filename, - filename); - llinfos << buffer << llendl; - system(buffer); - -#endif - - // load it all up. - gInventory.loadFromFile(filename); - gInventory.buildParentChildMap(); - //gInventory.recalculateCloneInformation(); - gInventory.addChangedMask(LLInventoryObserver::ALL); - if(info->mIsComplete) - { - // Set loaded to true if it's a complete set because it's - // poosible for someone to accept an inventory category - // before they have their complete inventory. If we marked - // it loaded at that point, when the real inventory - // arrived, it would erase (on the client anyway) the - // existence of that inventory. - gInventory.mIsLoaded = TRUE; - - //retrieveIM(gMessageSystem); - llinfos << "complete inventory update" << llendl; - - // If we promised you a message on load, here it is - if (gViewerStats->getStat(LLViewerStats::ST_INVENTORY_TOO_LONG) > 0.0) - { - LLNotifyBox::showXml("InventoryLoaded"); - } - } - else - { - llinfos << "incomplete inventory update" << llendl; - } - gInventory.notifyObservers(); - LLFile::remove(filename); - } - else - { - llwarns << "Eror loading inventory file. Return code: " << error_code - << llendl; - if(error_code == LL_ERR_TCP_TIMEOUT) - { - //llwarns << "Re-requesting inventory" << llendl; - //gInventory.requestFromServer(gAgent.getID()); - } - } - -exit: - delete info; - //gInventory.dumpInventory(); -} - -// static -void LLInventoryModel::processUseCachedInventory(LLMessageSystem* msg, void**) -{ - llinfos << "LLInventoryModel::processUseCachedInventory()" << llendl; - char agent_id_string[UUID_STR_LENGTH]; - gAgent.getID().toString(agent_id_string); - char filename[LL_MAX_PATH]; - sprintf(filename, CACHE_FORMAT_STRING, gDirUtilp->getExpandedFilename(LL_PATH_CACHE,agent_id_string).c_str()); - // We want to merge with anything that's happened before the - // load. Therefore, we only want to get rid of the root category. - gInventory.deleteObject(gAgent.getInventoryRootID()); - gInventory.loadFromFile(filename); - gInventory.buildParentChildMap(); - //gInventory.recalculateCloneInformation(); - gInventory.addChangedMask(LLInventoryObserver::ALL); - gInventory.mIsLoaded = TRUE; - gInventory.notifyObservers(); - //retrieveIM(); -} -*/ // static void LLInventoryModel::processUpdateCreateInventoryItem(LLMessageSystem* msg, void**) |