feat: add server binary

This commit is contained in:
2026-08-16 14:52:25 +02:00
parent 3d8219c65a
commit 562640cb16
7 changed files with 35 additions and 20 deletions

13
src/bin/server.rs Normal file
View File

@@ -0,0 +1,13 @@
use checkers::network::server::Server;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let mut server: Server = Server::new().await;
env_logger::init();
server.start().await;
server.update().await;
Ok(())
}

2
src/lib.rs Normal file
View File

@@ -0,0 +1,2 @@
pub mod logic;
pub mod network;

View File

@@ -1,5 +1,3 @@
mod logic;
mod network;
fn main() {
println!("Hello, world!");

View File

@@ -1,4 +1,4 @@
mod client;
mod connection;
mod message;
mod server;
pub mod client;
pub mod connection;
pub mod message;
pub mod server;

View File

@@ -79,6 +79,8 @@ impl Server {
.take()
.expect("Cannot start the server without tcp listener.");
info!("Starting the server at: {:?}", listener.local_addr());
let sender = self.sender.clone();
tokio::spawn(async move {