From 9e076e849643a8decd8125ad3576a31c806206c4 Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Sat, 10 Feb 2024 10:28:18 -0300 Subject: Get rid of manaverse-owned updates. (Coverage warning!) This leaves some dead corpses behind, cleanup after is advised. Reverts b9e27e9563e32a17cd80142ce05b5770479cc709 For short, the client should not be keeping an override on what server shows. This function (backdoor) also don't exist on Mana client. --- src/gui/windows/updaterwindow.cpp | 73 ++------------------------------------- 1 file changed, 3 insertions(+), 70 deletions(-) (limited to 'src/gui/windows/updaterwindow.cpp') diff --git a/src/gui/windows/updaterwindow.cpp b/src/gui/windows/updaterwindow.cpp index 15773e3d4..283df5ecf 100644 --- a/src/gui/windows/updaterwindow.cpp +++ b/src/gui/windows/updaterwindow.cpp @@ -680,7 +680,6 @@ void UpdaterWindow::loadUpdates() file.name, Append_false); } - loadManaPlusUpdates(mUpdatesDir); loadMods(mUpdatesDir, mUpdateFiles); } @@ -713,7 +712,6 @@ void UpdaterWindow::loadLocalUpdates(const std::string &dir) file.name, Append_false); } - loadManaPlusUpdates(dir); loadMods(dir, updateFiles); } @@ -728,72 +726,6 @@ void UpdaterWindow::unloadUpdates(const std::string &dir) updateFiles = loadTxtFile(pathJoin(dir, txtUpdateFile)); } - - const std::string fixPath = dir + "/fix"; - for (unsigned int updateIndex = 0, - fsz = CAST_U32(updateFiles.size()); - updateIndex < fsz; - updateIndex++) - { - UpdaterWindow::removeUpdateFile(dir, - fixPath, - updateFiles[updateIndex].name); - } - unloadManaPlusUpdates(dir); -} - -void UpdaterWindow::loadManaPlusUpdates(const std::string &dir) -{ - std::string fixPath = dir + "/fix"; - STD_VECTOR updateFiles = loadXMLFile( - pathJoin(fixPath, xmlUpdateFile), - false); - - for (unsigned int updateIndex = 0, - fsz = CAST_U32(updateFiles.size()); - updateIndex < fsz; - updateIndex++) - { - const UpdateFile &file = updateFiles[updateIndex]; - if (!file.group.empty()) - continue; - const std::string name = file.name; - if (strStartWith(name, "manaplus_")) - { - struct stat statbuf; - std::string fileName = pathJoin(fixPath, - name); - if (stat(fileName.c_str(), &statbuf) == 0) - { - VirtFs::mountZip(fileName, - Append_false); - } - } - } -} - -void UpdaterWindow::unloadManaPlusUpdates(const std::string &dir) -{ - const std::string fixPath = dir + "/fix"; - const STD_VECTOR updateFiles = loadXMLFile( - pathJoin(fixPath, xmlUpdateFile), - true); - - for (unsigned int updateIndex = 0, - fsz = CAST_U32(updateFiles.size()); - updateIndex < fsz; - updateIndex++) - { - std::string name = updateFiles[updateIndex].name; - if (strStartWith(name, "manaplus_")) - { - struct stat statbuf; - const std::string file = pathJoin( - fixPath, name); - if (stat(file.c_str(), &statbuf) == 0) - VirtFs::unmountZip(file); - } - } } void UpdaterWindow::addUpdateFile(const std::string &restrict path, @@ -900,8 +832,9 @@ void UpdaterWindow::logic() mCurrentFile = xmlUpdateFile; mValidateXml = true; mStoreInMemory = false; - mDownloadStatus = UpdateDownloadStatus::UPDATE_LIST2; - download(); + mDownloadStatus = UpdateDownloadStatus::UPDATE_COMPLETE; + //mDownloadStatus = UpdateDownloadStatus::UPDATE_LIST2; + //download(); } break; -- cgit v1.2.3-70-g09d2