From aeb7beb3f9b154f4aefbaa1c08d822ed572461fb Mon Sep 17 00:00:00 2001 From: stale Date: Fri, 3 Jun 2022 22:39:55 -0300 Subject: cleaned up client code, more info in game page --- src/conn.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/conn.rs') diff --git a/src/conn.rs b/src/conn.rs index dfd6623..764c573 100644 --- a/src/conn.rs +++ b/src/conn.rs @@ -60,9 +60,9 @@ pub async fn lobby(socket: WebSocket, addr: SocketAddr, rinfo: (RoomId,Arc,tokio::sync::mpsc::UnboundedSender), addr: SocketAddr, rinfo: (RoomId, Arc>)) { let (mut incoming, tx) = streams; let (room_id, room) = rinfo; - let (players, cmd_tx) = { + let (players, cmd_tx, room_conf) = { let room = room.read().await; - (room.players.clone(), room.cmd_stream.clone()) + (room.players.clone(), room.cmd_stream.clone(), room.conf.clone()) }; while let Ok(cmd) = incoming.try_next().await { if let Some(cmd) = cmd { @@ -154,7 +154,7 @@ pub async fn handle_room(streams: (SplitStream,tokio::sync::mpsc::Unb let conn = Conn { addr, tx: tx.clone() }; room.write().await.players.insert_conn(conn, name.clone(), clr).await }; - tx.send(Message::text(format!("regack {} {uid} {}", name.replace(" ", " "), room.read().await.conf.board_conf))).expect("couldn't send register ack"); + tx.send(Message::text(format!("regack {} {} {} {}", room_conf.name, name.replace(" ", " "), uid, room_conf.board_conf))).expect("couldn't send register ack"); if let Err(e) = room.read().await.cmd_stream.send(MetaMove::Dump) { println!("{room_id} E: couldn't request game dump in behalf of {addr}: {e}"); } -- cgit v1.2.3