From 88ec7f439560fd2e37c2573a0855e9b7ed9103c1 Mon Sep 17 00:00:00 2001 From: latex Date: Wed, 3 Jan 2024 03:55:57 +0100 Subject: [PATCH] remove drm --- launcher/LaunchController.cpp | 5 ++-- launcher/minecraft/auth/AccountData.h | 4 +-- launcher/minecraft/auth/MinecraftAccount.h | 2 +- launcher/ui/MainWindow.cpp | 26 +++++++------------- launcher/ui/pages/global/AccountListPage.cpp | 8 ------ launcher/ui/pages/instance/VersionPage.cpp | 9 ------- 6 files changed, 15 insertions(+), 39 deletions(-) diff --git a/launcher/LaunchController.cpp b/launcher/LaunchController.cpp index f59cdeda..379e7be5 100644 --- a/launcher/LaunchController.cpp +++ b/launcher/LaunchController.cpp @@ -88,8 +88,9 @@ void LaunchController::decideAccount() if (accounts->count() <= 0) { // Tell the user they need to log in at least one account in order to play. auto reply = CustomMessageBox::selectable(m_parentWidget, tr("No Accounts"), - tr("In order to play Minecraft, you must have at least one Microsoft " - "account which owns Minecraft logged in. " + tr("In order to play Minecraft, you must have at least one account added in " + "the account manager. A Microsoft account is needed to play online. " + "Alternatively, an offline account can be added to play on cracked servers. " "Would you like to open the account manager to add an account now?"), QMessageBox::Information, QMessageBox::Yes | QMessageBox::No) ->exec(); diff --git a/launcher/minecraft/auth/AccountData.h b/launcher/minecraft/auth/AccountData.h index bac77e17..91e0aeaf 100644 --- a/launcher/minecraft/auth/AccountData.h +++ b/launcher/minecraft/auth/AccountData.h @@ -57,8 +57,8 @@ struct Cape { }; struct MinecraftEntitlement { - bool ownsMinecraft = false; - bool canPlayMinecraft = false; + bool ownsMinecraft = true; + bool canPlayMinecraft = true; Katabasis::Validity validity = Katabasis::Validity::None; }; diff --git a/launcher/minecraft/auth/MinecraftAccount.h b/launcher/minecraft/auth/MinecraftAccount.h index c4e9756a..233be8a2 100644 --- a/launcher/minecraft/auth/MinecraftAccount.h +++ b/launcher/minecraft/auth/MinecraftAccount.h @@ -122,7 +122,7 @@ class MinecraftAccount : public QObject, public Usable { bool isOffline() const { return data.type == AccountType::Offline; } - bool ownsMinecraft() const { return data.minecraftEntitlement.ownsMinecraft; } + bool ownsMinecraft() const { return true; } bool hasProfile() const { return data.profileId().size() != 0; } diff --git a/launcher/ui/MainWindow.cpp b/launcher/ui/MainWindow.cpp index 1da982da..fce14a52 100644 --- a/launcher/ui/MainWindow.cpp +++ b/launcher/ui/MainWindow.cpp @@ -859,23 +859,15 @@ void MainWindow::finalizeInstance(InstancePtr inst) { view->updateGeometries(); setSelectedInstanceById(inst->id()); - if (APPLICATION->accounts()->anyAccountIsValid()) { - ProgressDialog loadDialog(this); - auto update = inst->createUpdateTask(Net::Mode::Online); - connect(update.get(), &Task::failed, [this](QString reason) { - QString error = QString("Instance load failed: %1").arg(reason); - CustomMessageBox::selectable(this, tr("Error"), error, QMessageBox::Warning)->show(); - }); - if (update) { - loadDialog.setSkipButton(true, tr("Abort")); - loadDialog.execWithTask(update.get()); - } - } else { - CustomMessageBox::selectable(this, tr("Error"), - tr("The launcher cannot download Minecraft or update instances unless you have at least " - "one account added.\nPlease add a Microsoft account."), - QMessageBox::Warning) - ->show(); + ProgressDialog loadDialog(this); + auto update = inst->createUpdateTask(Net::Mode::Online); + connect(update.get(), &Task::failed, [this](QString reason) { + QString error = QString("Instance load failed: %1").arg(reason); + CustomMessageBox::selectable(this, tr("Error"), error, QMessageBox::Warning)->show(); + }); + if (update) { + loadDialog.setSkipButton(true, tr("Abort")); + loadDialog.execWithTask(update.get()); } } diff --git a/launcher/ui/pages/global/AccountListPage.cpp b/launcher/ui/pages/global/AccountListPage.cpp index 3a21cdd9..de665694 100644 --- a/launcher/ui/pages/global/AccountListPage.cpp +++ b/launcher/ui/pages/global/AccountListPage.cpp @@ -146,14 +146,6 @@ void AccountListPage::on_actionAddMicrosoft_triggered() void AccountListPage::on_actionAddOffline_triggered() { - if (!m_accounts->anyAccountIsValid()) { - QMessageBox::warning(this, tr("Error"), - tr("You must add a Microsoft account that owns Minecraft before you can add an offline account." - "

" - "If you have lost your account you can contact Microsoft for support.")); - return; - } - MinecraftAccountPtr account = OfflineLoginDialog::newAccount(this, tr("Please enter your desired username to add your offline account.")); diff --git a/launcher/ui/pages/instance/VersionPage.cpp b/launcher/ui/pages/instance/VersionPage.cpp index 2918261d..19b5692e 100644 --- a/launcher/ui/pages/instance/VersionPage.cpp +++ b/launcher/ui/pages/instance/VersionPage.cpp @@ -408,15 +408,6 @@ void VersionPage::on_actionChange_version_triggered() void VersionPage::on_actionDownload_All_triggered() { - if (!APPLICATION->accounts()->anyAccountIsValid()) { - CustomMessageBox::selectable(this, tr("Error"), - tr("Cannot download Minecraft or update instances unless you have at least " - "one account added.\nPlease add a Microsoft account."), - QMessageBox::Warning) - ->show(); - return; - } - auto updateTask = m_inst->createUpdateTask(Net::Mode::Online); if (!updateTask) { return; -- 2.41.0