Phase 8: sessions of another protocol are refused by compat; Phase 7 live profiles carry progression

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
ДмитрийandClaude Sonnet 5.5 committed 2026-10-07 11:19:16 +05:00
1 parent c2e4634367
commit 9009550510
3 files changed
+22 -5

No files matched your search

+17 -1
View File
@@ -187,7 +187,9 @@ pub fn evaluate(i: &Inputs<'_>) -> CompatibilityReport {
}
if i.operation == Operation::RuntimeSession {
if content.supports(Feature::RuntimeSessions) {
if content.supports(Feature::RuntimeSessions) && content.session_protocol != super::session::protocol::PROTOCOL_VERSION {
out.push(Outcome::Blocking { topic: Topic::RuntimeSessions, reason: format!("the realm's Host speaks session protocol {} and this Owner speaks {}: neither reads the other's messages", content.session_protocol, super::session::protocol::PROTOCOL_VERSION) });
} else if content.supports(Feature::RuntimeSessions) {
out.push(Outcome::Compatible(Topic::RuntimeSessions));
} else {
out.push(Outcome::Blocking { topic: Topic::RuntimeSessions, reason: "the realm has no portable session support (the core's session table or switch is missing)".into() });
@@ -338,6 +340,20 @@ mod tests {
.unwrap()
}
#[test]
fn a_host_of_another_session_protocol_is_refused_before_a_character_is_armed() {
let model = geared_level_eighty();
let mut content = profile(&all(), &[2]).content;
let ok = RealmCapabilities::build(None, content.clone(), profile(&all(), &[2]).progression).unwrap();
assert_eq!(run(Operation::RuntimeSession, &model, &ok, None, &[], None).verdict(), Verdict::Compatible);
content.session_protocol = 1;
let old = RealmCapabilities::build(None, content, profile(&all(), &[2]).progression).unwrap();
let r = run(Operation::RuntimeSession, &model, &old, None, &[], None);
assert_eq!(r.verdict(), Verdict::Incompatible);
assert!(r.blocking()[0].to_string().contains("session protocol 1"));
assert_eq!(run(Operation::Update, &model, &old, None, &[], None).verdict(), Verdict::Compatible, "only sessions depend on it");
}
fn all() -> Vec<Feature> {
vec![Feature::RuntimeSessions, Feature::Wardrobe, Feature::Collections]
}
@@ -28,19 +28,20 @@ fn caps(marker: u8, features: &[Feature], jobs: &[u32], ruleset: Ruleset, readab
let mut catalog = ClientCatalog::new();
catalog.insert("Appearances.dbc".into(), CatalogEntry { sha256: format!("{marker:02x}").repeat(32), records: 9 });
Arc::new(
RealmCapabilities::new(
RealmCapabilities::build(
None,
ContentProfile {
ruleset,
character_formats: CharacterFormats { readable, writable: FormatRange::single(2) },
online_import_job_formats: jobs.to_vec(),
session_protocol: 1,
collection_protocol: 1,
session_protocol: 2,
collection_protocol: 2,
features: features.iter().copied().collect(),
collection_kinds: ["coa:appearance".to_string(), "coa:vanity".to_string()].into_iter().collect(),
extensions: vec![],
client_catalog: catalog,
},
Some(crate::portable::capabilities::Progression { max_player_level: 80, projection_protocol: 1, projection_policy_version: 1, progression_signature: "ee".repeat(32), scaling_enabled: true }),
)
.unwrap(),
)
@@ -467,7 +467,7 @@ fn the_core_reports_what_it_is_the_manager_evaluates_before_it_writes_and_the_co
let id = make(&r, &mut store, profile, 1005);
let mut other = caps.content.clone();
other.online_import_job_formats = vec![3];
let other = RealmCapabilities::new(None, other).unwrap();
let other = RealmCapabilities::build(None, other, caps.progression.clone()).unwrap();
let mut o = opts();
o.capabilities = Some(std::sync::Arc::new(other));
let before = number(&r.b, "SELECT COUNT(*) FROM acore_characters.characters");