fixed error: sending both match notification to the same player and removed old server message struct

This commit is contained in:
2025-11-27 16:31:48 +01:00
parent 2112109470
commit 5763716848
2 changed files with 2 additions and 14 deletions

View File

@@ -45,18 +45,6 @@ pub struct Step {
pub to: String, pub to: String,
} }
/*#[derive(Serialize, Deserialize, Debug)]
struct ServerMessage {
#[serde(rename = "type")]
message_type: String,
player_id: Option<Uuid>,
match_id: Option<Uuid>,
opponent: Option<Uuid>,
color: Option<String>,
reason: Option<String>,
response: Option<String>,
}*/
#[derive(Serialize, Deserialize)] #[derive(Serialize, Deserialize)]
pub enum ServerMessage2 { pub enum ServerMessage2 {
GameEnd { GameEnd {

View File

@@ -1,5 +1,5 @@
use crate::connection::ServerMessage2; 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 log::{error, info, warn};
use rand::random; use rand::random;
use uuid::Uuid; use uuid::Uuid;
@@ -119,7 +119,7 @@ impl MatchmakingSystem {
}; };
let _ = crate::connection::send_message_to_player_connection( let _ = crate::connection::send_message_to_player_connection(
conn_map.get_mut(&white), conn_map.get_mut(&black),
&serde_json::to_string(&message).unwrap(), &serde_json::to_string(&message).unwrap(),
) )
.await; .await;