hopefully fix things
Some checks failed
Build and Test / splatoon (push) Has been cancelled
Build and Test / wii-u-chat (push) Has been cancelled
Build and Test / friends (push) Has been cancelled
Build and Test / super-mario-maker (push) Has been cancelled

This commit is contained in:
Maple 2026-04-28 00:47:50 +02:00
commit 2cbac0b1e5
3 changed files with 6 additions and 1 deletions

View file

@ -11,6 +11,7 @@ pub async fn start_regular_backend() {
//gid_counter: AtomicU32::new(1),
sessions: Default::default(),
users: Default::default(),
users_by_pid: Default::default(),
rv_cid_counter: AtomicU32::new(1),
});

View file

@ -28,6 +28,7 @@ pub struct MatchmakeManager {
pub sessions: RwLock<HashMap<u32, Arc<Mutex<ExtendedMatchmakeSession>>>>,
pub rv_cid_counter: AtomicU32,
pub users: RwLock<HashMap<u32, Weak<User>>>,
pub users_by_pid: RwLock<HashMap<u32, Weak<User>>>,
}
impl MatchmakeManager {

View file

@ -102,6 +102,9 @@ impl Secure for User {
let mut users = self.matchmake_manager.users.write().await;
users.insert(cid, self.this.clone());
drop(users);
let mut users = self.matchmake_manager.users_by_pid.write().await;
users.insert(self.pid, self.this.clone());
drop(users);
let stations = get_station_urls(&station_urls, self.ip, self.pid, cid).await?;
@ -444,7 +447,7 @@ impl MatchmakeExtension for User {
println!("attempt to reach: {}", recpipent);
let Some(user) = self
.matchmake_manager
.users
.users_by_pid
.read()
.await
.get(&recpipent)