summaryrefslogtreecommitdiff
path: root/indra/newview/llappviewer.cpp
diff options
context:
space:
mode:
authorBrad Payne (Vir Linden) <vir@lindenlab.com>2010-05-18 21:06:45 -0400
committerBrad Payne (Vir Linden) <vir@lindenlab.com>2010-05-18 21:06:45 -0400
commite319e13a9759e758791d0aecab7f7b72d58a9a7b (patch)
tree3dda5f7541f918d02b751db253f6564bee29ee9a /indra/newview/llappviewer.cpp
parent6eeb8f8e97ae79f029f182235aee74324b85d967 (diff)
EXT-6953 WIP - cache dumping option to help with updating static vfs cache with new contents
Diffstat (limited to 'indra/newview/llappviewer.cpp')
-rw-r--r--indra/newview/llappviewer.cpp46
1 files changed, 41 insertions, 5 deletions
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index 82b6f1286f..d7632e69e8 100644
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -2979,6 +2979,42 @@ S32 LLAppViewer::getCacheVersion()
return cache_version ;
}
+void dumpVFSCaches()
+{
+ llinfos << "======= Dumping Static VFS ========" << llendl;
+ gStaticVFS->listFiles();
+#if LL_WINDOWS
+ WCHAR w_str[MAX_PATH];
+ GetCurrentDirectory(MAX_PATH, w_str);
+ S32 res = LLFile::mkdir("StaticVFSDump");
+ if (res == -1)
+ {
+ if (errno != EEXIST)
+ {
+ llwarns << "Couldn't create StaticVFSDump" << llendl;
+ }
+ }
+ SetCurrentDirectory(utf8str_to_utf16str("StaticVFSDump").c_str());
+ gStaticVFS->dumpFiles();
+ SetCurrentDirectory(w_str);
+#endif
+
+ llinfos << "========= Dumping regular VFS ====" << llendl;
+ gVFS->listFiles();
+#if LL_WINDOWS
+ res = LLFile::mkdir("VFSDump");
+ if (res == -1)
+ {
+ if (errno != EEXIST)
+ {
+ llwarns << "Couldn't create VFSDump" << llendl;
+ }
+ }
+ SetCurrentDirectory(utf8str_to_utf16str("VFSDump").c_str());
+ gVFS->dumpFiles();
+ SetCurrentDirectory(w_str);
+#endif
+}
bool LLAppViewer::initCache()
{
mPurgeCache = false;
@@ -3196,11 +3232,11 @@ bool LLAppViewer::initCache()
{
LLVFile::initClass();
- //llinfos << "======= Static VFS listing ========" << llendl;
- //gStaticVFS->listFiles();
-
- //llinfos << "========= regular VFS listing =====" << llendl;
- //gVFS->listFiles();
+ if (gSavedSettings.getBOOL("DumpVFSCaches"))
+ {
+ dumpVFSCaches();
+
+ }
return true;
}