|
@@ -96,7 +96,7 @@ void PatchInstaller::installPatch(QString patch_name, LOTRO_DAT::Database* datab
|
|
|
DatOriginalFilesDatabase orig_files_db(database_path);
|
|
|
LOTRO_DAT::SubfileData file;
|
|
|
qDebug() << "Total files in database " << database->CountRows();
|
|
|
- qDebug() << "Patching all files from database..." << database;
|
|
|
+ qInfo() << "Patching all files from database..." << database_path;
|
|
|
while (!(file = database->GetNextFile()).Empty()) {
|
|
|
if (!file.options["fid"]) {
|
|
|
continue;
|
|
@@ -166,22 +166,22 @@ void PatchInstaller::installPatch(QString patch_name, LOTRO_DAT::Database* datab
|
|
|
_current_applied_patches_info.textures_patch_hashsum = hashsum;
|
|
|
}
|
|
|
orig_files_db.closeDatabase();
|
|
|
+ insertPatchesInfoInDatFile(_current_applied_patches_info);
|
|
|
+
|
|
|
if (patch_name == "video") {
|
|
|
installVideos(database);
|
|
|
}
|
|
|
|
|
|
if (patch_name == "loadscreen") {
|
|
|
installLoadscreens(database);
|
|
|
- return;
|
|
|
}
|
|
|
|
|
|
- insertPatchesInfoInDatFile(_current_applied_patches_info);
|
|
|
- return;
|
|
|
+ qInfo() << "Successfully installed patch " << patch_name;
|
|
|
}
|
|
|
|
|
|
void PatchInstaller::installOriginalPatch(QString patch_name)
|
|
|
{
|
|
|
- qDebug() << "Installing original version of patch " << patch_name;
|
|
|
+ qInfo() << "PatchInstaller: Installing original version of patch " << patch_name;
|
|
|
const QString locale_prefix = Settings::getValue("Lotro/original_locale").toString();
|
|
|
const QString database_path = QApplication::applicationDirPath() + "/data/" + patch_name + "_" + locale_prefix + "_orig.db";
|
|
|
const QString database_path_old = QApplication::applicationDirPath() + "/data/" + patch_name + "_orig.db";
|
|
@@ -235,6 +235,8 @@ void PatchInstaller::installOriginalPatch(QString patch_name)
|
|
|
_current_applied_patches_info.loadscreens_patch_hashsum = "";
|
|
|
}
|
|
|
insertPatchesInfoInDatFile(_current_applied_patches_info);
|
|
|
+
|
|
|
+ qInfo() << "Successfully installed original version of patch" << patch_name;
|
|
|
}
|
|
|
|
|
|
void PatchInstaller::installLoadscreens(LOTRO_DAT::Database* database) {
|
|
@@ -284,6 +286,7 @@ void PatchInstaller::installLoadscreens(LOTRO_DAT::Database* database) {
|
|
|
}
|
|
|
|
|
|
void PatchInstaller::installVideos(LOTRO_DAT::Database* database) {
|
|
|
+ qInfo() << "PatchInstaller: Starting downloading videos";
|
|
|
current_status.finished_parts += database->CountRows();
|
|
|
emit progressChanged(current_status);
|
|
|
|
|
@@ -303,9 +306,11 @@ void PatchInstaller::installVideos(LOTRO_DAT::Database* database) {
|
|
|
|
|
|
const QString full_filename = Settings::getValue("Lotro/game_path").toString() + "/" + folder + "/" + filename;
|
|
|
|
|
|
+ qInfo() << "PatchInstaller::installVideos: Processing file " << filename << " with patch hash " << hash;
|
|
|
FileSystem::createFilePath(full_filename);
|
|
|
if (FileSystem::fileExists(full_filename) && FileSystem::fileHash(full_filename) == hash) {
|
|
|
download_video_finished_videos++;
|
|
|
+ qInfo() << "PatchInstaller::installVideos: File " << filename << " hash matches patch, skipping download";
|
|
|
continue;
|
|
|
}
|
|
|
|
|
@@ -316,19 +321,21 @@ void PatchInstaller::installVideos(LOTRO_DAT::Database* database) {
|
|
|
connect(video_downloader, &Downloader::progressChanged, this, &PatchInstaller::onDownloaderProgressChanged);
|
|
|
video_downloader->setUrl(url);
|
|
|
video_downloader->targetFile = target_file;
|
|
|
+ qInfo() << "PatchInstaller::installVideos: Starting download of file " << filename;
|
|
|
video_downloader->start();
|
|
|
video_downloader->waitForDownloaded();
|
|
|
video_downloader->targetFile->close();
|
|
|
video_downloader->targetFile->deleteLater();
|
|
|
video_downloader->targetFile = nullptr;
|
|
|
video_downloader->deleteLater();
|
|
|
-
|
|
|
+ qInfo() << "PatchInstaller::installVideos: Finished download of file " << filename;
|
|
|
download_video_finished_videos++;
|
|
|
}
|
|
|
|
|
|
_current_applied_patches_info.has_no_patch_mark = false;
|
|
|
_current_applied_patches_info.videos_patch_hashsum = Settings::getValue("PatchDatabases/video/hashsum").toString();
|
|
|
insertPatchesInfoInDatFile(_current_applied_patches_info);
|
|
|
+ qInfo() << "PatchInstaller: finished downloading videos";
|
|
|
}
|
|
|
|
|
|
PatchInstaller::AppliedPatchesInfo PatchInstaller::getAppliedPatchesInfoFromDatFile() {
|
|
@@ -408,7 +415,7 @@ void PatchInstaller::init()
|
|
|
// Firstly - deinitializing existing client_local files.
|
|
|
deinit();
|
|
|
}
|
|
|
- qDebug() << __FUNCTION__ << "Starting initialisation of LotroDatManager";
|
|
|
+ qInfo() << "PatchInstaller: Starting initialisation of LotroDatManager";
|
|
|
qRegisterMetaType<PatchInstaller::Status>();
|
|
|
|
|
|
QString game_folder = Settings::getValue("Lotro/game_path").toString();
|
|
@@ -419,24 +426,10 @@ void PatchInstaller::init()
|
|
|
|
|
|
// Initialising client_local_*.dat file and client_general.dat
|
|
|
|
|
|
- auto client_local_init_res = client_local_file_->Init(client_local_filepath.toStdString());
|
|
|
- auto client_general_init_res = client_general_file_->Init(client_general_filepath.toStdString());
|
|
|
-
|
|
|
- if (!client_local_init_res || !client_general_init_res) {
|
|
|
- client_local_file_->Deinit();
|
|
|
- client_general_file_->Deinit();
|
|
|
-
|
|
|
- qCritical() << __FUNCTION__ << "Finished LotroDatManager initialisation - error: DatFile initialisation error!";
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
- // Initializing db for original files backup
|
|
|
- QString database_path = game_folder + "/LotroLegacy/orig_files.db";
|
|
|
- if (!FileSystem::fileExists(database_path)) {
|
|
|
- FileSystem::createFilePath(database_path);
|
|
|
- }
|
|
|
+ client_local_file_->Init(client_local_filepath.toStdString());
|
|
|
+ client_general_file_->Init(client_general_filepath.toStdString());
|
|
|
|
|
|
- qDebug() << "LotroDatManager initialisation successfull! Dat files: "
|
|
|
+ qInfo() << "PatchInstaller: initialisation successfull! Dat files: "
|
|
|
<< QString::fromStdString(client_general_file_->GetFilename())
|
|
|
<< QString::fromStdString(client_local_file_->GetFilename());
|
|
|
|
|
@@ -484,7 +477,7 @@ void PatchInstaller::startGame(bool remove_dat_files) {
|
|
|
args << "-username" << username << "-password" << password;
|
|
|
}
|
|
|
|
|
|
- qDebug() << __FUNCTION__ << "Starting game with arguments: " << args;
|
|
|
+ qInfo() << "Starting LOTRO. Path =" << game_folder;
|
|
|
|
|
|
deinit();
|
|
|
|
|
@@ -529,22 +522,22 @@ void PatchInstaller::startPatchInstallationChain(bool force_reinstall_patches) {
|
|
|
}
|
|
|
|
|
|
if (!force_reinstall_patches && patch_hashsum == hashsum_in_dat_file) {
|
|
|
- qDebug() << "Skipping patch " << patch << " because its hashsum (" << patch_hashsum << ") is equal to hashsum in dat file (" << hashsum_in_dat_file << ")";
|
|
|
+ qInfo() << "PatchInstaller: Skipping patch " << patch << " because its hashsum (" << patch_hashsum << ") is equal to hashsum in dat file (" << hashsum_in_dat_file << ")";
|
|
|
continue;
|
|
|
}
|
|
|
if (force_reinstall_patches) {
|
|
|
- qDebug() << "Forcelly installing patch " << patch << ". Its hashsum (" << patch_hashsum << "). Hashsum in dat file (" << hashsum_in_dat_file << ")";
|
|
|
+ qInfo() << "PatchInstaller: Force installing patch " << patch << ". Its hashsum (" << patch_hashsum << "). Hashsum in dat file (" << hashsum_in_dat_file << ")";
|
|
|
}
|
|
|
|
|
|
const QString real_file_hashsum = FileSystem::fileHash(patch_filename);
|
|
|
if (!FileSystem::fileExists(patch_filename) || real_file_hashsum != patch_hashsum) {
|
|
|
- qCritical() << "PatchInstallation: Incorrect patch file: " << patch_filename << ", hashsum: " << real_file_hashsum << ", expected: " << patch_hashsum;
|
|
|
+ qCritical() << "PatchInstaller: Incorrect patch file: " << patch_filename << ", hashsum: " << real_file_hashsum << ", expected: " << patch_hashsum;
|
|
|
continue;
|
|
|
}
|
|
|
|
|
|
LOTRO_DAT::Database* db = new LOTRO_DAT::Database();
|
|
|
if (!db->InitDatabase(patch_filename.toStdString())) {
|
|
|
- qCritical() << "PatchInstallation: failed to initialize db " << patch_filename;
|
|
|
+ qCritical() << "PatchInstaller: failed to initialize db " << patch_filename;
|
|
|
continue;
|
|
|
}
|
|
|
patch_databases[patch] = db;
|
|
@@ -576,7 +569,7 @@ void PatchInstaller::startPatchInstallationChain(bool force_reinstall_patches) {
|
|
|
}
|
|
|
|
|
|
if (hashsum_in_dat_file == "") {
|
|
|
- qDebug() << "Skipping installing original version of patch " << patch << " because hashsum in dat file is already empty";
|
|
|
+ qInfo() << "PatchInstaller: Skipping installing original version of patch " << patch << " because hashsum in dat file is already empty";
|
|
|
continue;
|
|
|
}
|
|
|
patches_to_be_installed_orig_versions.append(patch);
|
|
@@ -593,6 +586,7 @@ void PatchInstaller::startPatchInstallationChain(bool force_reinstall_patches) {
|
|
|
}
|
|
|
|
|
|
for (const QString& patch_name : patches_to_be_installed_orig_versions) {
|
|
|
+ qInfo() << "PatchInstaller: Installing original version of patch " << patch_name;
|
|
|
installOriginalPatch(patch_name);
|
|
|
}
|
|
|
|