fix: show-mode RDM step bounds scale with HOSTDEMO_KNOWN length (was hardcoded 3)

This commit is contained in:
Tony Cao 2026-09-11 21:18:57 +08:00
parent ac2fed8ee4
commit a1c413618c

View File

@ -595,14 +595,15 @@ pub fn run(target: &str, bind_ip: &str, secs: u64) {
let mut cc = 0x10u8;
match step {
0 => { pid = 0x0003; }
1..=3 => {
let v = uid_u64(&known[step - 1]);
s if s <= known.len() => {
let v = uid_u64(&known[s - 1]);
pd.extend_from_slice(&u64_uid(v - 1));
pd.extend_from_slice(&u64_uid(v + 1));
}
_ => {
if (step - 4) < known.len() { dest = known[step - 4]; pid = 0x0060; cc = 0x20; }
else { step = 3; }
let gi = step - known.len() - 1; // GET 阶段索引
if gi < known.len() { dest = known[gi]; pid = 0x0060; cc = 0x20; }
else { step = known.len(); } // 回到首个 GET 步循环
}
}
let tn = (step * 7 + 1) as u8;