From d404e4e9e4fa1cafbe63eb9a45c10730a62adda5 Mon Sep 17 00:00:00 2001 From: Sam Sung <51686767+samwhosung@users.noreply.github.com> Date: Fri, 16 Oct 2026 17:03:33 +0700 Subject: [PATCH] The stock glue screens are the default; native ones are dev-only (#1462) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The stock 1.12 GlueXML screens are now the default in every build: login, realm list, character select and create. benilla's native screens run only in a dev build with `WOW_GLUE_NATIVE=1`, or under the rig and capture runs, which still drive them, until the native screens are deleted. `WOW_GLUE_STOCK` is gone. On the way: - An unattended reconnect re-dials the kept realm and lists the roster. Under the stock screens it stalled at the realm list. - `WOW_CHARSELECT_PICK` selects on the stock screen. - `smoke.sh` counts the stock run's VMs and fonts. The stock screens fix the native screens' defects listed below. Tests cover the switch, the pick and the reconnect. Live: smoke, a kick and re-entry, the player build's boot. Part of #856. Fixes #849 Fixes #850 Fixes #834 Fixes #812 Fixes #360 Fixes #463 Fixes #79 Fixes #977 πŸ€– Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 5.5 --- crates/benilla-app/src/capture/mod.rs | 41 +---- .../src/capture/probe_charcreate.rs | 6 +- crates/benilla-app/src/capture/probe_env.rs | 2 +- crates/benilla-app/src/capture/probe_rig.rs | 6 +- crates/benilla-app/src/capture/probes/act.rs | 8 +- crates/benilla-app/src/char_create/mod.rs | 2 +- crates/benilla-app/src/char_select/mod.rs | 73 +-------- crates/benilla-app/src/game_plugins.rs | 8 +- crates/benilla-app/src/glue_session/login.rs | 2 +- crates/benilla-app/src/glue_session/mod.rs | 7 + .../benilla-app/src/glue_session/reconnect.rs | 125 ++++++++++++++++ crates/benilla-app/src/glue_session/roster.rs | 56 +++++-- .../benilla-app/src/glue_session/roundtrip.rs | 9 +- crates/benilla-app/src/realm_select/mod.rs | 2 +- crates/benilla-app/src/sound/glue.rs | 2 +- crates/benilla-app/src/ui_script/glue.rs | 140 ++++++++++++++---- crates/benilla-app/src/ui_script/glue_mgr.rs | 4 +- .../src/ui_script/glue_mgr_tests.rs | 35 ++++- crates/benilla-app/src/ui_script/lifecycle.rs | 10 +- crates/benilla-app/src/ui_script/mod.rs | 2 +- .../src/ui_script/world_entry_tests.rs | 22 ++- docs/CONTRIBUTING.md | 3 + docs/DEVIATIONS.md | 2 +- docs/MAP.md | 29 ++-- scripts/smoke.sh | 18 ++- 25 files changed, 411 insertions(+), 203 deletions(-) create mode 100644 crates/benilla-app/src/glue_session/reconnect.rs diff --git a/crates/benilla-app/src/capture/mod.rs b/crates/benilla-app/src/capture/mod.rs index 8c1b60c43..8bc3be136 100644 --- a/crates/benilla-app/src/capture/mod.rs +++ b/crates/benilla-app/src/capture/mod.rs @@ -115,31 +115,6 @@ pub(crate) use probes::{ ProbeGlueLuaPlugin, ProbeHoverPlugin, ProbeKeyPlugin, ProbeLuaPlugin, ProbeResizePlugin, RevealAuditPlugin, SchedCensusPlugin, StallPlugin, TrailCensusPlugin, UnitVisualsPlugin, }; -/// A probe that reads the native screens' rosters (the park's own, and the one re-sent after a -/// create or delete) cannot run under `WOW_GLUE_STOCK=1`, where the screen asks for its own and the -/// probe would sit until its timeout. Refuse it where it is requested: an error at plugin build, -/// and the exit of a driverless run ([`crate::run_mode::fatal_when_driverless`]), at the first -/// frame. `true` means the probe must not install. -pub(crate) fn refuse_under_stock(app: &mut App, probe: &'static str) -> bool { - refuse_if_stock(app, probe, crate::ui_script::glue::GlueStock::from_env().0) -} - -fn refuse_if_stock(app: &mut App, probe: &'static str, stock: bool) -> bool { - if !stock { - return false; - } - error!( - "probe: {probe} reads the native screens' rosters and cannot run under WOW_GLUE_STOCK=1; \ - unset one of them" - ); - if crate::run_mode::fatal_when_driverless(&format!("{probe} under WOW_GLUE_STOCK=1")) { - app.add_systems(Startup, |mut exit: MessageWriter| { - exit.write(AppExit::error()); - }); - } - true -} - pub(crate) use scenarios::ui_opted_in; use scenarios::GlueScreen; use scenarios::{ @@ -1079,14 +1054,14 @@ fn drive_capture( } #[cfg(test)] -mod refuse_tests { - use super::*; - - /// A native-only probe installs under the native screens and is refused under the stock ones. +mod glue_capture_tests { + /// `ui_script::glue` puts the native screens up for a glue capture by its name's `glue-` + /// prefix, so every glue capture carries it and no other capture does. #[test] - fn a_native_only_probe_is_refused_under_the_stock_screens() { - let mut app = App::new(); - assert!(!refuse_if_stock(&mut app, "WOW_RIG", false)); - assert!(refuse_if_stock(&mut app, "WOW_RIG", true)); + fn the_glue_captures_and_only_they_are_named_glue() { + assert!(super::GLUE_SCENARIOS + .iter() + .all(|g| g.name.starts_with("glue-"))); + assert!(!super::SCENARIOS.iter().any(|s| s.name.starts_with("glue-"))); } } diff --git a/crates/benilla-app/src/capture/probe_charcreate.rs b/crates/benilla-app/src/capture/probe_charcreate.rs index 090ad5596..57f3400c7 100644 --- a/crates/benilla-app/src/capture/probe_charcreate.rs +++ b/crates/benilla-app/src/capture/probe_charcreate.rs @@ -3,7 +3,8 @@ //! [`CharRequest::Create`], logs the `SMSG_CHAR_CREATE` result byte, then deletes the new //! character and logs that result too, unless `WOW_PROBE_CHARCREATE_KEEP=1`. Run it without //! `WOW_CHAR`, which would enter the world; the switches are `docs/CONTRIBUTING.md`, "Running it -//! unattended". +//! unattended". It reads the park's own rosters, so it puts the native glue screens up +//! (`ui_script::glue::NATIVE_INSTRUMENTS`). use benilla_protocol::{messages, CharAction, CharCreateReq}; use bevy::prelude::*; @@ -21,9 +22,6 @@ impl Plugin for ProbeCharCreatePlugin { else { return; // inert without a valid env spec }; - if super::refuse_under_stock(app, "WOW_PROBE_CHARCREATE") { - return; - } let keep = std::env::var("WOW_PROBE_CHARCREATE_KEEP").as_deref() == Ok("1"); app.insert_resource(CharCreateProbe { req, diff --git a/crates/benilla-app/src/capture/probe_env.rs b/crates/benilla-app/src/capture/probe_env.rs index 0a43c83d0..0dde079a9 100644 --- a/crates/benilla-app/src/capture/probe_env.rs +++ b/crates/benilla-app/src/capture/probe_env.rs @@ -74,7 +74,7 @@ pub(crate) const PROBE_VARS: &[ProbeVar] = &[ }, ProbeVar { name: "WOW_PROBE_GLUE_LUA", - purpose: "\"\" β€” under WOW_GLUE_STOCK=1, run a Lua chunk once in the stock glue VM (press the login screen's buttons headlessly)", + purpose: "\"\" β€” run a Lua chunk once in the stock glue VM (press the login screen's buttons headlessly)", wall_clock: true, }, ProbeVar { diff --git a/crates/benilla-app/src/capture/probe_rig.rs b/crates/benilla-app/src/capture/probe_rig.rs index 03860fd8c..729d1d0b7 100644 --- a/crates/benilla-app/src/capture/probe_rig.rs +++ b/crates/benilla-app/src/capture/probe_rig.rs @@ -29,6 +29,9 @@ //! the world DB. Applying gear unequips all 19 slots before it equips //! (`ObjectMgr.cpp:12079-12117`), so re-dressing a body leaves the old set in its bags or mailed; //! a fresh rig-named character starts with empty bags. +//! +//! The rig picks, creates and deletes through the park's own rosters, so a rig run puts the +//! native glue screens up (`ui_script::glue::NATIVE_INSTRUMENTS`). use benilla_protocol::{messages, CharAction, CharCreateReq}; use bevy::prelude::*; @@ -73,9 +76,6 @@ impl Plugin for ProbeRigPlugin { else { return; // inert without a parseable spec (parse() has already said why) }; - if super::refuse_under_stock(app, "WOW_RIG") { - return; - } info!("rig: {}", spec.describe()); // Publish the claim on the character pick, so the roster knows the pick is spoken for. if let Some(name) = rig_char_name(&spec) { diff --git a/crates/benilla-app/src/capture/probes/act.rs b/crates/benilla-app/src/capture/probes/act.rs index a1df3de43..601ed37c2 100644 --- a/crates/benilla-app/src/capture/probes/act.rs +++ b/crates/benilla-app/src/capture/probes/act.rs @@ -365,10 +365,10 @@ fn fire_probe_lua( } } -/// `WOW_PROBE_GLUE_LUA=""`: under `WOW_GLUE_STOCK=1`, runs the chunk once in the stock -/// glue VM `WOW_PROBE_GLUE_LUA_AT` seconds (default 10) into the run, to press the login screen's -/// buttons headlessly; `WOW_PROBE_GLUE_SHOT=` then saves one PNG -/// `WOW_PROBE_GLUE_SHOT_AFTER` seconds (default 1) later. The chunk is never logged: it may carry +/// `WOW_PROBE_GLUE_LUA=""`: runs the chunk once in the stock glue VM +/// `WOW_PROBE_GLUE_LUA_AT` seconds (default 10) into the run, to press the login screen's buttons +/// headlessly; `WOW_PROBE_GLUE_SHOT=` then saves one PNG `WOW_PROBE_GLUE_SHOT_AFTER` seconds +/// (default 1) later. The chunk is never logged: it may carry /// a typed password. pub(crate) struct ProbeGlueLuaPlugin; diff --git a/crates/benilla-app/src/char_create/mod.rs b/crates/benilla-app/src/char_create/mod.rs index 278dfcd1e..11c34c308 100644 --- a/crates/benilla-app/src/char_create/mod.rs +++ b/crates/benilla-app/src/char_create/mod.rs @@ -37,7 +37,7 @@ const HORDE: [u8; 4] = [2, 5, 6, 8]; // Orc, Scourge, Tauren, Troll const INITIAL_FACING: f32 = -15.0 * std::f32::consts::PI / 180.0; /// The character-creation screen and its selection state, on the native screens alone: under -/// `WOW_GLUE_STOCK=1` the stock `CharacterCreate` is a glue screen of the glue VM, and the app +/// the stock screens the stock `CharacterCreate` is a glue screen of the glue VM, and the app /// never enters [`ClientState::CharCreate`]. pub(crate) struct CharCreatePlugin; diff --git a/crates/benilla-app/src/char_select/mod.rs b/crates/benilla-app/src/char_select/mod.rs index 0c9634245..77074b009 100644 --- a/crates/benilla-app/src/char_select/mod.rs +++ b/crates/benilla-app/src/char_select/mod.rs @@ -14,13 +14,13 @@ use benilla_protocol::CharAction; use bevy::prelude::*; use crate::client_state::ClientState; -use crate::glue_session::roster::{send_pick, Roster}; +use crate::glue_session::roster::Roster; use crate::glue_strings::GlueStrings; -use crate::net::{CharActionResultMessage, CharPick, CharacterLoginFailedMessage}; +use crate::net::{CharActionResultMessage, CharacterLoginFailedMessage}; /// The native character-select screen. All of it runs on the native screens alone: under -/// `WOW_GLUE_STOCK=1` the stock `CharacterSelect` stands in its place, and the session it shows is +/// the stock screens the stock `CharacterSelect` stands in its place, and the session it shows is /// [`crate::glue_session`]'s. pub(crate) struct CharSelectPlugin; @@ -62,7 +62,6 @@ impl Plugin for CharSelectPlugin { // The one `GlueDialog`: here, the refused login and the refused delete. crate::glue::dialog::drive_glue_dialog, debug_select_addons, - debug_select_walk, addons::drive_addons_panel, refresh::refresh_list, refresh::refresh_banner_and_buttons, @@ -185,72 +184,6 @@ pub(crate) fn char_delete_refusal_text(strings: &GlueStrings, code: u8) -> Optio Some(strings.text(key, fallback)) } -/// The select walk (`WOW_CHARSELECT_WALK=[:]`): select each row in turn, -/// one per `period_s`, logging each step with its time; with `enter_after_s`, press Enter World -/// that long after the last step. -fn debug_select_walk( - mut roster: ResMut, - pick: Res, - time: Res