rustfmt
This commit is contained in:
parent
66e82de28f
commit
0a7a4b539a
9 changed files with 2093 additions and 1874 deletions
src
45
src/main.rs
45
src/main.rs
|
@ -1,5 +1,3 @@
|
|||
|
||||
|
||||
// pub mod core;
|
||||
// pub mod modules;
|
||||
//use myLib;
|
||||
|
@ -9,22 +7,21 @@ use std::process::Output;
|
|||
// use crate::core::botinstance::ArcBox;
|
||||
use botLib::core::botinstance::ArcBox;
|
||||
|
||||
use botLib::core::botinstance::{self,BotInstance};
|
||||
use botLib::core::botinstance::{self, BotInstance};
|
||||
// use core::botinstance::{self,BotInstance};
|
||||
|
||||
use casual_logger::Extension;
|
||||
use tokio::sync::RwLock;
|
||||
use std::sync::Arc;
|
||||
use tokio::sync::RwLock;
|
||||
pub type BotAR = Arc<RwLock<BotInstance>>;
|
||||
|
||||
use casual_logger::{Level,Log};
|
||||
use casual_logger::{Level, Log};
|
||||
|
||||
#[tokio::main]
|
||||
pub async fn main() {
|
||||
|
||||
Log::set_file_ext(Extension::Log);
|
||||
Log::set_level(Level::Trace);
|
||||
// Log::set_level(Level::Notice);
|
||||
// Log::set_level(Level::Notice);
|
||||
|
||||
let bot = BotInstance::init().await;
|
||||
|
||||
|
@ -34,28 +31,39 @@ pub async fn main() {
|
|||
let a = a.read().await;
|
||||
// let a = *a;
|
||||
|
||||
for (_,acts) in &*a {
|
||||
for (_, acts) in &*a {
|
||||
for act in acts {
|
||||
match act {
|
||||
botLib::core::botmodules::BotAction::C(b) => {
|
||||
// println!("bot actiions: {}",b.command)
|
||||
// Log::info(&format!("bot actions: {}",b.command));
|
||||
botinstance::botlog::info(&format!("bot actions: {}",b.command), Some("main()".to_string()), None);
|
||||
},
|
||||
botinstance::botlog::info(
|
||||
&format!("bot actions: {}", b.command),
|
||||
Some("main()".to_string()),
|
||||
None,
|
||||
);
|
||||
}
|
||||
botLib::core::botmodules::BotAction::L(l) => {
|
||||
// println!("bot actiions: {}",l.name)
|
||||
// Log::info(&format!("bot actions: {}",l.name));
|
||||
botinstance::botlog::info(&format!("bot actions: {}",l.name), Some("main()".to_string()), None);
|
||||
},
|
||||
botinstance::botlog::info(
|
||||
&format!("bot actions: {}", l.name),
|
||||
Some("main()".to_string()),
|
||||
None,
|
||||
);
|
||||
}
|
||||
_ => {
|
||||
// println!("Not a valid match??")
|
||||
// Log::info("Not a valid match??");
|
||||
botinstance::botlog::info("Not a valid match??", Some("main()".to_string()), None);
|
||||
},
|
||||
botinstance::botlog::info(
|
||||
"Not a valid match??",
|
||||
Some("main()".to_string()),
|
||||
None,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
// println!("Starting runner..");
|
||||
// Log::notice("Starting Bot Runner");
|
||||
|
@ -70,6 +78,5 @@ pub async fn main() {
|
|||
// let msg = Log::fatal("ERROR : EXIT Game loop");
|
||||
// panic!("{}",Log::fatal("ERROR : EXIT Game loop"));
|
||||
let a = botinstance::botlog::fatal("ERROR : EXIT Game loop", Some("main()".to_string()), None);
|
||||
panic!("{}",a);
|
||||
|
||||
}
|
||||
panic!("{}", a);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue