feat(matchmaking): method 15 - getdetailedparticipants
All checks were successful
Build and Test / build-editions (sonic-transformed) (push) Successful in 3m49s
Build and Test / build-editions (splatoon) (push) Successful in 4m9s
Build and Test / build-editions (minecraft-wiiu) (push) Successful in 4m9s
Build and Test / build-editions (mario-tennis) (push) Successful in 5m25s
Build and Test / build-editions (splatoon-testfire) (push) Successful in 6m1s
Build and Test / build-editions (wii-u-chat) (push) Successful in 6m34s
Build and Test / build-editions (fast-racing-neo) (push) Successful in 6m36s
Build and Test / build-editions (DATABASE_SMM, puyopuyo) (push) Successful in 6m39s
Build and Test / build-editions (DATABASE_SMM, super-mario-maker) (push) Successful in 6m55s
Build and Test / build-editions (terraria) (push) Successful in 6m55s
Build and Test / build-editions (DATABASE_FRIENDS, friends) (push) Successful in 6m56s
Build and Test / build-editions (DATABASE_SMM, wii-sports-club) (push) Successful in 7m54s

This commit is contained in:
red binder 2026-08-08 19:28:48 +02:00
commit 2a82146a45
2 changed files with 35 additions and 3 deletions

View file

@ -150,6 +150,15 @@ pub struct MatchmakeBlockListParam {
option_flag: u32,
}
#[derive(RmcSerialize, Debug, Clone)]
#[rmc_struct(0)]
pub struct ParticipantDetails {
pub participant: PID,
pub name: String,
pub message: String,
pub participants: u16,
}
cfg_if! {
if #[cfg(feature = "v3-10-22")] {
#[derive(RmcSerialize, Debug, Clone)]
@ -200,6 +209,8 @@ pub mod gathering_flags {
pub trait Matchmake {
#[method_id(2)]
async fn unregister_gathering(&self, gid: u32) -> Result<bool, ErrorCode>;
#[method_id(15)]
async fn get_detailed_participants(&self, gid: u32) -> Result<Vec<ParticipantDetails>, ErrorCode>;
#[method_id(21)]
async fn find_by_single_id(&self, gid: u32) -> Result<(bool, Any<Gathering>), ErrorCode>;
#[method_id(41)]

View file

@ -6,12 +6,11 @@ use rnex_mm_protos::{
LocalMatchMakingProtocol, RemoteMatchMakingClientProtocol,
matchmake::{
AutoMatchmakeParam, CreateMatchmakeSessionParam, Gathering, JoinMatchmakeSessionParam,
Matchmake, MatchmakeSession, MatchmakeSessionSearchCriteria,
Matchmake, MatchmakeSession, MatchmakeSessionSearchCriteria, ParticipantDetails,
},
matchmake_ext::MatchmakeExt,
matchmake_extension::MatchmakeExtension,
nat_traversal::NatTraversal,
nat_traversal::RemoteNatTraversalConsole,
nat_traversal::{NatTraversal, RemoteNatTraversalConsole},
notifications::{
NotificationEvent, RemoteNotification,
notification_types::{END_GATHERING, REQUEST_JOIN_GATHERING},
@ -633,6 +632,28 @@ impl Matchmake for MatchmakeUser {
Ok(())
}
async fn get_detailed_participants(&self, gid: u32) -> Result<Vec<ParticipantDetails>, ErrorCode> {
let session = self.matchmake_manager.get_session(gid).await?;
let session = session.lock().await;
let mut participant_details = Vec::with_capacity(session.connected_players.len());
for player_weak in &session.connected_players {
let Some(player) = player_weak.upgrade() else {
continue;
};
participant_details.push(ParticipantDetails {
participant: player.base.pid,
name: "test".to_string(),
message: String::new(),
participants: 1,
});
}
Ok(participant_details)
}
}
impl MatchmakeExt for MatchmakeUser {