summaryrefslogtreecommitdiff
path: root/src/gui/updaterwindow.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-04-23 18:01:28 +0300
committerAndrei Karas <akaras@inbox.ru>2012-04-23 18:01:28 +0300
commitb9e27e9563e32a17cd80142ce05b5770479cc709 (patch)
tree395086bce491e0b3050bf482b2fe0161a3c3537f /src/gui/updaterwindow.cpp
parenta86324d5fb520823ecb35e828dfeccf9ac2bba81 (diff)
downloadmanaverse-b9e27e9563e32a17cd80142ce05b5770479cc709.tar.gz
manaverse-b9e27e9563e32a17cd80142ce05b5770479cc709.tar.bz2
manaverse-b9e27e9563e32a17cd80142ce05b5770479cc709.tar.xz
manaverse-b9e27e9563e32a17cd80142ce05b5770479cc709.zip
Add support for independent per server updates.
Diffstat (limited to 'src/gui/updaterwindow.cpp')
-rw-r--r--src/gui/updaterwindow.cpp23
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,