4 use cgmath::{Deg, Point3};
5 use std::collections::HashMap;
8 #[derive(Debug, Clone)]
11 Media(HashMap<String, Vec<u8>>, bool),
12 NodeDefs(HashMap<u16, mt_net::NodeDef>),
13 MapBlock(Point3<i16>, Box<mt_net::MapBlock>),
14 PlayerPos(Point3<f32>, Deg<f32>, Deg<f32>),
17 #[derive(Debug, Clone)]
19 PlayerPos(Point3<f32>, Deg<f32>, Deg<f32>),
24 println!(include_str!("../assets/ascii-art.txt"));
25 println!("Early WIP. Expext breakage. Trans rights <3");
27 let (net_tx, net_rx) = mpsc::unbounded_channel();
28 let event_loop = winit::event_loop::EventLoopBuilder::<GfxEvent>::with_user_event().build();
29 let event_loop_proxy = event_loop.create_proxy();
31 let runtime = tokio::runtime::Builder::new_multi_thread()
34 .thread_name("network")
38 let net_thread = runtime.spawn(net::run(event_loop_proxy, net_rx));
40 // graphics code is pseudo async: the winit event loop is blocking
41 // so we can't really use async capabilities
42 futures::executor::block_on(gfx::run(event_loop, net_tx));
44 // wait for net to finish
45 runtime.block_on(net_thread).unwrap();