cleanups
tests / package-smoke-linux (push) Skipped
tests / package-smoke-windows (push) Skipped
tests / package-smoke-macos (push) Skipped
tests / linux (push) Successful in 2m22s
tests / macos (push) Successful in 2m29s
tests / windows (push) Successful in 4m31s

Signed-off-by: galeon <dertiellis@gmail.com>
This commit is contained in:
galeon committed 2026-11-03 09:52:33 +03:00
1 parent 5635dcc558
commit 98344a1870
15 files changed
+38 -480

No files matched your search

+2 -14
View File
@@ -29,8 +29,6 @@ QString nativeToken(const QString &path)
return QDir::toNativeSeparators(path);
}
// Подставляет ${...}. Аргументы, в которых после подстановки остались
// неизвестные плейсхолдеры, вызывающий выбрасывает.
QString substitute(QString argument, const QHash<QString, QString> &variables)
{
for (auto it = variables.cbegin(); it != variables.cend(); ++it)
@@ -47,14 +45,12 @@ bool isNativeLibraryFile(const QString &fileName)
for (const QString &suffix : suffixes)
if (fileName.endsWith(suffix, Qt::CaseInsensitive))
return true;
// Версионированные so (libfoo.so.1, libfoo.so.1.2.3). Хвост — строго цифры,
// иначе в натив попадают служебные файлы LWJGL вроде liblwjgl.so.sha1 / .so.git.
static const QRegularExpression versionedSo(QStringLiteral("\\.so(\\.\\d+)+$"),
QRegularExpression::CaseInsensitiveOption);
return versionedSo.match(fileName).hasMatch();
}
} // namespace
}
GameLauncher::GameLauncher(QObject *parent)
: QObject(parent)
@@ -113,7 +109,7 @@ bool ignoreListCovers(const QString &ignoreListArgument, const QString &fileName
return false;
}
} // namespace
}
QStringList GameLauncher::buildArguments(const LaunchOptions &options,
const MinecraftVersion &version,
@@ -163,7 +159,6 @@ QStringList GameLauncher::buildArguments(const LaunchOptions &options,
QStringList arguments;
// Свои jvm-аргументы идут первыми — как в строке запуска из примера.
if (!options.authlibInjectorPath.isEmpty()) {
arguments << QStringLiteral("-javaagent:%1=%2")
.arg(nativeToken(options.authlibInjectorPath), options.authlibInjectorApi)
@@ -175,12 +170,6 @@ QStringList GameLauncher::buildArguments(const LaunchOptions &options,
arguments << QStringLiteral("-Xmx%1M").arg(options.maxMemoryMb);
arguments += options.extraJvmArgs;
// Forge 1.17+ собирает слой модулей из classpath, пропуская всё, чьё имя
// начинается с записи в -DignoreList. Ванильный клиентский jar записан там
// как ${version_name}.jar — с расчётом на лаунчер Mojang, который кладёт в
// classpath jar самого профиля. Своего jar у профиля Forge нет, мы кладём
// родительский, и без его имени в списке он становится вторым модулем с
// классами Minecraft: «Modules minecraft and _1._20._1 export package ...».
const QString clientJarName = QFileInfo(version.clientJarPath).fileName();
for (const QString &argument : version.jvmArgs) {
@@ -344,7 +333,6 @@ bool GameLauncher::launch(const LaunchOptions &options,
m_process->deleteLater();
m_process = nullptr;
});
// Токен в лог не попадает — маскируем его в отображаемой строке запуска.
QStringList shown = arguments;
const int tokenIndex = shown.indexOf(QStringLiteral("--accessToken"));
if (tokenIndex >= 0 && tokenIndex + 1 < shown.size())