Compare commits

..

No commits in common. "a664c438879b94b40286a80573b190136b5a65b8" and "b86dd46b3682c4fdf4da245d6d101c81073b5ebf" have entirely different histories.

2 changed files with 31 additions and 1 deletions

View File

@ -37,7 +37,7 @@ cargo build -r
Пример добавления в `Cargo.toml`: Пример добавления в `Cargo.toml`:
```toml ```toml
rust_mc_serv = { git = "https://github.com/GIKExe/rust_mc_serv.git" } rust_mc_serv = { git = "https://github.com/GIKExe/rust_minecraft_server.git" }
``` ```
Пример запуска сервера: Пример запуска сервера:

View File

@ -1,5 +1,6 @@
use std::{error::Error, fmt::Display, net::TcpListener, sync::Arc, thread, time::Duration}; use std::{error::Error, fmt::Display, net::TcpListener, sync::Arc, thread, time::Duration};
use config::Config;
use context::ServerContext; use context::ServerContext;
use ignore_result::Ignore; use ignore_result::Ignore;
use log::{error, info}; use log::{error, info};
@ -104,3 +105,32 @@ pub fn start_server(server: Arc<ServerContext>) {
}); });
} }
} }
// server start helper
// pub struct Server {
// context: Arc<ServerContext>,
// }
// impl Server {
// pub fn new(context: ServerContext) -> Self {
// Self {
// context: Arc::new(context),
// }
// }
// pub fn context(&self) -> &ServerContext {
// &self.context
// }
// pub fn start(&self) {
// start_server(self.context.clone());
// }
// }
// impl Default for Server {
// fn default() -> Self {
// Self {
// context: Arc::new(ServerContext::new(Arc::new(Config::default()))),
// }
// }
// }