initial code
This commit is contained in:
25
src/main.rs
Normal file
25
src/main.rs
Normal 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();
|
||||
}
|
||||
Reference in New Issue
Block a user