75 lines
1.4 KiB
Rust
75 lines
1.4 KiB
Rust
extern crate rand;
|
|
extern crate uuid;
|
|
extern crate bcrypt;
|
|
extern crate chrono;
|
|
|
|
extern crate dotenv;
|
|
extern crate postgres;
|
|
extern crate r2d2;
|
|
extern crate r2d2_postgres;
|
|
extern crate fallible_iterator;
|
|
|
|
extern crate actix;
|
|
extern crate actix_web;
|
|
extern crate actix_web_actors;
|
|
|
|
extern crate serde;
|
|
extern crate serde_cbor;
|
|
#[macro_use] extern crate serde_derive;
|
|
#[macro_use] extern crate failure;
|
|
|
|
extern crate fern;
|
|
#[macro_use] extern crate log;
|
|
|
|
extern crate stripe;
|
|
|
|
mod account;
|
|
mod construct;
|
|
mod effect;
|
|
mod game;
|
|
mod instance;
|
|
mod item;
|
|
mod mob;
|
|
mod mtx;
|
|
mod names;
|
|
mod net;
|
|
mod player;
|
|
mod pubsub;
|
|
mod rpc;
|
|
mod skill;
|
|
mod spec;
|
|
mod util;
|
|
mod vbox;
|
|
mod warden;
|
|
mod ws;
|
|
|
|
use dotenv::dotenv;
|
|
use net::{start};
|
|
|
|
fn setup_logger() -> Result<(), fern::InitError> {
|
|
fern::Dispatch::new()
|
|
.format(|out, message, record| {
|
|
out.finish(format_args!(
|
|
"{}[{}][{}] {}",
|
|
chrono::Local::now().format("[%Y-%m-%d][%H:%M:%S]"),
|
|
record.target(),
|
|
record.level(),
|
|
message
|
|
))
|
|
})
|
|
.level_for("postgres", log::LevelFilter::Info)
|
|
.level(log::LevelFilter::Info)
|
|
.chain(std::io::stdout())
|
|
.chain(fern::log_file("log/mnml.log")?)
|
|
.apply()?;
|
|
Ok(())
|
|
}
|
|
|
|
fn main() {
|
|
dotenv().ok();
|
|
setup_logger().unwrap();
|
|
|
|
info!("server started");
|
|
start()
|
|
}
|