schematic download
This commit is contained in:
parent
c4e7ac9f8b
commit
f9531a6961
2 changed files with 11 additions and 1 deletions
|
@ -44,3 +44,4 @@ memoize = "0.4.2"
|
||||||
tracing-appender = "0.2.3"
|
tracing-appender = "0.2.3"
|
||||||
ron = "0.8.1"
|
ron = "0.8.1"
|
||||||
crossbeam = "0.8.3"
|
crossbeam = "0.8.3"
|
||||||
|
reqwest = "0.11.23"
|
||||||
|
|
|
@ -104,7 +104,16 @@ async fn omni_inner(state: SharedControl, req: GoogleOmniForm) -> anyhow::Result
|
||||||
let mut schedule = state.tasks.lock().await;
|
let mut schedule = state.tasks.lock().await;
|
||||||
let position = { Vec3::new(req.x.parse()?,req.y.parse()?,req.z.parse()?) };
|
let position = { Vec3::new(req.x.parse()?,req.y.parse()?,req.z.parse()?) };
|
||||||
match req.operation {
|
match req.operation {
|
||||||
GoogleOmniFormMode::Schematic => Err(anyhow!("unimplemented"))?,
|
GoogleOmniFormMode::Schematic => {
|
||||||
|
let schematic = req.schematic.context("no schematic uploaded")?.get(0).context("zero schematics")?.to_owned();
|
||||||
|
let schematic = reqwest::get(format!("https://docs.google.com/uc?export=download&id={schematic}")).await?;
|
||||||
|
|
||||||
|
let schematic = rustmatica::Litematic::from_bytes(&schematic.bytes().await?)?;
|
||||||
|
|
||||||
|
info!("schematic \"{}\" downloaded", &schematic.name);
|
||||||
|
info!("{} blocks", schematic.total_blocks());
|
||||||
|
info!("{} regions", schematic.regions.len());
|
||||||
|
},
|
||||||
GoogleOmniFormMode::RemoveVein => {
|
GoogleOmniFormMode::RemoveVein => {
|
||||||
let block = req.block.context("missing block name")?;
|
let block = req.block.context("missing block name")?;
|
||||||
info!("new remove {block} command from the internet at {position}");
|
info!("new remove {block} command from the internet at {position}");
|
||||||
|
|
Loading…
Reference in a new issue