merge develop into master #20
|
|
@ -1,9 +1,10 @@
|
|||
use std::fs::OpenOptions;
|
||||
use crate::{
|
||||
bootstrapper::bootstrapper::Bootstrapper, config_manager::get_args,
|
||||
};
|
||||
use actix::{Actor, Addr};
|
||||
use clap::ArgMatches;
|
||||
use std::fs::OpenOptions;
|
||||
use tokio::fs::File;
|
||||
use crate::bootstrapper::bootstrapper::Bootstrapper;
|
||||
use super::get_args;
|
||||
|
||||
pub struct Builder {
|
||||
pub(super) args: ArgMatches,
|
||||
|
|
@ -11,9 +12,7 @@ pub struct Builder {
|
|||
|
||||
impl Builder {
|
||||
pub(super) fn new() -> Self {
|
||||
Self {
|
||||
args: get_args(),
|
||||
}
|
||||
Self { args: get_args() }
|
||||
}
|
||||
|
||||
pub fn file(mut self, path: String) -> Self {
|
||||
|
|
@ -22,7 +21,8 @@ impl Builder {
|
|||
.write(true)
|
||||
.read(true)
|
||||
.open(path)
|
||||
.ok().map(|val| File::from(val));
|
||||
.ok()
|
||||
.map(|val| File::from(val));
|
||||
|
||||
self
|
||||
}
|
||||
|
|
@ -30,4 +30,4 @@ impl Builder {
|
|||
pub fn build(self) -> Addr<Bootstrapper> {
|
||||
Bootstrapper::from(self).start()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,5 @@
|
|||
mod bootstrapper;
|
||||
mod builder;
|
||||
mod messages;
|
||||
mod arg_fetcher;
|
||||
|
||||
pub(crate) use arg_fetcher::get_args;
|
||||
pub(crate) use bootstrapper::Bootstrapper;
|
||||
pub(crate) use bootstrapper::Bootstrapper;
|
||||
|
|
|
|||
|
|
@ -3,28 +3,25 @@
|
|||
//! It starts the actor runtime and then sleeps
|
||||
//! for the duration of the program.
|
||||
|
||||
pub(crate) mod server;
|
||||
pub(crate) mod bootstrapper;
|
||||
pub(crate) mod client_management;
|
||||
pub(crate) mod config_manager;
|
||||
pub(crate) mod lua;
|
||||
pub(crate) mod network;
|
||||
pub(crate) mod prelude;
|
||||
pub(crate) mod rhai;
|
||||
pub(crate) mod lua;
|
||||
pub(crate) mod scripting;
|
||||
pub(crate) mod bootstrapper;
|
||||
pub(crate) mod config_manager;
|
||||
pub(crate) mod server;
|
||||
|
||||
use crate::bootstrapper::Bootstrapper;
|
||||
|
||||
use std::env::args;
|
||||
use actix::Actor;
|
||||
use server::Server;
|
||||
|
||||
use tokio::time::{sleep, Duration};
|
||||
use clap::{App, Arg, value_parser};
|
||||
use openssl::version::version;
|
||||
use crate::bootstrapper::{Bootstrapper, get_args};
|
||||
|
||||
#[actix::main()]
|
||||
async fn main() {
|
||||
let init = Bootstrapper::create()
|
||||
.build();
|
||||
let init = Bootstrapper::create().build();
|
||||
loop {
|
||||
sleep(Duration::from_millis(1000)).await;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue