initial code

This commit is contained in:
Nova
2022-11-26 18:52:29 -05:00
parent 53fb160d10
commit 4d170bc8b9
7 changed files with 1268 additions and 0 deletions

25
src/main.rs Normal file
View File

@@ -0,0 +1,25 @@
mod protostar;
use manifest_dir_macros::directory_relative_path;
use protostar::ProtoStar;
use stardust_xr_molecules::fusion::client::Client;
use std::{env::args, path::PathBuf, str::FromStr};
#[tokio::main(flavor = "current_thread")]
async fn main() {
let (client, event_loop) = Client::connect_with_async_loop().await.unwrap();
client.set_base_prefixes(&[directory_relative_path!("res")]);
let _root = client.wrap_root(ProtoStar::new(
&client,
PathBuf::from_str(&args().nth(2).unwrap()).unwrap(),
0.1,
PathBuf::from_str(&args().nth(1).unwrap()).unwrap(),
));
tokio::select! {
_ = tokio::signal::ctrl_c() => Ok(()),
_ = event_loop => Err(anyhow::anyhow!("Server crashed")),
}
.unwrap();
}