add logging and serde rename things
This commit is contained in:
parent
d4cf718214
commit
a3375c53a4
2 changed files with 7 additions and 2 deletions
|
@ -3,6 +3,7 @@ use std::{net::IpAddr, fs::OpenOptions};
|
|||
use serde::Deserialize;
|
||||
|
||||
#[derive(Deserialize, PartialEq, Eq)]
|
||||
#[serde(rename_all="lowercase")]
|
||||
pub enum LoginMode {
|
||||
Offline,
|
||||
Velocity,
|
||||
|
|
|
@ -4,12 +4,12 @@ use std::io::Write;
|
|||
|
||||
use chrono::Utc;
|
||||
use env_logger::Env;
|
||||
use log::info;
|
||||
use log::{info, warn};
|
||||
use mlua::Lua;
|
||||
use network::NetworkServer;
|
||||
use plugins::Plugins;
|
||||
|
||||
use crate::config::load_config;
|
||||
use crate::config::{load_config, LoginMode};
|
||||
|
||||
mod config;
|
||||
mod plugins;
|
||||
|
@ -43,6 +43,10 @@ fn main() {
|
|||
info!("Starting Quectocraft version {}", VERSION);
|
||||
|
||||
let config = load_config().expect("Failed to load config");
|
||||
match config.login {
|
||||
LoginMode::Offline => warn!("Running in offline mode!"),
|
||||
LoginMode::Velocity => info!("Running in velocity mode"),
|
||||
}
|
||||
|
||||
let lua = Lua::new();
|
||||
let mut plugins = Plugins::new(&lua).expect("Error initializing lua environment");
|
||||
|
|
Loading…
Reference in a new issue