diff options
author | Jacek Antonelli | 2008-08-15 23:45:02 -0500 |
---|---|---|
committer | Jacek Antonelli | 2008-08-15 23:45:02 -0500 |
commit | d644fc64407dcd14ffcee6a0e9fbe28ee3a4e9bd (patch) | |
tree | 7ed0c2c27d717801238a2e6b5749cd5bf88c3059 /linden/indra/newview/llinventorymodel.cpp | |
parent | Second Life viewer sources 1.17.3.0 (diff) | |
download | meta-impy-d644fc64407dcd14ffcee6a0e9fbe28ee3a4e9bd.zip meta-impy-d644fc64407dcd14ffcee6a0e9fbe28ee3a4e9bd.tar.gz meta-impy-d644fc64407dcd14ffcee6a0e9fbe28ee3a4e9bd.tar.bz2 meta-impy-d644fc64407dcd14ffcee6a0e9fbe28ee3a4e9bd.tar.xz |
Second Life viewer sources 1.18.0.6
Diffstat (limited to 'linden/indra/newview/llinventorymodel.cpp')
-rw-r--r-- | linden/indra/newview/llinventorymodel.cpp | 167 |
1 files changed, 0 insertions, 167 deletions
diff --git a/linden/indra/newview/llinventorymodel.cpp b/linden/indra/newview/llinventorymodel.cpp index 8e95156..743b06d 100644 --- a/linden/indra/newview/llinventorymodel.cpp +++ b/linden/indra/newview/llinventorymodel.cpp | |||
@@ -2112,173 +2112,6 @@ void LLInventoryModel::registerCallbacks(LLMessageSystem* msg) | |||
2112 | msg->setHandlerFunc("FetchInventoryReply", processFetchInventoryReply); | 2112 | msg->setHandlerFunc("FetchInventoryReply", processFetchInventoryReply); |
2113 | } | 2113 | } |
2114 | 2114 | ||
2115 | /* | ||
2116 | //struct LLUpdateInventoryInfo | ||
2117 | { | ||
2118 | LLString mFilenameAndPath; | ||
2119 | BOOL mIsComplete; | ||
2120 | }; | ||
2121 | |||
2122 | // static | ||
2123 | void LLInventoryModel::processInventoryUpdate(LLMessageSystem* msg, void**) | ||
2124 | { | ||
2125 | lldebugs << "LLInventoryModel::processInventoryUpdate()" << llendl; | ||
2126 | LLUUID agent_id; | ||
2127 | msg->getUUIDFast(_PREHASH_InventoryData, _PREHASH_AgentID, agent_id); | ||
2128 | if(agent_id != gAgent.getID()) | ||
2129 | { | ||
2130 | llwarns << "Got an inventory update for the wrong agent." << llendl; | ||
2131 | return; | ||
2132 | } | ||
2133 | |||
2134 | BOOL is_complete; | ||
2135 | msg->getBOOLFast(_PREHASH_InventoryData, _PREHASH_IsComplete, is_complete); | ||
2136 | char filename[MAX_STRING]; | ||
2137 | msg->getStringFast(_PREHASH_InventoryData, _PREHASH_Filename, MAX_STRING, filename); | ||
2138 | |||
2139 | LLUpdateInventoryInfo* info = new LLUpdateInventoryInfo; | ||
2140 | info->mFilenameAndPath = gDirUtilp->getExpandedFilename( LL_PATH_TEMP, filename ); | ||
2141 | info->mIsComplete = is_complete; | ||
2142 | |||
2143 | gXferManager->requestFile(info->mFilenameAndPath, | ||
2144 | filename, | ||
2145 | LL_PATH_CACHE, // The remote file is in the data directory | ||
2146 | gUserServer, | ||
2147 | TRUE, // Delete the remote file after the transfer | ||
2148 | processInventoryFile, | ||
2149 | (void*)info, | ||
2150 | LLXferManager::HIGH_PRIORITY); | ||
2151 | } | ||
2152 | |||
2153 | // static | ||
2154 | void LLInventoryModel::processInventoryFile(void** user_data, S32 error_code) | ||
2155 | { | ||
2156 | llinfos << "LLInventoryModel::processInventoryFile()" << llendl; | ||
2157 | //gInventory.dumpInventory(); | ||
2158 | LLUpdateInventoryInfo* info = (LLUpdateInventoryInfo*)user_data; | ||
2159 | if(info && (0 == error_code)) | ||
2160 | { | ||
2161 | if(info->mIsComplete) | ||
2162 | { | ||
2163 | if(gInventory.isLoaded()) | ||
2164 | { | ||
2165 | // it's a complete update, and we've already loaded | ||
2166 | // everything. Therefore, we need to blow away | ||
2167 | // everything. | ||
2168 | gInventory.empty(); | ||
2169 | } | ||
2170 | else | ||
2171 | { | ||
2172 | // We want to merge with anything that's happened | ||
2173 | // before the load. Therefore, we only want to get rid | ||
2174 | // of the root category. | ||
2175 | gInventory.deleteObject(gAgent.getInventoryRootID()); | ||
2176 | } | ||
2177 | } | ||
2178 | |||
2179 | // decompress if necessary | ||
2180 | const char* filename = info->mFilenameAndPath.c_str(); | ||
2181 | const char* ext = filename + strlen(filename) - 6; | ||
2182 | char dst_filename[LL_MAX_PATH]; | ||
2183 | if(0 == strnicmp(ext, "gz", 2)) | ||
2184 | { | ||
2185 | // it's a gz file. decmpress it. | ||
2186 | dst_filename[0] = '\0'; | ||
2187 | strncat(dst_filename, filename, (ext - filename)); | ||
2188 | strcat(dst_filename, "tmp"); | ||
2189 | BOOL success = gunzip_file(filename, dst_filename); | ||
2190 | LLFile::remove(filename); | ||
2191 | if(!success) | ||
2192 | { | ||
2193 | llwarns << "Error loading inventory file. Return code: " << error_code << llendl; | ||
2194 | LLNotifyBox::showXml("InventoryNetworkCorruption"); | ||
2195 | goto exit; | ||
2196 | } | ||
2197 | filename = dst_filename; | ||
2198 | } | ||
2199 | |||
2200 | #ifdef DIFF_INVENTORY_FILES | ||
2201 | char agent_id_string[UUID_STR_LENGTH]; | ||
2202 | char inventory_filename[LL_MAX_PATH]; | ||
2203 | gAgent.getID().toString(agent_id_string); | ||
2204 | sprintf(inventory_filename, CACHE_FORMAT_STRING, gDirUtilp->getExpandedFilename(LL_PATH_CACHE,agent_id_string).c_str()); | ||
2205 | char buffer[MAX_STRING]; | ||
2206 | sprintf(buffer, | ||
2207 | "c:/cygwin/bin/diff %s %s", | ||
2208 | inventory_filename, | ||
2209 | filename); | ||
2210 | llinfos << buffer << llendl; | ||
2211 | system(buffer); | ||
2212 | |||
2213 | #endif | ||
2214 | |||
2215 | // load it all up. | ||
2216 | gInventory.loadFromFile(filename); | ||
2217 | gInventory.buildParentChildMap(); | ||
2218 | //gInventory.recalculateCloneInformation(); | ||
2219 | gInventory.addChangedMask(LLInventoryObserver::ALL); | ||
2220 | if(info->mIsComplete) | ||
2221 | { | ||
2222 | // Set loaded to true if it's a complete set because it's | ||
2223 | // poosible for someone to accept an inventory category | ||
2224 | // before they have their complete inventory. If we marked | ||
2225 | // it loaded at that point, when the real inventory | ||
2226 | // arrived, it would erase (on the client anyway) the | ||
2227 | // existence of that inventory. | ||
2228 | gInventory.mIsLoaded = TRUE; | ||
2229 | |||
2230 | //retrieveIM(gMessageSystem); | ||
2231 | llinfos << "complete inventory update" << llendl; | ||
2232 | |||
2233 | // If we promised you a message on load, here it is | ||
2234 | if (gViewerStats->getStat(LLViewerStats::ST_INVENTORY_TOO_LONG) > 0.0) | ||
2235 | { | ||
2236 | LLNotifyBox::showXml("InventoryLoaded"); | ||
2237 | } | ||
2238 | } | ||
2239 | else | ||
2240 | { | ||
2241 | llinfos << "incomplete inventory update" << llendl; | ||
2242 | } | ||
2243 | gInventory.notifyObservers(); | ||
2244 | LLFile::remove(filename); | ||
2245 | } | ||
2246 | else | ||
2247 | { | ||
2248 | llwarns << "Eror loading inventory file. Return code: " << error_code | ||
2249 | << llendl; | ||
2250 | if(error_code == LL_ERR_TCP_TIMEOUT) | ||
2251 | { | ||
2252 | //llwarns << "Re-requesting inventory" << llendl; | ||
2253 | //gInventory.requestFromServer(gAgent.getID()); | ||
2254 | } | ||
2255 | } | ||
2256 | |||
2257 | exit: | ||
2258 | delete info; | ||
2259 | //gInventory.dumpInventory(); | ||
2260 | } | ||
2261 | |||
2262 | // static | ||
2263 | void LLInventoryModel::processUseCachedInventory(LLMessageSystem* msg, void**) | ||
2264 | { | ||
2265 | llinfos << "LLInventoryModel::processUseCachedInventory()" << llendl; | ||
2266 | char agent_id_string[UUID_STR_LENGTH]; | ||
2267 | gAgent.getID().toString(agent_id_string); | ||
2268 | char filename[LL_MAX_PATH]; | ||
2269 | sprintf(filename, CACHE_FORMAT_STRING, gDirUtilp->getExpandedFilename(LL_PATH_CACHE,agent_id_string).c_str()); | ||
2270 | // We want to merge with anything that's happened before the | ||
2271 | // load. Therefore, we only want to get rid of the root category. | ||
2272 | gInventory.deleteObject(gAgent.getInventoryRootID()); | ||
2273 | gInventory.loadFromFile(filename); | ||
2274 | gInventory.buildParentChildMap(); | ||
2275 | //gInventory.recalculateCloneInformation(); | ||
2276 | gInventory.addChangedMask(LLInventoryObserver::ALL); | ||
2277 | gInventory.mIsLoaded = TRUE; | ||
2278 | gInventory.notifyObservers(); | ||
2279 | //retrieveIM(); | ||
2280 | } | ||
2281 | */ | ||
2282 | 2115 | ||
2283 | // static | 2116 | // static |
2284 | void LLInventoryModel::processUpdateCreateInventoryItem(LLMessageSystem* msg, void**) | 2117 | void LLInventoryModel::processUpdateCreateInventoryItem(LLMessageSystem* msg, void**) |