|
@@ -7,13 +7,110 @@
|
|
|
|
|
|
Q_DECLARE_METATYPE(LOTRO_DAT::DatLocaleManager::LOCALE)
|
|
|
Q_DECLARE_METATYPE(LotroDatManager::Category)
|
|
|
+Q_DECLARE_METATYPE(LotroDatManager::Status)
|
|
|
|
|
|
|
|
|
+void debug::ClientLocalDatStatusChangedHandler(DatStatus::ProgressInfo info) {
|
|
|
+ if (info.status == DatStatus::DAT_STATUS::E_FREE) {
|
|
|
+ std::cout << "CLIENT_LOCAL: operation finished" << std::endl;
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (info.status == DatStatus::DAT_STATUS::E_BACKUP_CREATING) {
|
|
|
+ std::cout << "CLIENT_LOCAL: creating backup " << info.percentage << "% "
|
|
|
+ << "(" << info.finished_parts << "/" << info.total_parts << ")" << std::endl;
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (info.status == DatStatus::DAT_STATUS::E_BACKUP_REMOVING) {
|
|
|
+ std::cout << "CLIENT_LOCAL: removing backup " << info.percentage << "% "
|
|
|
+ << "(" << info.finished_parts << "/" << info.total_parts << ")" << std::endl;
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (info.status == DatStatus::DAT_STATUS::E_BACKUP_RESTORING) {
|
|
|
+ std::cout << "CLIENT_LOCAL: restoring backup " << info.percentage << "% "
|
|
|
+ << "(" << info.finished_parts << "/" << info.total_parts << ")" << std::endl;
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (info.status == DatStatus::DAT_STATUS::E_COMMITING) {
|
|
|
+ std::cout << "CLIENT_LOCAL: applying locales " << info.percentage << "% "
|
|
|
+ << "(" << info.finished_parts << "/" << info.total_parts << ")" << std::endl;
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (info.status == DatStatus::DAT_STATUS::E_EXTRACTING) {
|
|
|
+ std::cout << "CLIENT_LOCAL: extracting data " << info.percentage << "% "
|
|
|
+ << "(" << info.finished_parts << "/" << info.total_parts << ")" << std::endl;
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (info.status == DatStatus::DAT_STATUS::E_GATHERING_INFO) {
|
|
|
+ std::cout << "CLIENT_LOCAL: gathering info " << info.percentage << "% "
|
|
|
+ << "(" << info.finished_parts << "/" << info.total_parts << ")" << std::endl;
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (info.status == DatStatus::DAT_STATUS::E_INITIALISING) {
|
|
|
+ std::cout << "CLIENT_LOCAL: initialising " << info.percentage << "% "
|
|
|
+ << "(" << info.finished_parts << "/" << info.total_parts << ")" << std::endl;
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (info.status == DatStatus::DAT_STATUS::E_PATCHING) {
|
|
|
+ std::cout << "CLIENT_LOCAL: applying patch " << info.percentage << "% "
|
|
|
+ << "(" << info.finished_parts << "/" << info.total_parts << ")" << std::endl;
|
|
|
+ return;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+void debug::ClientGeneralDatStatusChangedHandler(DatStatus::ProgressInfo info) {
|
|
|
+ if (info.status == DatStatus::DAT_STATUS::E_FREE) {
|
|
|
+ std::cout << "CLIENT_GENERAL: operation finished" << std::endl;
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (info.status == DatStatus::DAT_STATUS::E_BACKUP_CREATING) {
|
|
|
+ std::cout << "CLIENT_GENERAL: creating backup " << info.percentage << "% "
|
|
|
+ << "(" << info.finished_parts << "/" << info.total_parts << ")" << std::endl;
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (info.status == DatStatus::DAT_STATUS::E_BACKUP_REMOVING) {
|
|
|
+ std::cout << "CLIENT_GENERAL: removing backup " << info.percentage << "% "
|
|
|
+ << "(" << info.finished_parts << "/" << info.total_parts << ")" << std::endl;
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (info.status == DatStatus::DAT_STATUS::E_BACKUP_RESTORING) {
|
|
|
+ std::cout << "CLIENT_GENERAL: restoring backup " << info.percentage << "% "
|
|
|
+ << "(" << info.finished_parts << "/" << info.total_parts << ")" << std::endl;
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (info.status == DatStatus::DAT_STATUS::E_COMMITING) {
|
|
|
+ std::cout << "CLIENT_GENERAL: applying locales " << info.percentage << "% "
|
|
|
+ << "(" << info.finished_parts << "/" << info.total_parts << ")" << std::endl;
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (info.status == DatStatus::DAT_STATUS::E_EXTRACTING) {
|
|
|
+ std::cout << "CLIENT_GENERAL: extracting data " << info.percentage << "% "
|
|
|
+ << "(" << info.finished_parts << "/" << info.total_parts << ")" << std::endl;
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (info.status == DatStatus::DAT_STATUS::E_GATHERING_INFO) {
|
|
|
+ std::cout << "CLIENT_GENERAL: gathering info " << info.percentage << "% "
|
|
|
+ << "(" << info.finished_parts << "/" << info.total_parts << ")" << std::endl;
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (info.status == DatStatus::DAT_STATUS::E_INITIALISING) {
|
|
|
+ std::cout << "CLIENT_GENERAL: initialising " << info.percentage << "% "
|
|
|
+ << "(" << info.finished_parts << "/" << info.total_parts << ")" << std::endl;
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (info.status == DatStatus::DAT_STATUS::E_PATCHING) {
|
|
|
+ std::cout << "CLIENT_GENERAL: applying patch " << info.percentage << "% "
|
|
|
+ << "(" << info.finished_parts << "/" << info.total_parts << ")" << std::endl;
|
|
|
+ return;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
LotroDatManager::LotroDatManager(QObject *parent) :
|
|
|
QObject(parent) {
|
|
|
|
|
|
- qRegisterMetaType<LOTRO_DAT::DatLocaleManager::LOCALE>();
|
|
|
- client_local_file_.GetStatusModule().AddStatusChangedCallbackFunction(file_status_updated_callback_);
|
|
|
+ qRegisterMetaType<Status>("Status");
|
|
|
+ qRegisterMetaType<LOTRO_DAT::DatLocaleManager::LOCALE>("LOCALE");
|
|
|
+ client_local_file_.GetStatusModule().AddStatusChangedCallbackFunction(client_local_status_updated_callback_);
|
|
|
+ client_general_file_.GetStatusModule().AddStatusChangedCallbackFunction(client_general_status_updated_callback_);
|
|
|
}
|
|
|
|
|
|
LotroDatManager::~LotroDatManager()
|
|
@@ -83,6 +180,10 @@ void LotroDatManager::initializeManager()
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
+ qDebug() << "LotroDatManager initialisation successfull! Dat files: "
|
|
|
+ << QString::fromStdString(client_general_file_.GetIO().GetFilename().value)
|
|
|
+ << QString::fromStdString(client_local_file_.GetIO().GetFilename().value);
|
|
|
+
|
|
|
emit operationFinished("initializeManager", {}, true);
|
|
|
}
|
|
|
|
|
@@ -196,12 +297,16 @@ void LotroDatManager::enableCategory(QString patch_name, LotroDatManager::Catego
|
|
|
emit operationFinished("enableCategory", {patch_name, category}, false);
|
|
|
return;
|
|
|
}
|
|
|
+ client_local_file_.GetFileSystem().CommitDirectories();
|
|
|
+ client_local_file_.GetLocaleManager().CommitLocales();
|
|
|
|
|
|
if (client_general_file_.GetLocaleManager().EnableCategory(category).result != LOTRO_DAT::SUCCESS) {
|
|
|
emit errorOccured("enableCategory", {patch_name, category}, "ErrorEnableCategoryClientGeneral");
|
|
|
emit operationFinished("enableCategory", {patch_name, category}, false);
|
|
|
return;
|
|
|
}
|
|
|
+ client_general_file_.GetFileSystem().CommitDirectories();
|
|
|
+ client_general_file_.GetLocaleManager().CommitLocales();
|
|
|
|
|
|
emit operationFinished("enableCategory", {patch_name, category});
|
|
|
}
|