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
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:
parent
f0b7876d0f
commit
81c89549fd
2 changed files with 17 additions and 9 deletions
|
|
@ -30,7 +30,7 @@ use tokio::{
|
||||||
sync::{Mutex, RwLock},
|
sync::{Mutex, RwLock},
|
||||||
time::sleep,
|
time::sleep,
|
||||||
};
|
};
|
||||||
use tracing::{info, instrument};
|
use tracing::info;
|
||||||
|
|
||||||
use crate::user::MatchmakeUser;
|
use crate::user::MatchmakeUser;
|
||||||
|
|
||||||
|
|
@ -53,7 +53,6 @@ impl MatchmakeManager {
|
||||||
self.rv_cid_counter.fetch_add(1, Ordering::Relaxed)
|
self.rv_cid_counter.fetch_add(1, Ordering::Relaxed)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[instrument]
|
|
||||||
pub async fn get_session(
|
pub async fn get_session(
|
||||||
&self,
|
&self,
|
||||||
gid: u32,
|
gid: u32,
|
||||||
|
|
@ -70,7 +69,6 @@ impl MatchmakeManager {
|
||||||
Ok(session)
|
Ok(session)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[instrument]
|
|
||||||
async fn garbage_collect(&self) {
|
async fn garbage_collect(&self) {
|
||||||
info!("running rnex garbage collector over all sessions and users");
|
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>) {
|
pub fn initialize_garbage_collect_thread(this: Weak<Self>) {
|
||||||
tokio::spawn(async move {
|
tokio::spawn(async move {
|
||||||
while let Some(this) = this.upgrade() {
|
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
|
// this could be far more efficient but it is INCREDIBLY difficult to iterate over something
|
||||||
// asyncronously propperly
|
// asyncronously propperly
|
||||||
#[instrument]
|
|
||||||
pub async fn search_by_criteria(
|
pub async fn search_by_criteria(
|
||||||
&self,
|
&self,
|
||||||
criterias: &[MatchmakeSessionSearchCriteria],
|
criterias: &[MatchmakeSessionSearchCriteria],
|
||||||
|
|
@ -140,7 +136,9 @@ impl MatchmakeManager {
|
||||||
}
|
}
|
||||||
|
|
||||||
if bool_matched_criteria {
|
if bool_matched_criteria {
|
||||||
info!("matched session: {:?}", session);
|
let guard = session.lock().await;
|
||||||
|
info!("matched session: {:?}", *guard);
|
||||||
|
|
||||||
list.push(session.clone());
|
list.push(session.clone());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -109,19 +109,29 @@ impl MatchmakeExtension for MatchmakeUser {
|
||||||
browse_criteria: MatchmakeSessionSearchCriteria,
|
browse_criteria: MatchmakeSessionSearchCriteria,
|
||||||
result_range: ResultsRange,
|
result_range: ResultsRange,
|
||||||
) -> Result<Vec<Any<Gathering>>, ErrorCode> {
|
) -> Result<Vec<Any<Gathering>>, ErrorCode> {
|
||||||
|
info!("browsing matchmake sessions with criteria: {:?}", browse_criteria);
|
||||||
|
|
||||||
let results = self
|
let results = self
|
||||||
.matchmake_manager
|
.matchmake_manager
|
||||||
.search_by_criteria(&[browse_criteria])
|
.search_by_criteria(&[browse_criteria])
|
||||||
.await?;
|
.await?;
|
||||||
|
|
||||||
let mm_list = result_range.make_from_list(&results[..]);
|
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());
|
let mut list = Vec::with_capacity(mm_list.len());
|
||||||
|
|
||||||
for mm_sess in mm_list {
|
for (index, mm_sess) in mm_list.iter().enumerate() {
|
||||||
let mm_sess = mm_sess.lock().await;
|
let mm_sess_guard = mm_sess.lock().await;
|
||||||
list.push(Any::new(&mm_sess.session).expect("type error"));
|
|
||||||
|
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)
|
Ok(list)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue