mirror of
https://git.ngram.ca/OpenJam/rc-servers
synced 2026-08-23 23:08:52 +00:00
Implement loading of cube data from JSON file
This commit is contained in:
@@ -4,6 +4,7 @@ mod state;
|
||||
mod data;
|
||||
mod events;
|
||||
mod operations;
|
||||
mod persist;
|
||||
|
||||
use polariton_auth::Handshake;
|
||||
use tokio::net;
|
||||
@@ -13,13 +14,21 @@ use polariton::operation::{OperationResponse, Typed};
|
||||
|
||||
pub type UserTy = std::sync::RwLock<state::UserState>;
|
||||
|
||||
pub struct InitConfig {
|
||||
pub cubes: persist::config::CubeConfig,
|
||||
}
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() -> std::io::Result<()> {
|
||||
env_logger::init();
|
||||
let args = cli::CliArgs::get();
|
||||
log::debug!("Got cli args {:?}", args);
|
||||
|
||||
let server = polariton_server::Server::new(operations::handler());
|
||||
let init_ctx = InitConfig {
|
||||
cubes: persist::config::CubeConfig::load(&args.assets).expect("Bad cube config data"),
|
||||
};
|
||||
|
||||
let server = polariton_server::Server::new(operations::handler(&init_ctx));
|
||||
|
||||
let ip_addr: std::net::IpAddr = args.ip.parse().expect("Invalid IP address");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user