chore: split executable into lib and main

This commit is contained in:
amizing25
2025-03-09 05:11:16 +07:00
parent c034f8a2f9
commit 505c446a53
6 changed files with 84 additions and 123 deletions

12
gameserver/src/lib.rs Normal file
View File

@@ -0,0 +1,12 @@
#![feature(let_chains)]
use anyhow::Result;
mod net;
mod util;
use net::gateway::Gateway;
pub async fn start_gameserver() -> Result<()> {
let mut gateway = Gateway::new("0.0.0.0", 23301).await?;
Box::pin(gateway.listen()).await
}