40 lines
715 B
Rust
40 lines
715 B
Rust
#[macro_use]
|
|
extern crate serde;
|
|
|
|
extern crate serde_json;
|
|
|
|
extern crate image;
|
|
extern crate lovecraft;
|
|
|
|
extern crate sha2;
|
|
|
|
pub mod model;
|
|
pub mod search;
|
|
pub mod persistency;
|
|
pub mod protocol;
|
|
use protocol::*;
|
|
|
|
mod server_state;
|
|
use server_state::*;
|
|
|
|
use std::path::*;
|
|
|
|
fn main() -> std::io::Result<()> {
|
|
lovecraft::invoke();
|
|
|
|
let data_path = Path::new("./data");
|
|
println!("loading files from {:?}", data_path);
|
|
let server_state = ServerState::new(data_path)?;
|
|
|
|
let network_conf = ProtocolConfig::default();
|
|
|
|
println!(
|
|
"listening on {}:{}",
|
|
network_conf.listen_addr, network_conf.port
|
|
);
|
|
|
|
self::protocol::listen_forever(server_state, &network_conf)?;
|
|
|
|
Ok(())
|
|
}
|