aboutsummaryrefslogtreecommitdiff
path: root/launcher/minecraft/auth/steps/YggdrasilStep.cpp
diff options
context:
space:
mode:
authorTrial97 <alexandru.tripon97@gmail.com>2023-08-05 19:04:53 +0300
committerTrial97 <alexandru.tripon97@gmail.com>2023-08-05 19:04:53 +0300
commit91eb30f03795921b48360b79bdb739dcd0f10f17 (patch)
tree1a2fccbbbf4751cf2cf6f6418cb525dcee5f2acd /launcher/minecraft/auth/steps/YggdrasilStep.cpp
parenta3ffa6455021b69bd1940b65fefb3b6177c96730 (diff)
parentae793f6cf11658c9abc5111e82d5ba7b3e6af127 (diff)
downloadPrismLauncher-91eb30f03795921b48360b79bdb739dcd0f10f17.tar.gz
PrismLauncher-91eb30f03795921b48360b79bdb739dcd0f10f17.tar.bz2
PrismLauncher-91eb30f03795921b48360b79bdb739dcd0f10f17.zip
Merge branch 'develop' of https://github.com/PrismLauncher/PrismLauncher into pack_changelog
Diffstat (limited to 'launcher/minecraft/auth/steps/YggdrasilStep.cpp')
-rw-r--r--launcher/minecraft/auth/steps/YggdrasilStep.cpp25
1 files changed, 15 insertions, 10 deletions
diff --git a/launcher/minecraft/auth/steps/YggdrasilStep.cpp b/launcher/minecraft/auth/steps/YggdrasilStep.cpp
index e1d33172..fdcaa0d6 100644
--- a/launcher/minecraft/auth/steps/YggdrasilStep.cpp
+++ b/launcher/minecraft/auth/steps/YggdrasilStep.cpp
@@ -4,7 +4,8 @@
#include "minecraft/auth/Parsers.h"
#include "minecraft/auth/Yggdrasil.h"
-YggdrasilStep::YggdrasilStep(AccountData* data, QString password) : AuthStep(data), m_password(password) {
+YggdrasilStep::YggdrasilStep(AccountData* data, QString password) : AuthStep(data), m_password(password)
+{
m_yggdrasil = new Yggdrasil(m_data, this);
connect(m_yggdrasil, &Task::failed, this, &YggdrasilStep::onAuthFailed);
@@ -14,28 +15,32 @@ YggdrasilStep::YggdrasilStep(AccountData* data, QString password) : AuthStep(dat
YggdrasilStep::~YggdrasilStep() noexcept = default;
-QString YggdrasilStep::describe() {
+QString YggdrasilStep::describe()
+{
return tr("Logging in with Mojang account.");
}
-void YggdrasilStep::rehydrate() {
+void YggdrasilStep::rehydrate()
+{
// NOOP, for now.
}
-void YggdrasilStep::perform() {
- if(m_password.size()) {
+void YggdrasilStep::perform()
+{
+ if (m_password.size()) {
m_yggdrasil->login(m_password);
- }
- else {
+ } else {
m_yggdrasil->refresh();
}
}
-void YggdrasilStep::onAuthSucceeded() {
+void YggdrasilStep::onAuthSucceeded()
+{
emit finished(AccountTaskState::STATE_WORKING, tr("Logged in with Mojang"));
}
-void YggdrasilStep::onAuthFailed() {
+void YggdrasilStep::onAuthFailed()
+{
// TODO: hook these in again, expand to MSA
// m_error = m_yggdrasil->m_error;
// m_aborted = m_yggdrasil->m_aborted;
@@ -44,7 +49,7 @@ void YggdrasilStep::onAuthFailed() {
QString errorMessage = tr("Mojang user authentication failed.");
// NOTE: soft error in the first step means 'offline'
- if(state == AccountTaskState::STATE_FAILED_SOFT) {
+ if (state == AccountTaskState::STATE_FAILED_SOFT) {
state = AccountTaskState::STATE_OFFLINE;
errorMessage = tr("Mojang user authentication ended with a network error.");
}