diff options
author | Matthew Breindel (Falcon) <falcon@lindenlab.com> | 2010-09-30 12:00:29 -0700 |
---|---|---|
committer | Matthew Breindel (Falcon) <falcon@lindenlab.com> | 2010-09-30 12:00:29 -0700 |
commit | 60f8c8279071b791fbc7179d8bc2bb9ca4880a03 (patch) | |
tree | 20a513fdb383dfd36ca0dbe0a99eacd72faad835 /indra/newview/llfeaturemanager.cpp | |
parent | 569f3f4b06fc2f5a0fa658a49d519428983403f9 (diff) | |
parent | d95b08c4a6830fc8a2319e77242d8f76eb4cbdae (diff) |
Merge
Diffstat (limited to 'indra/newview/llfeaturemanager.cpp')
-rw-r--r-- | indra/newview/llfeaturemanager.cpp | 62 |
1 files changed, 55 insertions, 7 deletions
diff --git a/indra/newview/llfeaturemanager.cpp b/indra/newview/llfeaturemanager.cpp index f32fcd6b7f..c8ff95ba77 100644 --- a/indra/newview/llfeaturemanager.cpp +++ b/indra/newview/llfeaturemanager.cpp @@ -73,8 +73,8 @@ const char FEATURE_TABLE_VER_FILENAME[] = "featuretable_linux.%s.txt"; const char FEATURE_TABLE_FILENAME[] = "featuretable_solaris.txt"; const char FEATURE_TABLE_VER_FILENAME[] = "featuretable_solaris.%s.txt"; #else -const char FEATURE_TABLE_FILENAME[] = "featuretable.txt"; -const char FEATURE_TABLE_VER_FILENAME[] = "featuretable.%s.txt"; +const char FEATURE_TABLE_FILENAME[] = "featuretable%s.txt"; +const char FEATURE_TABLE_VER_FILENAME[] = "featuretable%s.%s.txt"; #endif const char GPU_TABLE_FILENAME[] = "gpu_table.txt"; @@ -226,10 +226,30 @@ BOOL LLFeatureManager::loadFeatureTables() // first table is install with app std::string app_path = gDirUtilp->getAppRODataDir(); app_path += gDirUtilp->getDirDelimiter(); - app_path += FEATURE_TABLE_FILENAME; + std::string filename; + std::string http_filename; +#if LL_WINDOWS + std::string os_string = LLAppViewer::instance()->getOSInfo().getOSStringSimple(); + if (os_string.find("Microsoft Windows XP") == 0) + { + filename = llformat(FEATURE_TABLE_FILENAME, "_xp"); + http_filename = llformat(FEATURE_TABLE_VER_FILENAME, "_xp", LLVersionInfo::getVersion().c_str()); + } + else + { + filename = llformat(FEATURE_TABLE_FILENAME, ""); + http_filename = llformat(FEATURE_TABLE_VER_FILENAME, "", LLVersionInfo::getVersion().c_str()); + } +#else + filename = FEATURE_TABLE_FILENAME; + http_filename = llformat(FEATURE_TABLE_VER_FILENAME, LLVersionInfo::getVersion().c_str()); +#endif + + app_path += filename; + + // second table is downloaded with HTTP - std::string http_filename = llformat(FEATURE_TABLE_VER_FILENAME, LLVersionInfo::getVersion().c_str()); std::string http_path = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, http_filename); // use HTTP table if it exists @@ -494,7 +514,35 @@ private: std::string mFilename; }; -void fetch_table(std::string table) +void fetch_feature_table(std::string table) +{ + const std::string base = gSavedSettings.getString("FeatureManagerHTTPTable"); + +#if LL_WINDOWS + std::string os_string = LLAppViewer::instance()->getOSInfo().getOSStringSimple(); + std::string filename; + if (os_string.find("Microsoft Windows XP") == 0) + { + filename = llformat(table.c_str(), "_xp", LLVersionInfo::getVersion().c_str()); + } + else + { + filename = llformat(table.c_str(), "", LLVersionInfo::getVersion().c_str()); + } +#else + const std::string filename = llformat(table.c_str(), LLVersionInfo::getVersion().c_str()); +#endif + + const std::string url = base + "/" + filename; + + const std::string path = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, filename); + + llinfos << "LLFeatureManager fetching " << url << " into " << path << llendl; + + LLHTTPClient::get(url, new LLHTTPFeatureTableResponder(path)); +} + +void fetch_gpu_table(std::string table) { const std::string base = gSavedSettings.getString("FeatureManagerHTTPTable"); @@ -512,8 +560,8 @@ void fetch_table(std::string table) // fetch table(s) from a website (S3) void LLFeatureManager::fetchHTTPTables() { - fetch_table(FEATURE_TABLE_VER_FILENAME); - fetch_table(GPU_TABLE_VER_FILENAME); + fetch_feature_table(FEATURE_TABLE_VER_FILENAME); + fetch_gpu_table(GPU_TABLE_VER_FILENAME); } |