From 5763716848b022040bf46a8b016c239973c09957 Mon Sep 17 00:00:00 2001 From: htom Date: Thu, 27 Nov 2025 16:31:48 +0100 Subject: [PATCH] fixed error: sending both match notification to the same player and removed old server message struct --- server/src/connection.rs | 12 ------------ server/src/matchmaking.rs | 4 ++-- 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/server/src/connection.rs b/server/src/connection.rs index 6b2a5c1..246f032 100644 --- a/server/src/connection.rs +++ b/server/src/connection.rs @@ -45,18 +45,6 @@ pub struct Step { pub to: String, } -/*#[derive(Serialize, Deserialize, Debug)] -struct ServerMessage { - #[serde(rename = "type")] - message_type: String, - player_id: Option, - match_id: Option, - opponent: Option, - color: Option, - reason: Option, - response: Option, -}*/ - #[derive(Serialize, Deserialize)] pub enum ServerMessage2 { GameEnd { diff --git a/server/src/matchmaking.rs b/server/src/matchmaking.rs index 640dca5..c43448a 100644 --- a/server/src/matchmaking.rs +++ b/server/src/matchmaking.rs @@ -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 log::{error, info, warn}; use rand::random; use uuid::Uuid; @@ -119,7 +119,7 @@ impl MatchmakingSystem { }; let _ = crate::connection::send_message_to_player_connection( - conn_map.get_mut(&white), + conn_map.get_mut(&black), &serde_json::to_string(&message).unwrap(), ) .await;