diff options
author | stale <redkugelblitzin@gmail.com> | 2022-06-03 22:39:55 -0300 |
---|---|---|
committer | stale <redkugelblitzin@gmail.com> | 2022-06-03 22:39:55 -0300 |
commit | aeb7beb3f9b154f4aefbaa1c08d822ed572461fb (patch) | |
tree | 9023673c4600cf884800c00800f4567b92d2b6d1 /src/conn.rs | |
parent | b1bef4d9bc28c9b4ef57b750368e92cb1878eba7 (diff) |
cleaned up client code, more info in game page
Diffstat (limited to 'src/conn.rs')
-rw-r--r-- | src/conn.rs | 6 |
1 files changed, 3 insertions, 3 deletions
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<RwLoc pub async fn handle_room(streams: (SplitStream<WebSocket>,tokio::sync::mpsc::UnboundedSender<Message>), addr: SocketAddr, rinfo: (RoomId, Arc<RwLock<Room>>)) { 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<WebSocket>,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}"); } |