diff --git a/crates/benilla-app/src/capture/realm_list.rs b/crates/benilla-app/src/capture/realm_list.rs index 270314f4..d2c39341 100644 --- a/crates/benilla-app/src/capture/realm_list.rs +++ b/crates/benilla-app/src/capture/realm_list.rs @@ -47,7 +47,10 @@ pub(super) fn seed_realm_list( } match *step { 0 => { - lists.write(crate::net::RealmListMessage { realms: fixture() }); + lists.write(crate::net::RealmListMessage { + realms: fixture(), + failed: false, + }); } 2 => crate::realm_select::open_over_char_select(&mut realms, &choice), 3.. => return, diff --git a/crates/benilla-app/src/char_select/input.rs b/crates/benilla-app/src/char_select/input.rs index c58f3008..fc15b8f5 100644 --- a/crates/benilla-app/src/char_select/input.rs +++ b/crates/benilla-app/src/char_select/input.rs @@ -198,6 +198,7 @@ mod tests { .insert_resource(CharPick(pick_tx)) .insert_resource(RealmChoice(realm_tx)) .add_message::() + .add_message::() .add_message::() .add_systems(PreUpdate, take_input); if list_first { @@ -226,11 +227,21 @@ mod tests { } else { "screen first" }; + assert!( + !app.world().resource::().shown, + "{order}: the list's Cancel ran" + ); assert!( realm_rx .try_iter() - .any(|r| matches!(r, RealmRequest::Abandon)), - "{order}: the list's Cancel ran" + .all(|r| matches!(r, RealmRequest::Refresh)), + "{order}: and over character select it closes nothing" + ); + assert!( + app.world() + .resource::>() + .is_empty(), + "{order}: nor ends the login" ); assert_eq!( *app.world().resource::>().get(), diff --git a/crates/benilla-app/src/login/mod.rs b/crates/benilla-app/src/login/mod.rs index 07c2acf7..fd117e21 100644 --- a/crates/benilla-app/src/login/mod.rs +++ b/crates/benilla-app/src/login/mod.rs @@ -180,16 +180,22 @@ impl Attempt<'_> { } } -/// What the stock glue screens ask of the login engine, past the glue manager's own guards -/// ([`crate::ui_script::glue_mgr`]). +/// What the glue screens ask of the login engine: the stock ones past the glue manager's own +/// guards ([`crate::ui_script::glue_mgr`]), and the native realm list's Cancel over login. #[derive(Message)] pub(crate) enum GlueLogin { /// `CGlueMgr::Login` (`0x46afb0`) reaching `ClientServices`' logon (`0x5ab4b0`): one attempt, - /// typed, with the screen's credentials. + /// typed, with the screen's credentials. It supersedes a logon still parked at the realm list, + /// as the reference starts the next logon whatever link the last one left. Submit { account: String, password: String }, - /// The status dialog's Cancel during the logon (`0x5b3320`) or the world connect (`0x5aaa50` - /// with `RESPONSE_CANCELLED`): the attempt in flight is dropped and nothing resubmits. + /// `CLoginMgr::Cancel` (`0x5b3320`): the status dialog's Cancel during the logon, and + /// `RealmListDialogCancelled` on the login screen. The attempt in flight is dropped, the + /// realmd link closes, and nothing resubmits. Abandon, + /// The status dialog's Cancel during the world connect, which completes it + /// `RESPONSE_CANCELLED` (`0x46b754`); the failure arm then drops the world socket alone + /// (`0x46befd`, `0x5ab1a0`), so the attempt in flight ends and the realmd link stays up. + CancelWorld, /// `DisconnectFromServer` (`0x46d340`): the world session dropped if there is one, then the /// logon cancelled, as select's Back drops the parked session. Disconnect, @@ -205,26 +211,22 @@ pub(crate) fn answer_glue( mut asks: MessageReader, mut attempt: Attempt, pick: Option>, + realm: Option>, state: Res>, time: Res