mirror of
https://github.com/MultiMC/MultiMC5.git
synced 2025-02-21 21:41:12 +00:00
NOISSUE shortcut creation: add version blacklist for joining server on launch
These versions are known to crash when joining a server on launch (see MC-145102 and MC-228828)
This commit is contained in:
parent
bbdbe47e72
commit
7938585abb
@ -11,6 +11,8 @@
|
|||||||
#include "ui_CreateShortcutDialog.h"
|
#include "ui_CreateShortcutDialog.h"
|
||||||
#include "Application.h"
|
#include "Application.h"
|
||||||
#include "minecraft/auth/AccountList.h"
|
#include "minecraft/auth/AccountList.h"
|
||||||
|
#include "minecraft/MinecraftInstance.h"
|
||||||
|
#include "minecraft/PackProfile.h"
|
||||||
#include "icons/IconList.h"
|
#include "icons/IconList.h"
|
||||||
|
|
||||||
#ifdef Q_OS_WIN
|
#ifdef Q_OS_WIN
|
||||||
@ -38,6 +40,15 @@ CreateShortcutDialog::CreateShortcutDialog(QWidget *parent, InstancePtr instance
|
|||||||
ui->profileComboBox->setCurrentText(accounts->defaultAccount()->profileName());
|
ui->profileComboBox->setCurrentText(accounts->defaultAccount()->profileName());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (m_instance->typeName() == "Minecraft")
|
||||||
|
{
|
||||||
|
MinecraftInstancePtr minecraftInstance = qobject_pointer_cast<MinecraftInstance>(m_instance);
|
||||||
|
QString version = minecraftInstance->getPackProfile()->getComponentVersion("net.minecraft");
|
||||||
|
bool enableJoinServer = QRegExp(JOIN_SERVER_DISALLOWED_VERSIONS).exactMatch(version);
|
||||||
|
ui->joinServerCheckBox->setEnabled(enableJoinServer);
|
||||||
|
ui->joinServer->setEnabled(enableJoinServer);
|
||||||
|
}
|
||||||
|
|
||||||
#if defined(Q_OS_UNIX) && !defined(Q_OS_LINUX)
|
#if defined(Q_OS_UNIX) && !defined(Q_OS_LINUX)
|
||||||
ui->createScriptCheckBox->setEnabled(false);
|
ui->createScriptCheckBox->setEnabled(false);
|
||||||
ui->createScriptCheckBox->setChecked(true);
|
ui->createScriptCheckBox->setChecked(true);
|
||||||
|
@ -15,6 +15,22 @@
|
|||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
const QString JOIN_SERVER_DISALLOWED_VERSIONS(
|
||||||
|
"(19w0[89][a-z])"
|
||||||
|
"|(19w1[0-9][a-z])"
|
||||||
|
"|(1.14.?[1-4]?-pre[0-9])"
|
||||||
|
"|(1.14.?[1-4]?)"
|
||||||
|
"|(19w[34][0-9][a-z])"
|
||||||
|
"|(1.15.?[0-9]?-pre[0-9])"
|
||||||
|
"|(1.15.?[0-9]?)"
|
||||||
|
"|(20w[01][0-9][a-z])"
|
||||||
|
"|(20w20a)"
|
||||||
|
"|(21w[12][0-9][a-z])"
|
||||||
|
"|(1.17-pre[0-9])"
|
||||||
|
"|(1.17-rc[0-9])"
|
||||||
|
"|(1.17)"
|
||||||
|
);
|
||||||
|
|
||||||
namespace Ui
|
namespace Ui
|
||||||
{
|
{
|
||||||
class CreateShortcutDialog;
|
class CreateShortcutDialog;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user