gamebridge: multiple commands per line
This commit is contained in:
parent
09f51531cc
commit
902c98451b
|
@ -150,7 +150,7 @@ fn main() -> Result<()> {
|
|||
lo = lo | LoButtons::C_RIGHT;
|
||||
}
|
||||
|
||||
println!(
|
||||
debug!(
|
||||
"[ rust] {:02x}{:02x} {:02x}{:02x}",
|
||||
hi.bits(),
|
||||
lo.bits(),
|
||||
|
|
|
@ -82,7 +82,8 @@ async fn run_loop(
|
|||
let mut data = st.write().unwrap();
|
||||
const BUTTON_ADD_AMT: i64 = 64;
|
||||
|
||||
match chatline.as_str() {
|
||||
for cmd in chatline.to_string().split(" ").collect::<Vec<&str>>().iter() {
|
||||
match *cmd {
|
||||
"a" => data.a_button.add(BUTTON_ADD_AMT),
|
||||
"b" => data.b_button.add(BUTTON_ADD_AMT),
|
||||
"z" => data.z_button.add(BUTTON_ADD_AMT),
|
||||
|
@ -99,6 +100,7 @@ async fn run_loop(
|
|||
"stop" => {data.stickx.update(0); data.sticky.update(0);},
|
||||
_ => {},
|
||||
}
|
||||
}
|
||||
|
||||
eprintln!("[{}] {}: {}", msg.channel, msg.name, msg.data);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue