summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLizzy Fleckenstein <eliasfleckenstein@web.de>2023-05-28 10:20:40 +0200
committerLizzy Fleckenstein <eliasfleckenstein@web.de>2023-05-28 10:20:40 +0200
commitcf5df4b9241e775d4ad559833f92c442ac7cbee1 (patch)
tree97625071c5005fa6b026e3b0332bb2d0acf3d6c6 /src
parent88e92399052c89e23ff2125462053ea85d8b6c53 (diff)
downloadtexmodbot-cf5df4b9241e775d4ad559833f92c442ac7cbee1.tar.xz
Scrape textures from object messages
Diffstat (limited to 'src')
-rw-r--r--src/main.rs21
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}");
}