mirror of
https://github.com/PrismLauncher/PrismLauncher.git
synced 2026-06-29 01:54:20 +03:00
fix: don't manually format UUIDs
Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com>
This commit is contained in:
parent
9bf2792c7f
commit
d81fa77d1f
5 changed files with 9 additions and 18 deletions
|
|
@ -289,8 +289,7 @@ void LaunchController::login()
|
|||
auto name = askOfflineName("Player", &ok);
|
||||
if (ok) {
|
||||
m_session = std::make_shared<AuthSession>();
|
||||
static const QRegularExpression s_removeChars("[{}-]");
|
||||
m_session->MakeDemo(name, MinecraftAccount::uuidFromUsername(name).toString().remove(s_removeChars));
|
||||
m_session->MakeDemo(name, MinecraftAccount::uuidFromUsername(name).toString(QUuid::Id128));
|
||||
launchInstance();
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -370,8 +370,7 @@ LibraryPtr OneSixVersionFormat::plusJarModFromJson([[maybe_unused]] ProblemConta
|
|||
}
|
||||
|
||||
// just make up something unique on the spot for the library name.
|
||||
auto uuid = QUuid::createUuid();
|
||||
QString id = uuid.toString().remove('{').remove('}');
|
||||
QString id = QUuid::createUuid().toString(QUuid::WithoutBraces);
|
||||
out->setRawName(GradleSpecifier("org.multimc.jarmods:" + id + ":1"));
|
||||
|
||||
// filename override is the old name
|
||||
|
|
|
|||
|
|
@ -55,8 +55,7 @@
|
|||
|
||||
MinecraftAccount::MinecraftAccount(QObject* parent) : QObject(parent)
|
||||
{
|
||||
static const QRegularExpression s_removeChars("[{}-]");
|
||||
data.internalId = QUuid::createUuid().toString().remove(s_removeChars);
|
||||
data.internalId = QUuid::createUuid().toString(QUuid::Id128);
|
||||
}
|
||||
|
||||
MinecraftAccountPtr MinecraftAccount::loadFromJsonV3(const QJsonObject& json)
|
||||
|
|
@ -77,15 +76,14 @@ MinecraftAccountPtr MinecraftAccount::createBlankMSA()
|
|||
|
||||
MinecraftAccountPtr MinecraftAccount::createOffline(const QString& username)
|
||||
{
|
||||
static const QRegularExpression s_removeChars("[{}-]");
|
||||
auto account = makeShared<MinecraftAccount>();
|
||||
account->data.type = AccountType::Offline;
|
||||
account->data.yggdrasilToken.token = "0";
|
||||
account->data.yggdrasilToken.validity = Validity::Certain;
|
||||
account->data.yggdrasilToken.issueInstant = QDateTime::currentDateTimeUtc();
|
||||
account->data.yggdrasilToken.extra["userName"] = username;
|
||||
account->data.yggdrasilToken.extra["clientToken"] = QUuid::createUuid().toString().remove(s_removeChars);
|
||||
account->data.minecraftProfile.id = uuidFromUsername(username).toString().remove(s_removeChars);
|
||||
account->data.yggdrasilToken.extra["clientToken"] = QUuid::createUuid().toString(QUuid::Id128);
|
||||
account->data.minecraftProfile.id = uuidFromUsername(username).toString(QUuid::Id128);
|
||||
account->data.minecraftProfile.name = username;
|
||||
account->data.minecraftProfile.validity = Validity::Certain;
|
||||
return account;
|
||||
|
|
@ -235,8 +233,6 @@ bool MinecraftAccount::shouldRefresh() const
|
|||
|
||||
void MinecraftAccount::fillSession(AuthSessionPtr session)
|
||||
{
|
||||
static const QRegularExpression s_removeChars("[{}-]");
|
||||
|
||||
// volatile auth token
|
||||
session->access_token = data.accessToken();
|
||||
// profile name
|
||||
|
|
@ -244,7 +240,7 @@ void MinecraftAccount::fillSession(AuthSessionPtr session)
|
|||
// profile ID
|
||||
session->uuid = data.profileId();
|
||||
if (session->uuid.isEmpty())
|
||||
session->uuid = uuidFromUsername(session->player_name).toString().remove(s_removeChars);
|
||||
session->uuid = uuidFromUsername(session->player_name).toString(QUuid::Id128);
|
||||
// 'legacy' or 'mojang', depending on account type
|
||||
session->user_type = typeString();
|
||||
if (!session->access_token.isEmpty()) {
|
||||
|
|
|
|||
|
|
@ -23,8 +23,7 @@ QString EntitlementsStep::describe()
|
|||
|
||||
void EntitlementsStep::perform()
|
||||
{
|
||||
auto uuid = QUuid::createUuid();
|
||||
m_entitlements_request_id = uuid.toString().remove('{').remove('}');
|
||||
m_entitlements_request_id = QUuid::createUuid().toString(QUuid::WithoutBraces);
|
||||
|
||||
QUrl url("https://api.minecraftservices.com/entitlements/license?requestId=" + m_entitlements_request_id);
|
||||
auto headers = QList<Net::HeaderPair>{ { "Content-Type", "application/json" },
|
||||
|
|
|
|||
|
|
@ -447,8 +447,7 @@ bool PackInstallTask::createLibrariesComponent(QString instanceRoot, PackProfile
|
|||
}
|
||||
}
|
||||
|
||||
auto uuid = QUuid::createUuid();
|
||||
auto id = uuid.toString().remove('{').remove('}');
|
||||
auto id = QUuid::createUuid().toString(QUuid::WithoutBraces);
|
||||
auto target_id = "org.multimc.atlauncher." + id;
|
||||
|
||||
auto patchDir = FS::PathCombine(instanceRoot, "patches");
|
||||
|
|
@ -566,8 +565,7 @@ bool PackInstallTask::createPackComponent(QString instanceRoot, PackProfile* pro
|
|||
return true;
|
||||
}
|
||||
|
||||
auto uuid = QUuid::createUuid();
|
||||
auto id = uuid.toString().remove('{').remove('}');
|
||||
auto id = QUuid::createUuid().toString(QUuid::WithoutBraces);
|
||||
auto target_id = "org.multimc.atlauncher." + id;
|
||||
|
||||
auto patchDir = FS::PathCombine(instanceRoot, "patches");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue