added new packages to ui and removed unused stuff from server

This commit is contained in:
2025-11-26 11:18:58 +01:00
parent b5c18419d8
commit 7820555fa8
4 changed files with 112 additions and 67 deletions

View File

@@ -1,8 +1,7 @@
mod connection;
mod matchmaking;
use env_logger::{Env, Logger};
use log::{error, info, warn};
use std::env;
use env_logger::Env;
use log::{error, info};
use tokio::net::TcpListener;
#[tokio::main]

View File

@@ -26,12 +26,8 @@ impl MatchmakingSystem {
}
}
pub async fn clean_up(&self, match_id: Uuid) {
self.matches.lock().await.remove(&match_id);
}
async fn try_create_match(&self) {
info!("Checking for new matches!");
//info!("Checking for new matches!");
let mut queue = self.waiting_queue.lock().await;
while queue.len() >= 2 {
@@ -72,6 +68,7 @@ impl MatchmakingSystem {
}
if let Some(player) = conn_map.get_mut(&black_player) {
player.current_match = Some(match_id);
//TODO: at the end of a match delete this from player
} else {
error!("Could not store match id for black player");
}