mirror of
https://github.com/MultiMC/MultiMC5.git
synced 2025-03-25 23:37:58 +00:00
NOISSUE shortcut creation: blacklist versions by date instead of regex
This commit is contained in:
parent
6faa0ef711
commit
7df413db1a
@ -47,8 +47,10 @@ CreateShortcutDialog::CreateShortcutDialog(QWidget *parent, InstancePtr instance
|
|||||||
{
|
{
|
||||||
MinecraftInstancePtr minecraftInstance = qobject_pointer_cast<MinecraftInstance>(m_instance);
|
MinecraftInstancePtr minecraftInstance = qobject_pointer_cast<MinecraftInstance>(m_instance);
|
||||||
minecraftInstance->getPackProfile()->reload(Net::Mode::Online);
|
minecraftInstance->getPackProfile()->reload(Net::Mode::Online);
|
||||||
QString version = minecraftInstance->getPackProfile()->getComponentVersion("net.minecraft");
|
QDateTime versionDate = minecraftInstance->getPackProfile()->getComponent("net.minecraft")->getReleaseDateTime();
|
||||||
bool enableJoinServer = !QRegExp(JOIN_SERVER_DISALLOWED_VERSIONS).exactMatch(version);
|
bool enableJoinServer = (versionDate < MC_145102_START)
|
||||||
|
|| (versionDate >= MC_145102_END && versionDate < MC_228828_START)
|
||||||
|
|| (versionDate >= MC_228828_END);
|
||||||
ui->joinServerCheckBox->setEnabled(enableJoinServer);
|
ui->joinServerCheckBox->setEnabled(enableJoinServer);
|
||||||
ui->joinServer->setEnabled(enableJoinServer);
|
ui->joinServer->setEnabled(enableJoinServer);
|
||||||
}
|
}
|
||||||
|
@ -10,26 +10,17 @@
|
|||||||
#include <QDialog>
|
#include <QDialog>
|
||||||
#include "minecraft/auth/MinecraftAccount.h"
|
#include "minecraft/auth/MinecraftAccount.h"
|
||||||
#include "BaseInstance.h"
|
#include "BaseInstance.h"
|
||||||
|
#include "minecraft/ParseUtils.h"
|
||||||
|
|
||||||
#ifdef Q_OS_WIN
|
#ifdef Q_OS_WIN
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
const QString JOIN_SERVER_DISALLOWED_VERSIONS(
|
// Dates when the game was affected by bugs that crashed the game when using the option to join a server on startup
|
||||||
"(19w0[89][a-z])"
|
const QDateTime MC_145102_START = timeFromS3Time("2019-02-20T14:56:58+00:00");
|
||||||
"|(19w1[0-9][a-z])"
|
const QDateTime MC_145102_END = timeFromS3Time("2020-05-14T08:16:26+00:00");
|
||||||
"|(1.14.?[1-4]?-pre[0-9])"
|
const QDateTime MC_228828_START = timeFromS3Time("2021-03-10T15:24:38+00:00");
|
||||||
"|(1.14.?[1-4]?)"
|
const QDateTime MC_228828_END = timeFromS3Time("2021-06-18T12:24:40+00:00");
|
||||||
"|(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
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user