fn notify_client(game_update: &shared_types::ServerEvent, client: &session_types::Client) {
  let sender = match &client.sender {
    Some(s) => s,
    None => return eprintln!("[error] sender was lost for client: {}", client.id),
  };
  if let Err(e) = sender.send(Ok(Message::text(
    serde_json::to_string(game_update).unwrap(),
  ))) {
    eprintln!(
      "[error] failed to send message to {} with err: {}",
      client.id, e,
    );
  }
}
/// Send an update to single clients

Send an update to single clients
Send an update to single clients
fn notify_client(game_update: &shared_types::ServerEvent, client: &session_types::Client) {
  let sender = match &client.sender {
    Some(s) => s,
    None => return eprintln!("[error] sender was lost for client: {}", client.id),
  };
  if let Err(e) = sender.send(Ok(Message::text(
    serde_json::to_string(game_update).unwrap(),
  ))) {
    eprintln!(
      "[error] failed to send message to {} with err: {}",
      client.id, e,
    );
  }
}
fn notify_client ( game_update : & shared_types :: ServerEvent , client : & session_types :: Client ) { let sender = match & client . sender { Some ( s ) => s , None => return eprintln ! ( " " client id ) , } ; if let Err ( e ) = sender . send ( Ok ( Message :: text ( serde_json :: to_string ( game_update ) . unwrap ( ) , ) ) ) { eprintln ! ( " " client id e ) ; } }
Send an update to single clients
Send an update to single clients
game_update
&shared_types::ServerEvent
client
&session_types::Client
game_update
&shared_types::ServerEvent
client
&session_types::Client