Testing new session server

This commit is contained in:
2026-02-23 00:36:24 +01:00
parent 9b554aa510
commit 56fb719cca
5 changed files with 742 additions and 32 deletions
+26 -2
View File
@@ -1,3 +1,27 @@
fn main() {
println!("Hello, world!");
use session_rs::server::SessionServer;
use crate::methods::AuthResponse;
pub mod methods;
#[tokio::main(flavor = "current_thread")]
async fn main() -> session_rs::Result<()> {
let server = SessionServer::bind("127.0.0.1:8080").await?;
server
.session_loop(async |session, _| {
println!("Connected");
session
.on::<methods::Auth, _>(|_, req| async {
Ok(AuthResponse {
cloak: String::new(),
hat: String::new(),
cloaks: Vec::new(),
hats: Vec::new(),
})
})
.await;
Ok(())
})
.await
}