diff options
author | callum_linden <none@none> | 2015-06-30 11:51:58 -0700 |
---|---|---|
committer | callum_linden <none@none> | 2015-06-30 11:51:58 -0700 |
commit | 8eb7e9d9522f598321e1f8cba5ab8166a52c5bcb (patch) | |
tree | e24f1b1735f17968410704e56d0e043fb143aafe /indra/newview/llappviewer.cpp | |
parent | f7908a50294adff3456436074075a677a9c6239b (diff) | |
parent | 4aa64b99dbe6cafdccf0c25501feaef5ba3445c4 (diff) |
Merge with head of viewer-release
Diffstat (limited to 'indra/newview/llappviewer.cpp')
-rwxr-xr-x | indra/newview/llappviewer.cpp | 46 |
1 files changed, 45 insertions, 1 deletions
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index d2b9259ef7..403f704c78 100755 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -105,6 +105,7 @@ // Linden library includes #include "llavatarnamecache.h" #include "lldiriterator.h" +#include "llexperiencecache.h" #include "llimagej2c.h" #include "llmemory.h" #include "llprimitive.h" @@ -4697,6 +4698,32 @@ void LLAppViewer::saveNameCache() } } + +void LLAppViewer::saveExperienceCache() +{ + std::string filename = + gDirUtilp->getExpandedFilename(LL_PATH_CACHE, "experience_cache.xml"); + LL_INFOS("ExperienceCache") << "Saving " << filename << LL_ENDL; + llofstream cache_stream(filename.c_str()); + if(cache_stream.is_open()) + { + LLExperienceCache::exportFile(cache_stream); + } +} + +void LLAppViewer::loadExperienceCache() +{ + std::string filename = + gDirUtilp->getExpandedFilename(LL_PATH_CACHE, "experience_cache.xml"); + LL_INFOS("ExperienceCache") << "Loading " << filename << LL_ENDL; + llifstream cache_stream(filename.c_str()); + if(cache_stream.is_open()) + { + LLExperienceCache::importFile(cache_stream); + } +} + + /*! @brief This class is an LLFrameTimer that can be created with an elapsed time that starts counting up from the given value rather than 0.0. @@ -4892,7 +4919,7 @@ void LLAppViewer::idle() // floating throughout the various object lists. // idleNameCache(); - + idleExperienceCache(); idleNetwork(); @@ -5322,6 +5349,22 @@ void LLAppViewer::idleNameCache() LLAvatarNameCache::idle(); } +void LLAppViewer::idleExperienceCache() +{ + LLViewerRegion* region = gAgent.getRegion(); + if (!region) return; + + std::string lookup_url=region->getCapability("GetExperienceInfo"); + if(!lookup_url.empty() && *lookup_url.rbegin() != '/') + { + lookup_url += '/'; + } + + LLExperienceCache::setLookupURL(lookup_url); + + LLExperienceCache::idle(); +} + // // Handle messages, and all message related stuff // @@ -5484,6 +5527,7 @@ void LLAppViewer::disconnectViewer() } saveNameCache(); + saveExperienceCache(); // close inventory interface, close all windows LLFloaterInventory::cleanup(); |