Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,28 @@
Все заметные изменения проекта. Формат — [Keep a Changelog](https://keepachangelog.com/ru/1.1.0/),
версии — [SemVer](https://semver.org/lang/ru/).

## [2.3.3] — 2026-12-03

flowseal-zapret 2.0.0 снова скачивается и работает: приложение понимает новый движок обхода.

### Добавлено

- Настройка «YouTube через WebSocket»: три режима на случай, когда YouTube открывается
нестабильно. По умолчанию — обычный.

### Исправлено

- Обновление flowseal-zapret 2.0.0 больше не заканчивается ошибкой «Скачанный архив не содержит
корректный runtime».
- Обход запускается и на новом движке, и на прежнем — откат на старую версию остаётся рабочим.
- Проверка и подбор стратегий работают с 2.0.0; неподходящие профили отсекаются до запуска службы,
а не оставляют её упавшей.
- Если сохранённая стратегия исчезла из нового релиза, включается «general», а не остаётся пустота.

### Удалено

- Обход Flashscore: отдельные профили для этих сайтов больше не добавляются к стратегиям.

## [2.3.2] — 2026-11-25

VPN больше не остаётся выключенным после перезагрузки, если системе помешал нужный ему порт.
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,10 @@ VPN и Telegram настраиваются отдельно и не нужны
проверки») по умолчанию выключено — включает пользователь.
- **Обновление flowseal-zapret** из GitHub. Ваши списки `*-user.txt` и собственные `.bat`
сохраняются, правки в официальных файлах — нет: их заменяет новая версия.
- **Новый движок zapret 2.0.0** поддерживается наравне с прежним; старая версия остаётся рабочим
вариантом отката.
- **YouTube через WebSocket** — настройка для случаев, когда YouTube открывается нестабильно:
DPI режет WebSocket-потоки по размеру окна. По умолчанию включён обычный режим, отключается там же.
- Если после применения обход перестал работать, приложение через минуту вернёт прежнюю
стратегию.

Expand Down
16 changes: 8 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "splitline",
"private": true,
"version": "2.3.2",
"version": "2.3.3",
"description": "Windows 10/11 GUI manager for flowseal-zapret (zapret-discord-youtube by Flowseal)",
"author": "Dezuron",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion src-tauri/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "zapret-ui"
version = "2.3.2"
version = "2.3.3"
description = "Windows 10/11 GUI manager for flowseal-zapret (zapret-discord-youtube by Flowseal)"
authors = ["Dezuron"]
license = "MIT"
Expand Down
27 changes: 17 additions & 10 deletions src-tauri/src/bench.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,27 +108,34 @@ pub struct BenchSummary {
}

/// Everything the bench needs from the outside world. The production harness
/// spawns `winws.exe` and shells out to `curl`; tests substitute a fake one.
/// spawns the engine (`winws.exe` or `winws2.exe`) and shells out to `curl`;
/// tests substitute a fake one.
pub trait Harness {
fn start(&self, args: &[String]) -> Result<(), String>;
fn stop(&self);
fn probe(&self, targets: &[Target], timeout: Duration) -> Vec<HostProbe>;
}

/// Production harness: runs each candidate as a short-lived `winws.exe` process
/// instead of reinstalling the Windows service for every strategy.
/// Production harness: runs each candidate as a short-lived engine process
/// (`winws.exe` on 1.x, `winws2.exe` on 2.0.0+) instead of reinstalling the
/// Windows service for every strategy.
pub struct WinwsHarness {
pub exe: String,
/// Engine file name, used in user-facing progress errors.
pub label: String,
}

impl WinwsHarness {
pub fn new(runtime_dir: &std::path::Path) -> Self {
let path = crate::runtime::engine_binary(runtime_dir)
.unwrap_or_else(|| runtime_dir.join("bin").join(crate::runtime::LEGACY_ENGINE));
let label = path
.file_name()
.map(|name| name.to_string_lossy().to_string())
.unwrap_or_else(|| "движок обхода".to_string());
Self {
exe: runtime_dir
.join("bin")
.join("winws.exe")
.to_string_lossy()
.to_string(),
exe: path.to_string_lossy().to_string(),
label,
}
}
}
Expand All @@ -139,12 +146,12 @@ impl Harness for WinwsHarness {
crate::engine::Engine::kill_by_image();
crate::engine::Engine::spawn_transient(&self.exe, args)?;
if !crate::engine::Engine::wait_winws_ready(Duration::from_secs(3)) {
return Err("winws.exe не запустился".into());
return Err(format!("{} не запустился", self.label));
}
// Give the driver a moment to attach its filters before probing.
std::thread::sleep(Duration::from_millis(500));
if !crate::engine::Engine::is_any_winws_running() {
return Err("winws.exe завершился сразу после запуска".into());
return Err(format!("{} завершился сразу после запуска", self.label));
}
Ok(())
}
Expand Down
45 changes: 23 additions & 22 deletions src-tauri/src/bench_live_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,27 +25,27 @@ mod tests {
dir: PathBuf,
previous: String,
game_filter: GameFilter,
flashscore: bool,
youtube_ws: crate::config::YoutubeWsMode,
}

impl Drop for ServiceRestore {
fn drop(&mut self) {
engine::Engine::kill_by_image();
std::thread::sleep(Duration::from_millis(300));
let Some(found) = strategy::discover_strategies(&self.dir, self.game_filter)
.into_iter()
.find(|s| s.name == self.previous || s.file_name == self.previous)
let Some(found) =
strategy::discover_strategies(&self.dir, self.game_filter, self.youtube_ws)
.into_iter()
.find(|s| s.name == self.previous || s.file_name == self.previous)
else {
eprintln!("restore: стратегия «{}» не найдена", self.previous);
return;
};
let args = if self.flashscore {
strategy::with_flashscore_section(&found.args, &self.dir)
} else {
found.args
let args = found.args;
let Some(engine) = crate::runtime::engine_binary(&self.dir) else {
eprintln!("restore: движок обхода не найден");
return;
};
let winws = self.dir.join("bin").join("winws.exe");
match engine::Engine::install(&winws.to_string_lossy(), &args, &found.name) {
match engine::Engine::install(&engine.to_string_lossy(), &args, &found.name) {
Ok(()) => println!(
"restore: служба zapret поднята со стратегией «{}»",
found.name
Expand All @@ -60,7 +60,7 @@ mod tests {
fn live_bench() {
let dir = config::runtime_dir();
assert!(
dir.join("bin").join("winws.exe").exists(),
crate::runtime::engine_binary(&dir).is_some(),
"runtime отсутствует"
);
let cfg = config::load_config();
Expand All @@ -77,24 +77,25 @@ mod tests {
.ok()
.and_then(|value| value.parse().ok())
.unwrap_or(2);
let candidates: Vec<Candidate> = strategy::discover_strategies(&dir, cfg.game_filter)
.into_iter()
.take(limit)
.map(|s| Candidate {
name: s.name,
parent: None,
args: s.args,
source: CandidateSource::Official,
})
.collect();
let candidates: Vec<Candidate> =
strategy::discover_strategies(&dir, cfg.game_filter, cfg.youtube_ws_mode())
.into_iter()
.take(limit)
.map(|s| Candidate {
name: s.name,
parent: None,
args: s.args,
source: CandidateSource::Official,
})
.collect();
assert!(candidates.len() >= 2, "нужно минимум две стратегии");

// Restores the service on success, failure and panic.
let _restore = ServiceRestore {
dir: dir.clone(),
previous: cfg.last_strategy.clone(),
game_filter: cfg.game_filter,
flashscore: cfg.flashscore_bypass,
youtube_ws: cfg.youtube_ws_mode(),
};

let _ = engine::Engine::remove();
Expand Down
14 changes: 10 additions & 4 deletions src-tauri/src/commands.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::autostart;
use crate::bench::{self, BaselineGate, BenchSummary, Candidate, CandidateSource, Verdict};
use crate::config::{self, AppConfig, GameFilter};
use crate::config::{self, AppConfig, GameFilter, YoutubeWsMode};
use crate::engine;
use crate::generator::{self, GeneratedStrategy, Seed};
use crate::lock_config;
Expand Down Expand Up @@ -194,8 +194,12 @@ pub struct ConfigView {
pub autostart: bool,
pub check_updates: bool,
pub check_app_updates: bool,
pub flashscore_bypass: bool,
pub game_filter: String,
/// YouTube-over-WebSocket mode: `disabled`, `ws-fake`, `ws-disorder` or
/// `ws-disorder2`.
pub youtube_ws: String,
/// False for the 1.x runtime, which has no Lua engine and no WS profile.
pub youtube_ws_supported: bool,
pub runtime_version: String,
pub runtime_path: String,
pub theme: String,
Expand Down Expand Up @@ -270,8 +274,9 @@ fn preview_args(args: &[String]) -> String {
pub fn get_state(state: State<'_, AppState>) -> AppResult<AppStatus> {
let cfg = lock_config(&state);
let game_filter = game_filter_of(&cfg);
let youtube_ws = cfg.youtube_ws_mode();
let dir = config::runtime_dir();
let strategies = strategy::discover_strategies(&dir, game_filter);
let strategies = strategy::discover_strategies(&dir, game_filter, youtube_ws);
let current = cfg.last_strategy.clone();
drop(cfg);

Expand Down Expand Up @@ -316,8 +321,9 @@ pub fn get_config(state: State<'_, AppState>) -> AppResult<ConfigView> {
autostart: cfg.autostart,
check_updates: cfg.check_updates,
check_app_updates: cfg.check_app_updates,
flashscore_bypass: cfg.flashscore_bypass,
game_filter: cfg.game_filter.as_str().to_string(),
youtube_ws: cfg.youtube_ws_mode().as_str().to_string(),
youtube_ws_supported: crate::runtime::is_lua_engine(&config::runtime_dir()),
runtime_version: cfg.runtime_version.clone(),
runtime_path: config::runtime_dir().to_string_lossy().to_string(),
theme: cfg.theme.clone(),
Expand Down
18 changes: 9 additions & 9 deletions src-tauri/src/commands/benchmark.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
use super::*;

/// Bench candidates are built from the raw strategy arguments. The Flashscore
/// profiles the app injects at start-up are hostlist-scoped and cannot affect
/// Discord/YouTube, so leaving them out keeps the measured args identical to the
/// parsed `.bat` and avoids injecting them twice into generated candidates.
/// Bench candidates are built from the raw strategy arguments, exactly as the
/// `.bat` files produce them.
fn official_candidates(state: &AppState) -> Vec<Candidate> {
let game_filter = lock_config(state).game_filter;
let cfg = lock_config(state);
let game_filter = cfg.game_filter;
let youtube_ws = cfg.youtube_ws_mode();
drop(cfg);
let dir = config::runtime_dir();
strategy::discover_strategies(&dir, game_filter)
strategy::discover_strategies(&dir, game_filter, youtube_ws)
.into_iter()
.map(|s| Candidate {
name: s.name,
Expand Down Expand Up @@ -56,9 +57,8 @@ fn execute_candidates(
candidates: &[Candidate],
) -> Result<bench::BenchOutcome, String> {
let dir = config::runtime_dir();
let winws = dir.join("bin").join("winws.exe");
if !winws.exists() {
return Err("winws.exe не найден в runtime. Сначала обновите runtime.".into());
if runtime::engine_binary(&dir).is_none() {
return Err("Движок обхода не найден в runtime. Сначала обновите runtime.".into());
}
let targets = probe::load_targets(&dir);
if targets.is_empty() {
Expand Down
22 changes: 18 additions & 4 deletions src-tauri/src/commands/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,14 +100,28 @@ pub fn set_theme(
}

#[tauri::command]
pub fn set_flashscore_bypass(state: State<'_, AppState>, enabled: bool) -> AppResult<()> {
pub fn set_youtube_ws(state: State<'_, AppState>, mode: String) -> AppResult<()> {
ensure_idle(&state)?;
let Some(mode) = YoutubeWsMode::parse(&mode) else {
return Err("Неизвестный режим YouTube WS.".into());
};
let dir = config::runtime_dir();
if !crate::runtime::is_lua_engine(&dir) {
return Err(
"YouTube WS появился в flowseal-zapret 2.0.0 — сначала обновите runtime.".into(),
);
}
{
let mut cfg = lock_config(&state);
cfg.flashscore_bypass = enabled;
cfg.youtube_ws = Some(mode);
config::save_config(&cfg).map_err(|e| e.to_string())?;
}
// Apply immediately so the toggle takes effect without a manual restart.
// The file drives the runtime's own menu. A failure there must not block the
// setting: the app builds strategies from its config, not from this file.
if let Err(err) = crate::youtube_ws::write_mode(&dir, mode) {
eprintln!("youtube-ws: {err}");
}
// Apply immediately so the mode takes effect without a manual restart.
if current_running(&state) {
start_inner(&state, None)?;
}
Expand Down Expand Up @@ -311,11 +325,11 @@ async fn restart_services(
pub fn settings_commands() -> CommandSet {
command_set![
set_game_filter,
set_youtube_ws,
set_autostart,
set_check_updates,
set_runtime_path,
set_theme,
set_flashscore_bypass,
export_settings,
inspect_backup,
import_settings,
Expand Down
Loading