From f427cdf6f7e8fd03418370425f4f663ca4a03121 Mon Sep 17 00:00:00 2001 From: metamuffin Date: Mon, 18 Mar 2024 00:42:21 +0100 Subject: reworking rift: part one --- client-native-lib/Cargo.toml | 2 +- client-native-lib/src/peer.rs | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'client-native-lib') diff --git a/client-native-lib/Cargo.toml b/client-native-lib/Cargo.toml index 617bdb7..70ad7b8 100644 --- a/client-native-lib/Cargo.toml +++ b/client-native-lib/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "client-native-lib" +name = "libkeks" version = "0.2.3" edition = "2021" diff --git a/client-native-lib/src/peer.rs b/client-native-lib/src/peer.rs index f3b6586..353de20 100644 --- a/client-native-lib/src/peer.rs +++ b/client-native-lib/src/peer.rs @@ -27,6 +27,7 @@ pub struct Peer { pub inst: Arc, pub peer_connection: RTCPeerConnection, pub remote_provided: RwLock>, + pub username: RwLock>, pub id: usize, } @@ -63,6 +64,7 @@ impl Peer { remote_provided: Default::default(), inst: inst.clone(), peer_connection, + username: Default::default(), id, }); peer.peer_connection @@ -199,7 +201,8 @@ impl Peer { } RelayMessage::Chat(_) => (), RelayMessage::Identify { username } => { - info!("peer {} is known as {username:?}", self.id) + info!("peer {} is known as {username:?}", self.id); + *self.username.write().await = Some(username); } RelayMessage::Request { id } => { if let Some(res) = self.inst.local_resources.read().await.get(&id) { -- cgit v1.2.3-70-g09d2