fixed error: sending both match notification to the same player and removed old server message struct
This commit is contained in:
@@ -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<Uuid>,
|
||||
match_id: Option<Uuid>,
|
||||
opponent: Option<Uuid>,
|
||||
color: Option<String>,
|
||||
reason: Option<String>,
|
||||
response: Option<String>,
|
||||
}*/
|
||||
|
||||
#[derive(Serialize, Deserialize)]
|
||||
pub enum ServerMessage2 {
|
||||
GameEnd {
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user