|
|
@ -13,7 +13,7 @@ use std::thread; |
|
|
|
use std::time::SystemTime;
|
|
|
|
use log::{info};
|
|
|
|
|
|
|
|
use patch::patch::{PatchServerState, generate_patch_tree, load_config};
|
|
|
|
use patch::patch::{PatchServerState, generate_patch_tree, load_config, load_motd};
|
|
|
|
use login::login::LoginServerState;
|
|
|
|
use login::character::CharacterServerState;
|
|
|
|
use ship::ship::ShipServerState;
|
|
|
@ -47,7 +47,7 @@ fn setup_logger() { |
|
|
|
.chain(std::io::stdout());
|
|
|
|
let fileout = fern::Dispatch::new()
|
|
|
|
.level(log::LevelFilter::Trace)
|
|
|
|
.chain(fern::log_file(format!("elseware-{}.log", chrono::Local::now().format("%Y-%m-%d %H:%M:%S"))).unwrap());
|
|
|
|
.chain(fern::log_file(format!("elseware-{}.log", chrono::Local::now().format("%Y-%m-%d_%H:%M:%S"))).unwrap());
|
|
|
|
fern::Dispatch::new()
|
|
|
|
.chain(stdio)
|
|
|
|
.chain(fileout)
|
|
|
@ -83,8 +83,9 @@ fn main() { |
|
|
|
let patch_thread = thread::spawn(|| {
|
|
|
|
info!("[patch] starting server");
|
|
|
|
let patch_config = load_config();
|
|
|
|
let patch_motd = load_motd();
|
|
|
|
let (patch_file_tree, patch_file_lookup) = generate_patch_tree(patch_config.path.as_str());
|
|
|
|
let patch_state = PatchServerState::new(patch_file_tree, patch_file_lookup);
|
|
|
|
let patch_state = PatchServerState::new(patch_file_tree, patch_file_lookup, patch_motd);
|
|
|
|
common::mainloop::mainloop(patch_state, patch_config.port);
|
|
|
|
});
|
|
|
|
let thread_entity_gateway = entity_gateway.clone();
|
|
|
|