|
@@ -33,7 +33,7 @@ bool LotroDatManager::NotPatched()
|
|
|
void LotroDatManager::InitialiseManager()
|
|
|
{
|
|
|
qDebug() << "Initialising .dat manager";
|
|
|
- emit processStarted();
|
|
|
+ emit processStarted("InitialiseManager");
|
|
|
QString game_folder = app_settings->value("General/game_folder_path", QString()).toString();
|
|
|
QString locale_prefix = app_settings->value("General/original_locale", "English").toString();
|
|
|
if (game_folder.isEmpty() || !FileSystem::fileExists(game_folder + "client_local_" + locale_prefix + ".dat")
|
|
@@ -42,7 +42,7 @@ void LotroDatManager::InitialiseManager()
|
|
|
qDebug() << "Finished initialisation .dat manager - error: required files not found!";
|
|
|
|
|
|
emit caughtError(QString("InitialiseManager"), {"FileNotFound"});
|
|
|
- emit processFinished();
|
|
|
+ emit processFinished("InitialiseManager");
|
|
|
return;
|
|
|
}
|
|
|
|
|
@@ -52,7 +52,7 @@ void LotroDatManager::InitialiseManager()
|
|
|
qDebug() << "Unable to update permissions on client_local_* file!";
|
|
|
|
|
|
emit caughtError(QString("InitialiseManager"), {"PermissionsError"});
|
|
|
- emit processFinished();
|
|
|
+ emit processFinished("InitialiseManager");
|
|
|
return;
|
|
|
}
|
|
|
|
|
@@ -60,7 +60,7 @@ void LotroDatManager::InitialiseManager()
|
|
|
qDebug() << "Unable to update permissions on client_general* file!";
|
|
|
|
|
|
emit caughtError(QString("InitialiseManager"), {"PermissionsError"});
|
|
|
- emit processFinished();
|
|
|
+ emit processFinished("InitialiseManager");
|
|
|
return;
|
|
|
}
|
|
|
|
|
@@ -77,26 +77,26 @@ void LotroDatManager::InitialiseManager()
|
|
|
qDebug() << "Finished initialisation .dat manager - error: DatFile initialisation error!";
|
|
|
|
|
|
emit caughtError(QString("InitialiseManager"), {"InitialisationError"});
|
|
|
- emit processFinished();
|
|
|
+ emit processFinished("InitialiseManager");
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- emit processFinished();
|
|
|
+ emit processFinished("InitialiseManager");
|
|
|
}
|
|
|
|
|
|
void LotroDatManager::DeinitialiseManager()
|
|
|
{
|
|
|
- emit processStarted();
|
|
|
+ emit processStarted("DeinitialiseManager");
|
|
|
qDebug() << "Started DEinitialisation .dat manager.";
|
|
|
client_local_file.Deinitialize();
|
|
|
client_general_file.Deinitialize();
|
|
|
qDebug() << "Finished DEinitialisation .dat manager.";
|
|
|
- emit processFinished();
|
|
|
+ emit processFinished("DeinitialiseManager");
|
|
|
}
|
|
|
|
|
|
void LotroDatManager::StartGame(LOTRO_DAT::DatLocaleManager::LOCALE locale)
|
|
|
{
|
|
|
- emit processStarted();
|
|
|
+ emit processStarted("StartGame");
|
|
|
qDebug() << "Starting game!";
|
|
|
|
|
|
client_general_file.GetLocaleManager().SetLocale(locale);
|
|
@@ -107,7 +107,7 @@ void LotroDatManager::StartGame(LOTRO_DAT::DatLocaleManager::LOCALE locale)
|
|
|
if (!FileSystem::fileExists(QApplication::applicationDirPath() + "/Launcher.exe")) {
|
|
|
emit caughtError("StartGame", {"NoGameLauncherInLegacyDir"});
|
|
|
qDebug() << "Starting game FAILED - no game launcher in legacy directory found!";
|
|
|
- emit processFinished();
|
|
|
+ emit processFinished("StartGame");
|
|
|
return;
|
|
|
}
|
|
|
|
|
@@ -116,7 +116,7 @@ void LotroDatManager::StartGame(LOTRO_DAT::DatLocaleManager::LOCALE locale)
|
|
|
if (!QFile::copy(QApplication::applicationDirPath() + "/LotroLauncher.exe", game_folder + "/lotro_ru.exe")) {
|
|
|
emit caughtError("StartGame", {"NoAccessToGameLauncher"});
|
|
|
qDebug() << "Starting game FAILED - cannot copy LotroLauncher to LotroLauncher_fwd!!";
|
|
|
- emit processFinished();
|
|
|
+ emit processFinished("StartGame");
|
|
|
return;
|
|
|
}
|
|
|
|
|
@@ -124,7 +124,7 @@ void LotroDatManager::StartGame(LOTRO_DAT::DatLocaleManager::LOCALE locale)
|
|
|
if (!QFile::copy(QApplication::applicationDirPath() + "/Launcher.exe", game_folder + "/LotroLauncher.exe")) {
|
|
|
emit caughtError("StartGame", {"NoAccessToGameLauncher"});
|
|
|
qDebug() << "Starting game FAILED - cannot copy GameLauncher to LotroLauncher!!";
|
|
|
- emit processFinished();
|
|
|
+ emit processFinished("StartGame");
|
|
|
return;
|
|
|
}
|
|
|
|
|
@@ -140,14 +140,14 @@ void LotroDatManager::StartGame(LOTRO_DAT::DatLocaleManager::LOCALE locale)
|
|
|
qDebug() << game_folder + "/LotroLauncher.exe";
|
|
|
emit caughtError("StartGame", {"NoAccessToGameLauncher"});
|
|
|
qDebug() << "Starting game FAILED - cannot copy LotroLauncher from working dir to LotroLauncher in lotro dir!!";
|
|
|
- emit processFinished();
|
|
|
+ emit processFinished("StartGame");
|
|
|
return;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
qDebug() << "Starting game finished!!";
|
|
|
startLotroLauncherWithParameters(locale);
|
|
|
- emit processFinished();
|
|
|
+ emit processFinished("StartGame");
|
|
|
}
|
|
|
|
|
|
void LotroDatManager::ChangeTranslationLanguage()
|
|
@@ -168,6 +168,7 @@ void LotroDatManager::InstallActivePatches()
|
|
|
|
|
|
void LotroDatManager::InstallPatches()
|
|
|
{
|
|
|
+ emit processStarted("InstallPatches");
|
|
|
const QStringList all_patch_names = {"sound", "text", "image", "texture"};
|
|
|
foreach (QString patch_name, all_patch_names) {
|
|
|
if (app_settings->value("patch_databases/" + patch_name, "Disabled").toString() == "Disabled")
|
|
@@ -188,11 +189,12 @@ void LotroDatManager::InstallPatches()
|
|
|
|
|
|
db.CloseDatabase();
|
|
|
}
|
|
|
+ emit processFinished("InstallPatches");
|
|
|
}
|
|
|
|
|
|
void LotroDatManager::InstallLoadscreens()
|
|
|
{
|
|
|
- emit processStarted();
|
|
|
+ emit processStarted("InstallLoadscreens");
|
|
|
|
|
|
if (app_settings->value("patch_databases/loadscreen", "Disabled").toString() == "Disabled")
|
|
|
return;
|
|
@@ -233,6 +235,7 @@ void LotroDatManager::InstallLoadscreens()
|
|
|
LOTRO_DAT::Database db;
|
|
|
if (!db.InitDatabase(database_path.toStdString())) {
|
|
|
emit caughtError("InstallLoadscreens", {"ErrorInitDatabase"});
|
|
|
+ emit processFinished("InstallLoadscreens");
|
|
|
return;
|
|
|
}
|
|
|
|
|
@@ -246,13 +249,12 @@ void LotroDatManager::InstallLoadscreens()
|
|
|
subfile.binary_data.WriteToFile((folder + filenames[i]).toStdString());
|
|
|
}
|
|
|
db.CloseDatabase();
|
|
|
-
|
|
|
- emit processFinished();
|
|
|
+ emit processFinished("InstallLoadscreens");
|
|
|
}
|
|
|
|
|
|
void LotroDatManager::InstallVideos()
|
|
|
{
|
|
|
- emit processStarted();
|
|
|
+ emit processStarted("InstallVideos");
|
|
|
if (app_settings->value("patch_databases/video", "Disabled").toString() == "Disabled")
|
|
|
return;
|
|
|
|
|
@@ -263,6 +265,7 @@ void LotroDatManager::InstallVideos()
|
|
|
LOTRO_DAT::Database db;
|
|
|
if (!db.InitDatabase(database_path.toStdString())) {
|
|
|
emit caughtError("InstallVideos", {"ErrorInitDatabase"});
|
|
|
+ emit processFinished("InstallVideos");
|
|
|
return;
|
|
|
}
|
|
|
|
|
@@ -293,6 +296,8 @@ void LotroDatManager::InstallVideos()
|
|
|
video_downloader.targetFile = new QFile(target_folder + filename);
|
|
|
video_downloader.targetFile->open(QIODevice::ReadWrite);
|
|
|
video_downloader.start();
|
|
|
+
|
|
|
+
|
|
|
video_downloader.waitForDownloaded();
|
|
|
video_downloader.targetFile->close();
|
|
|
video_downloader.targetFile->deleteLater();
|
|
@@ -303,7 +308,7 @@ void LotroDatManager::InstallVideos()
|
|
|
}
|
|
|
db.CloseDatabase();
|
|
|
|
|
|
- emit processFinished();
|
|
|
+ emit processFinished("InstallVideos");
|
|
|
}
|
|
|
|
|
|
void LotroDatManager::InstallUpdates()
|
|
@@ -318,29 +323,29 @@ void LotroDatManager::InstallMicroPatch()
|
|
|
|
|
|
void LotroDatManager::CreateBackup()
|
|
|
{
|
|
|
- emit processStarted();
|
|
|
+ emit processStarted("CreateBackup");
|
|
|
QString locale_prefix = app_settings->value("General/original_locale", "English").toString();
|
|
|
client_local_file.GetBackupManager().CreateBackup((QApplication::applicationDirPath() + "/backup/client_local_" + locale_prefix + ".dat").toStdString());
|
|
|
client_general_file.GetBackupManager().CreateBackup((QApplication::applicationDirPath() + "/backup/client_general.dat").toStdString());
|
|
|
- emit processFinished();
|
|
|
+ emit processFinished("CreateBackup");
|
|
|
}
|
|
|
|
|
|
void LotroDatManager::RestoreFromBackup()
|
|
|
{
|
|
|
- emit processStarted();
|
|
|
+ emit processStarted("CreateBackup");
|
|
|
QString locale_prefix = app_settings->value("General/original_locale", "English").toString();
|
|
|
client_local_file.GetBackupManager().RestoreFromBackup((QApplication::applicationDirPath() + "/backup/client_local_" + locale_prefix + ".dat").toStdString());
|
|
|
client_general_file.GetBackupManager().RestoreFromBackup((QApplication::applicationDirPath() + "/backup/client_general.dat").toStdString());
|
|
|
- emit processFinished();
|
|
|
+ emit processFinished("CreateBackup");
|
|
|
}
|
|
|
|
|
|
void LotroDatManager::RemoveBackup()
|
|
|
{
|
|
|
- emit processStarted();
|
|
|
+ emit processStarted("CreateBackup");
|
|
|
QString locale_prefix = app_settings->value("General/original_locale", "English").toString();
|
|
|
client_local_file.GetBackupManager().RemoveBackup((QApplication::applicationDirPath() + "/backup/client_local_" + locale_prefix + ".dat").toStdString());
|
|
|
client_general_file.GetBackupManager().RemoveBackup((QApplication::applicationDirPath() + "/backup/client_general.dat").toStdString());
|
|
|
- emit processFinished();
|
|
|
+ emit processFinished("CreateBackup");
|
|
|
}
|
|
|
|
|
|
void LotroDatManager::ApplyTexts()
|
|
@@ -362,21 +367,18 @@ void LotroDatManager::ApplyTexts()
|
|
|
} else {
|
|
|
client_local_file.GetLocaleManager().DisableCategory(102);
|
|
|
}
|
|
|
- emit processFinished();
|
|
|
}
|
|
|
|
|
|
void LotroDatManager::ApplyImages() {
|
|
|
- emit processStarted();
|
|
|
if (app_settings->value("patch_options/maps", "Disabled").toString() == "Enabled") {
|
|
|
client_local_file.GetLocaleManager().EnableCategory(200);
|
|
|
} else {
|
|
|
client_local_file.GetLocaleManager().DisableCategory(200);
|
|
|
}
|
|
|
- emit processFinished();
|
|
|
}
|
|
|
|
|
|
void LotroDatManager::ApplySounds() {
|
|
|
- emit processStarted();
|
|
|
+ emit processStarted("ApplySounds");
|
|
|
if (app_settings->value("patch_options/sounds", "Disabled").toString() == "Enabled") {
|
|
|
client_local_file.GetLocaleManager().EnableCategory(300);
|
|
|
} else {
|
|
@@ -388,7 +390,7 @@ void LotroDatManager::ApplySounds() {
|
|
|
} else {
|
|
|
client_local_file.GetLocaleManager().DisableCategory(103);
|
|
|
}
|
|
|
- emit processFinished();
|
|
|
+ emit processFinished("ApplySounds");
|
|
|
}
|
|
|
|
|
|
bool LotroDatManager::startLotroLauncherWithParameters(LOTRO_DAT::DatLocaleManager::LOCALE locale)
|