diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/main.rs | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/main.rs b/src/main.rs index 3ceb289..a5c95da 100644 --- a/src/main.rs +++ b/src/main.rs @@ -65,6 +65,18 @@ impl Bot { } }; + let print_obj_msg = |msg: &mt_net::ObjMsg| { + use mt_net::ObjMsg::*; + match msg { + TextureMod { texture_mod } => print_texture(texture_mod), + Props(props) => { + props.textures.iter().for_each(&mut print_texture); + print_texture(&props.dmg_texture_mod); + } + _ => {} + } + }; + match pkt { NodeDefs(defs) => { defs.0 @@ -94,6 +106,15 @@ impl Bot { self.got_def(DefType::ItemDef); } + ObjMsgs { msgs } => { + msgs.iter().map(|x| &x.msg).for_each(print_obj_msg); + } + ObjRemoveAdd { add, .. } => { + add.iter() + .flat_map(|x| x.init_data.msgs.iter()) + .map(|x| &x.0) + .for_each(print_obj_msg); + } Kick(reason) => { eprintln!("kicked: {reason}"); } |