6.18. Advanced Features - Getting the Number of Participants in Matchmaking Sessions

The feature to get the number of matchmaking session participants is used to get the number of participant stations in the matchmaking session comprising the mesh. This value can be acquired using the nn::pia::session::Session::GetMatchmakeSessionParticipantNum() function.

Detecting New Participants When Closing a Session Invitation

If a station attempts to join immediately before a session invitation is closed, the actual join may take place after the session invitation is closed. New participants can be detected after the closure of the session invitation by comparing the value from this function to the value from nn::pia::session::Session::GetStationNum() before proceeding to the next state. However, if any stations leave at the same time, you are temporarily unable to detect the new stations. Check after the other stations are finished leaving.

We recommend using nn::pia::session::Session::CloseParticipationAsync() because it conducts this check process during the asynchronous process.

Target Matchmaking Session

The matchmaking session from which this function gets the number of participants depends on the state returned by nn::pia::session::Session::GetStatus().

When nn::pia::session::Session::STATUS_CONNECTED_SESSION is returned, the joined session will be the target.
When nn::pia::session::Session::STATUS_CONNECTED_JOINT_SESSION is returned, the joined joint session will be the target.

When nn::pia::session::Session::STATUS_MIGRATING_SESSION is returned, the acquired value is undefined. Do not call this function in this state.