diff --git a/go/cmd/nekobox_core/go.mod b/go/cmd/nekobox_core/go.mod index a23d487..04949ac 100644 --- a/go/cmd/nekobox_core/go.mod +++ b/go/cmd/nekobox_core/go.mod @@ -54,9 +54,9 @@ require ( github.com/sagernet/netlink v0.0.0-20220905062125-8043b4a9aa97 // indirect github.com/sagernet/quic-go v0.0.0-20230202071646-a8c8afb18b32 // indirect github.com/sagernet/reality v0.0.0-20230406110435-ee17307e7691 // indirect - github.com/sagernet/sing v0.2.5-0.20230512033628-9be7806bab51 // indirect + github.com/sagernet/sing v0.2.5-0.20230517124404-be6013893626 // indirect github.com/sagernet/sing-dns v0.1.5-0.20230426113254-25d948c44223 // indirect - github.com/sagernet/sing-mux v0.0.0-20230425130511-b0a6ffd8406f // indirect + github.com/sagernet/sing-mux v0.0.0-20230517134606-1ebe6bb26646 // indirect github.com/sagernet/sing-shadowsocks v0.2.2-0.20230509053848-d83f8fe1194c // indirect github.com/sagernet/sing-shadowsocks2 v0.0.0-20230512030659-23bb92c1eb97 // indirect github.com/sagernet/sing-shadowtls v0.1.2-0.20230417103049-4f682e05f19b // indirect diff --git a/go/cmd/nekobox_core/go.sum b/go/cmd/nekobox_core/go.sum index 4909e42..ed7f1ef 100644 --- a/go/cmd/nekobox_core/go.sum +++ b/go/cmd/nekobox_core/go.sum @@ -135,12 +135,12 @@ github.com/sagernet/reality v0.0.0-20230406110435-ee17307e7691 h1:5Th31OC6yj8byL github.com/sagernet/reality v0.0.0-20230406110435-ee17307e7691/go.mod h1:B8lp4WkQ1PwNnrVMM6KyuFR20pU8jYBD+A4EhJovEXU= github.com/sagernet/sing v0.0.0-20220817130738-ce854cda8522/go.mod h1:QVsS5L/ZA2Q5UhQwLrn0Trw+msNd/NPGEhBKR/ioWiY= github.com/sagernet/sing v0.1.8/go.mod h1:jt1w2u7lJQFFSGLiRrRIs5YWmx4kAPfWuOejuDW9qMk= -github.com/sagernet/sing v0.2.5-0.20230512033628-9be7806bab51 h1:ySJuouhl890pBZly51Hkb2mbDnz+qSQCLF5j+4IFHis= -github.com/sagernet/sing v0.2.5-0.20230512033628-9be7806bab51/go.mod h1:Ta8nHnDLAwqySzKhGoKk4ZIB+vJ3GTKj7UPrWYvM+4w= +github.com/sagernet/sing v0.2.5-0.20230517124404-be6013893626 h1:2TlOqs05+PXadWOubVBhXM27/UaI1If2k/ISjtYZiPE= +github.com/sagernet/sing v0.2.5-0.20230517124404-be6013893626/go.mod h1:Ta8nHnDLAwqySzKhGoKk4ZIB+vJ3GTKj7UPrWYvM+4w= github.com/sagernet/sing-dns v0.1.5-0.20230426113254-25d948c44223 h1:L4eMuM07iSHY3UCknFnuFuHoe5clZuF2Xnf2wwA6Lwc= github.com/sagernet/sing-dns v0.1.5-0.20230426113254-25d948c44223/go.mod h1:ZKuuqgsHRxDahYrzgSgy4vIAGGuKPlIf4hLcNzYzLkY= -github.com/sagernet/sing-mux v0.0.0-20230425130511-b0a6ffd8406f h1:iEpOTgBTjt0vZJVXMTqYq13XyIu/337TWbq6WZ3CMWc= -github.com/sagernet/sing-mux v0.0.0-20230425130511-b0a6ffd8406f/go.mod h1:pF+RnLvCAOhECrvauy6LYOpBakJ/vuaF1Wm4lPsWryI= +github.com/sagernet/sing-mux v0.0.0-20230517134606-1ebe6bb26646 h1:X3ADfMqeGns1Q1FlXc9kaL9FwW1UM6D6tEQo8jFstpc= +github.com/sagernet/sing-mux v0.0.0-20230517134606-1ebe6bb26646/go.mod h1:pF+RnLvCAOhECrvauy6LYOpBakJ/vuaF1Wm4lPsWryI= github.com/sagernet/sing-shadowsocks v0.2.2-0.20230509053848-d83f8fe1194c h1:EiQ+i4gdPpSI8D2YUlOeBZA3R1ZGi0ShSLSXoSd/13A= github.com/sagernet/sing-shadowsocks v0.2.2-0.20230509053848-d83f8fe1194c/go.mod h1:UJjvQGw0lyYaDGIDvUraL16fwaAEH1WFw1Y6sUcMPog= github.com/sagernet/sing-shadowsocks2 v0.0.0-20230512030659-23bb92c1eb97 h1:Mc5dbIMFF3ph3JofkBv3loq1qdBLktER+LL0IpoLm5M= diff --git a/libs/get_source_env.sh b/libs/get_source_env.sh index c714507..c67384e 100644 --- a/libs/get_source_env.sh +++ b/libs/get_source_env.sh @@ -1,5 +1,5 @@ if [ ! -z $ENV_NEKORAY ]; then - export COMMIT_SING_BOX_EXTRA="d663cfa6b9f721d306ec3972460b61bb2c935685" + export COMMIT_SING_BOX_EXTRA="e7c37b1587c38841f4eb687249a43dab421d8eff" export COMMIT_MATSURI_V2RAY="8134d3cc23aa6b8e2a056887addf22d7d22bd969" fi diff --git a/sys/ExternalProcess.cpp b/sys/ExternalProcess.cpp index de5cea2..b19afe7 100644 --- a/sys/ExternalProcess.cpp +++ b/sys/ExternalProcess.cpp @@ -101,7 +101,7 @@ namespace NekoRay::sys { if (failed_to_start) return; // no retry restart_id = NekoRay::dataStore->started_id; - MW_dialog_message("ExternalProcess", "Crashed"); + MW_dialog_message("ExternalProcess", "CoreCrashed"); MW_show_log("[Error] " + QObject::tr("Core exited, restarting.")); // Restart diff --git a/ui/mainwindow.cpp b/ui/mainwindow.cpp index 5151b71..dc9ba9e 100644 --- a/ui/mainwindow.cpp +++ b/ui/mainwindow.cpp @@ -47,7 +47,7 @@ #include QElapsedTimer coreRestartTimer; -QAtomicInt logCounter; +// QAtomicInt logCounter; void UI_InitMainWindow() { mainwindow = new MainWindow; @@ -151,10 +151,10 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWi runOnUiThread([=] { show_log_impl(cleanVT100String(log)); }); }; // - auto logCounterTimer = new QTimer(this); - connect(logCounterTimer, &QTimer::timeout, this, [&] { logCounter.fetchAndStoreRelaxed(0); }); - logCounterTimer->setInterval(1000); - logCounterTimer->start(); + // auto logCounterTimer = new QTimer(this); + // connect(logCounterTimer, &QTimer::timeout, this, [&] { logCounter.fetchAndStoreRelaxed(0); }); + // logCounterTimer->setInterval(1000); + // logCounterTimer->start(); // table UI ui->proxyListTable->callback_save_order = [=] { @@ -571,10 +571,11 @@ void MainWindow::dialog_message_impl(const QString &sender, const QString &info) } else if (sender == "ExternalProcess") { if (info == "Crashed") { neko_stop(); + } else if (info == "CoreCrashed") { + neko_stop(true); } else if (info.startsWith("CoreRestarted")) { if (coreRestartTimer.isValid()) { - auto elasped = coreRestartTimer.restart(); - if (elasped < 10 * 1000) { + if (coreRestartTimer.restart() < 10 * 1000) { coreRestartTimer = QElapsedTimer(); show_log_impl("[Error] " + tr("Core exits too frequently, stop automatic restart this profile.")); return; @@ -677,7 +678,10 @@ void MainWindow::on_menu_exit_triggered() { QDir::setCurrent(QApplication::applicationDirPath()); auto arguments = NekoRay::dataStore->argv; - if (arguments.length() > 0) arguments.removeFirst(); + if (arguments.length() > 0) { + arguments.removeFirst(); + arguments.removeAll("-tray"); + } auto isLauncher = qEnvironmentVariable("NKR_FROM_LAUNCHER") == "1"; if (isLauncher) arguments.prepend("--"); auto program = isLauncher ? "./launcher" : QApplication::applicationFilePath(); @@ -1493,7 +1497,7 @@ void MainWindow::show_log_impl(const QString &log) { if (showThisLine) newLines << line; } if (newLines.isEmpty()) return; - if (logCounter.fetchAndAddRelaxed(newLines.count()) > NekoRay::dataStore->max_log_line) return; + // if (logCounter.fetchAndAddRelaxed(newLines.count()) > NekoRay::dataStore->max_log_line) return; FastAppendTextDocument(newLines.join("\n"), qvLogDocument); // qvLogDocument->setPlainText(qvLogDocument->toPlainText() + log);