diff options
author | Andrei Karas <akaras@inbox.ru> | 2012-04-23 18:01:28 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2012-04-23 18:01:28 +0300 |
commit | b9e27e9563e32a17cd80142ce05b5770479cc709 (patch) | |
tree | 395086bce491e0b3050bf482b2fe0161a3c3537f /src/gui/updaterwindow.cpp | |
parent | a86324d5fb520823ecb35e828dfeccf9ac2bba81 (diff) | |
download | mv-b9e27e9563e32a17cd80142ce05b5770479cc709.tar.gz mv-b9e27e9563e32a17cd80142ce05b5770479cc709.tar.bz2 mv-b9e27e9563e32a17cd80142ce05b5770479cc709.tar.xz mv-b9e27e9563e32a17cd80142ce05b5770479cc709.zip |
Add support for independent per server updates.
Diffstat (limited to 'src/gui/updaterwindow.cpp')
-rw-r--r-- | src/gui/updaterwindow.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/gui/updaterwindow.cpp b/src/gui/updaterwindow.cpp index a1c625c32..eb2fe2f82 100644 --- a/src/gui/updaterwindow.cpp +++ b/src/gui/updaterwindow.cpp @@ -522,6 +522,7 @@ void UpdaterWindow::loadUpdates() UpdaterWindow::addUpdateFile(resman, mUpdatesDir, fixPath, mUpdateFiles[mUpdateIndex].name, false); } + loadManaPlusUpdates(mUpdatesDir, resman); } void UpdaterWindow::loadLocalUpdates(std::string dir) @@ -546,6 +547,28 @@ void UpdaterWindow::loadLocalUpdates(std::string dir) UpdaterWindow::addUpdateFile(resman, dir, fixPath, updateFiles[updateIndex].name, false); } + loadManaPlusUpdates(dir, resman); +} + +void UpdaterWindow::loadManaPlusUpdates(std::string dir, + ResourceManager *resman) +{ + std::string fixPath = dir + "/fix"; + std::vector<updateFile> updateFiles + = loadXMLFile(fixPath + "/" + xmlUpdateFile); + + for (unsigned int updateIndex = 0; + updateIndex < updateFiles.size(); updateIndex ++) + { + std::string name = updateFiles[updateIndex].name; + if (strStartWith(name, "manaplus_")) + { + struct stat statbuf; + std::string file = fixPath + "/" + name; + if (!stat(file.c_str(), &statbuf)) + resman->addToSearchPath(file, false); + } + } } void UpdaterWindow::addUpdateFile(ResourceManager *resman, std::string path, |