added resign event and deleting finished matches

This commit is contained in:
2025-11-24 13:14:38 +01:00
parent 622bef963f
commit 5ccca3ab8e
3 changed files with 1158 additions and 17 deletions

View File

@@ -1,5 +1,5 @@
use crate::connection::ServerMessage2;
use crate::connection::{ConnectionMap, GameMatch, MatchMap, WaitingQueue, broadcast_to_match};
use crate::connection::{ConnectionMap, GameMatch, MatchMap, WaitingQueue};
use rand::random;
use uuid::Uuid;
@@ -25,6 +25,10 @@ impl MatchmakingSystem {
}
}
pub async fn clean_up(&self, match_id: Uuid) {
self.matches.lock().await.remove(&match_id);
}
async fn try_create_match(&self) {
let mut queue = self.waiting_queue.lock().await;