28 lines
593 B
Rust
28 lines
593 B
Rust
mod components;
|
|
mod config;
|
|
mod game;
|
|
mod network;
|
|
mod systems;
|
|
|
|
use crate::config::Settings;
|
|
use crate::game::Game;
|
|
use crate::network::listen_websocket;
|
|
use actix::prelude::*;
|
|
use env_logger::Env;
|
|
|
|
#[actix_rt::main]
|
|
async fn main() {
|
|
let env = Env::default().filter_or("LOG_LEVEL", "info");
|
|
env_logger::init_from_env(env);
|
|
|
|
let settings = Settings::new().unwrap();
|
|
|
|
let game = Game::new().start();
|
|
|
|
listen_websocket(settings.bind, game).await;
|
|
|
|
tokio::signal::ctrl_c().await.unwrap();
|
|
log::info!("Ctrl-C received, shutting down");
|
|
System::current().stop();
|
|
}
|