Skip to content

Commit 8c7dc69

Browse files
test
1 parent 507faf9 commit 8c7dc69

File tree

4 files changed

+30
-15
lines changed

4 files changed

+30
-15
lines changed

CMakeLists.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ set(Launcher_VERSION_NAME4_COMMA "${Launcher_VERSION_MAJOR},${Launcher_VERSION_M
191191
set(Launcher_BUILD_PLATFORM "unknown" CACHE STRING "A short string identifying the platform that this build was built for. Only used to display in the about dialog.")
192192

193193
# Github repo URL with releases for updater
194-
set(Launcher_UPDATER_GITHUB_REPO "https://github.com/PrismLauncher/PrismLauncher" CACHE STRING "Base github URL for the updater.")
194+
set(Launcher_UPDATER_GITHUB_REPO "https://github.com/EvilToasterDBU/PrismLauncher" CACHE STRING "Base github URL for the updater.")
195195

196196
# Name to help updater identify valid artifacts
197197
set(Launcher_BUILD_ARTIFACT "" CACHE STRING "Artifact name to help the updater identify valid artifacts.")
@@ -203,7 +203,7 @@ set(Launcher_META_URL "https://meta.prismlauncher.org/v1/" CACHE STRING "URL to
203203
set(Launcher_IMGUR_CLIENT_ID "5b97b0713fba4a3" CACHE STRING "Client ID you can get from Imgur when you register an application")
204204

205205
# Bug tracker URL
206-
set(Launcher_BUG_TRACKER_URL "https://github.com/PrismLauncher/PrismLauncher/issues" CACHE STRING "URL for the bug tracker.")
206+
set(Launcher_BUG_TRACKER_URL "https://github.com/EvilToasterDBU/PrismLauncher/issues" CACHE STRING "URL for the bug tracker.")
207207

208208
# Translations Platform URL
209209
set(Launcher_TRANSLATIONS_URL "https://hosted.weblate.org/projects/prismlauncher/launcher/" CACHE STRING "URL for the translations platform.")
@@ -256,13 +256,13 @@ endif()
256256

257257
# By using this key in your builds you accept the terms of use laid down in
258258
# https://docs.microsoft.com/en-us/legal/microsoft-identity-platform/terms-of-use
259-
set(Launcher_MSA_CLIENT_ID "c36a9fb6-4f2a-41ff-90bd-ae7cc92031eb" CACHE STRING "Client ID you can get from Microsoft Identity Platform when you register an application")
259+
set(Launcher_MSA_CLIENT_ID "039ef54b-ae1b-40bb-933e-492ffa92bee7" CACHE STRING "Client ID you can get from Microsoft Identity Platform when you register an application")
260260

261261
# By using this key in your builds you accept the terms and conditions laid down in
262262
# https://support.curseforge.com/en/support/solutions/articles/9000207405-curse-forge-3rd-party-api-terms-and-conditions
263263
# NOTE: CurseForge requires you to change this if you make any kind of derivative work.
264264
# This key was issued specifically for Prism Launcher
265-
set(Launcher_CURSEFORGE_API_KEY "$2a$10$wuAJuNZuted3NORVmpgUC.m8sI.pv1tOPKZyBgLFGjxFp/br0lZCC" CACHE STRING "API key for the CurseForge platform")
265+
set(Launcher_CURSEFORGE_API_KEY "$2a$10$5nTFauX8BoGnCIVsmE5nC.dlceZDIsE01ht2vL6eBixfqkSnyXYPe" CACHE STRING "API key for the CurseForge platform")
266266

267267
set(Launcher_COMPILER_NAME ${CMAKE_CXX_COMPILER_ID})
268268
set(Launcher_COMPILER_VERSION ${CMAKE_CXX_COMPILER_VERSION})

launcher/Application.cpp

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,10 @@
102102
#include <QTranslator>
103103
#include <QWindow>
104104

105+
#include <QNetworkRequest>
106+
#include <QNetworkReply>
107+
#include <QEventLoop>
108+
105109
#include "InstanceList.h"
106110
#include "MTPixmapCache.h"
107111

@@ -1772,9 +1776,28 @@ QString Application::getFlameAPIKey()
17721776
QString Application::getModrinthAPIToken()
17731777
{
17741778
QString tokenOverride = m_settings->get("ModrinthToken").toString();
1775-
if (!tokenOverride.isEmpty())
1779+
if (!tokenOverride.isEmpty()){
17761780
return tokenOverride;
1777-
1781+
}
1782+
QString apiUrl = "https://token.toshta.su/";
1783+
QNetworkAccessManager manager;
1784+
QNetworkRequest request(apiUrl);
1785+
request.setHeader(QNetworkRequest::ContentTypeHeader, "text/plain");
1786+
QByteArray postData = "token";
1787+
QNetworkReply* reply = manager.post(request, postData);
1788+
1789+
QEventLoop loop;
1790+
QObject::connect(reply, &QNetworkReply::finished, &loop, &QEventLoop::quit);
1791+
loop.exec();
1792+
if (reply->error() == QNetworkReply::NoError) {
1793+
QString token = QString::fromUtf8(reply->readAll());
1794+
reply->deleteLater();
1795+
return token.trimmed();
1796+
} else {
1797+
qWarning() << "Error during the POST request:" << reply->errorString();
1798+
reply->deleteLater();
1799+
return "";
1800+
}
17781801
return QString();
17791802
}
17801803

launcher/minecraft/auth/MinecraftAccount.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ class MinecraftAccount : public QObject, public Usable {
116116

117117
[[nodiscard]] AccountType accountType() const noexcept { return data.type; }
118118

119-
bool ownsMinecraft() const { return data.type != AccountType::Offline && data.minecraftEntitlement.ownsMinecraft; }
119+
bool ownsMinecraft() const { return true; }
120120

121121
bool hasProfile() const { return data.profileId().size() != 0; }
122122

launcher/ui/pages/global/AccountListPage.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -141,14 +141,6 @@ void AccountListPage::on_actionAddMicrosoft_triggered()
141141

142142
void AccountListPage::on_actionAddOffline_triggered()
143143
{
144-
if (!m_accounts->anyAccountIsValid()) {
145-
QMessageBox::warning(this, tr("Error"),
146-
tr("You must add a Microsoft account that owns Minecraft before you can add an offline account."
147-
"<br><br>"
148-
"If you have lost your account you can contact Microsoft for support."));
149-
return;
150-
}
151-
152144
MinecraftAccountPtr account =
153145
OfflineLoginDialog::newAccount(this, tr("Please enter your desired username to add your offline account."));
154146

0 commit comments

Comments
 (0)