fix(matchmake): add debug logging to see if sessions are being filtered out
All checks were successful
Build and Test / build-editions (splatoon-testfire) (push) Successful in 4m13s
Build and Test / build-editions (sonic-transformed) (push) Successful in 4m14s
Build and Test / build-editions (wii-u-chat) (push) Successful in 4m15s
Build and Test / build-editions (mario-tennis) (push) Successful in 4m30s
Build and Test / build-editions (splatoon) (push) Successful in 4m32s
Build and Test / build-editions (terraria) (push) Successful in 4m31s
Build and Test / build-editions (minecraft-wiiu) (push) Successful in 4m44s
Build and Test / build-editions (DATABASE_SMM, puyopuyo) (push) Successful in 4m54s
Build and Test / build-editions (DATABASE_FRIENDS, friends) (push) Successful in 4m59s
Build and Test / build-editions (DATABASE_SMM, super-mario-maker) (push) Successful in 4m59s
Build and Test / build-editions (fast-racing-neo) (push) Successful in 5m0s
Build and Test / build-editions (DATABASE_SMM, wii-sports-club) (push) Successful in 5m11s

This commit is contained in:
red binder 2026-08-08 18:33:38 +02:00
commit 81c89549fd
2 changed files with 17 additions and 9 deletions

View file

@ -30,7 +30,7 @@ use tokio::{
sync::{Mutex, RwLock},
time::sleep,
};
use tracing::{info, instrument};
use tracing::info;
use crate::user::MatchmakeUser;
@ -53,7 +53,6 @@ impl MatchmakeManager {
self.rv_cid_counter.fetch_add(1, Ordering::Relaxed)
}
#[instrument]
pub async fn get_session(
&self,
gid: u32,
@ -70,7 +69,6 @@ impl MatchmakeManager {
Ok(session)
}
#[instrument]
async fn garbage_collect(&self) {
info!("running rnex garbage collector over all sessions and users");
@ -104,7 +102,6 @@ impl MatchmakeManager {
}
}
#[instrument]
pub fn initialize_garbage_collect_thread(this: Weak<Self>) {
tokio::spawn(async move {
while let Some(this) = this.upgrade() {
@ -118,7 +115,6 @@ impl MatchmakeManager {
// this could be far more efficient but it is INCREDIBLY difficult to iterate over something
// asyncronously propperly
#[instrument]
pub async fn search_by_criteria(
&self,
criterias: &[MatchmakeSessionSearchCriteria],
@ -140,7 +136,9 @@ impl MatchmakeManager {
}
if bool_matched_criteria {
info!("matched session: {:?}", session);
let guard = session.lock().await;
info!("matched session: {:?}", *guard);
list.push(session.clone());
}
}

View file

@ -109,19 +109,29 @@ impl MatchmakeExtension for MatchmakeUser {
browse_criteria: MatchmakeSessionSearchCriteria,
result_range: ResultsRange,
) -> Result<Vec<Any<Gathering>>, ErrorCode> {
info!("browsing matchmake sessions with criteria: {:?}", browse_criteria);
let results = self
.matchmake_manager
.search_by_criteria(&[browse_criteria])
.await?;
let mm_list = result_range.make_from_list(&results[..]);
info!("filtered mm_list count: {}", mm_list.len());
let mut list = Vec::with_capacity(mm_list.len());
for mm_sess in mm_list {
let mm_sess = mm_sess.lock().await;
list.push(Any::new(&mm_sess.session).expect("type error"));
for (index, mm_sess) in mm_list.iter().enumerate() {
let mm_sess_guard = mm_sess.lock().await;
info!("processing session [{}]: {:?}", index, *mm_sess_guard);
let gathering_any = Any::new(&mm_sess_guard.session).expect("type error");
list.push(gathering_any);
}
info!("successfully collected {} sessions into output list", list.len());
Ok(list)
}