add wii u chat functions
All checks were successful
Build and Test / wii-u-chat (push) Successful in 8m1s
Build and Test / splatoon (push) Successful in 8m1s
Build and Test / friends (push) Successful in 8m7s
Build and Test / super-mario-maker (push) Successful in 12m38s

This commit is contained in:
Maple 2026-04-28 00:13:07 +02:00
commit c828d3b973
7 changed files with 297 additions and 203 deletions

View file

@ -1,17 +1,57 @@
use macros::{method_id, rmc_proto};
use rnex_core::rmc::response::ErrorCode;
use rnex_core::rmc::structures::matchmake::{AutoMatchmakeParam, CreateMatchmakeSessionParam, JoinMatchmakeSessionParam, MatchmakeSession};
use rnex_core::rmc::structures::matchmake::{
AutoMatchmakeParam, CreateMatchmakeSessionParam, JoinMatchmakeSessionParam, MatchmakeSession,
};
use crate::rmc::protocols::notifications::NotificationEvent;
use crate::rmc::structures::any::Any;
#[rmc_proto(109)]
pub trait MatchmakeExtension{
pub trait MatchmakeExtension {
#[method_id(1)]
async fn close_participation(&self, gid: u32) -> Result<(), ErrorCode>;
#[method_id(2)]
async fn open_participation(&self, gid: u32) -> Result<(), ErrorCode>;
#[method_id(6)]
async fn create_matchmake_session(
&self,
gathering: Any,
message: String,
) -> Result<(u32, Vec<u8>), ErrorCode>;
#[method_id(9)]
async fn update_notification_data(
&self,
ty: u32,
param1: u32,
param2: u32,
str_param: String,
) -> Result<(), ErrorCode>;
#[method_id(10)]
async fn get_friend_notification_data(
&self,
ty: i32,
) -> Result<Vec<NotificationEvent>, ErrorCode>;
#[method_id(30)]
async fn join_matchmake_session_ex(
&self,
gid: u32,
message: String,
dont_care_block_list: bool,
participation_count: u16,
) -> Result<Vec<u8>, ErrorCode>;
#[method_id(8)]
async fn modify_current_game_attribute(&self, gid: u32, attrib_index: u32, attrib_val: u32) -> Result<(), ErrorCode>;
async fn modify_current_game_attribute(
&self,
gid: u32,
attrib_index: u32,
attrib_val: u32,
) -> Result<(), ErrorCode>;
#[method_id(16)]
async fn get_playing_session(&self, pids: Vec<u32>) -> Result<Vec<()>, ErrorCode>;
@ -19,14 +59,26 @@ pub trait MatchmakeExtension{
#[method_id(34)]
async fn update_progress_score(&self, gid: u32, progress: u8) -> Result<(), ErrorCode>;
#[method_id(38)]
async fn create_matchmake_session_with_param(&self, session: CreateMatchmakeSessionParam) -> Result<MatchmakeSession, ErrorCode>;
async fn create_matchmake_session_with_param(
&self,
session: CreateMatchmakeSessionParam,
) -> Result<MatchmakeSession, ErrorCode>;
#[method_id(39)]
async fn join_matchmake_session_with_param(&self, session: JoinMatchmakeSessionParam) -> Result<MatchmakeSession, ErrorCode>;
async fn join_matchmake_session_with_param(
&self,
session: JoinMatchmakeSessionParam,
) -> Result<MatchmakeSession, ErrorCode>;
#[method_id(40)]
async fn auto_matchmake_with_param_postpone(&self, session: AutoMatchmakeParam) -> Result<MatchmakeSession, ErrorCode>;
async fn auto_matchmake_with_param_postpone(
&self,
session: AutoMatchmakeParam,
) -> Result<MatchmakeSession, ErrorCode>;
#[method_id(41)]
async fn find_matchmake_session_by_gathering_id_detail(&self, gid: u32) -> Result<MatchmakeSession, ErrorCode>;
}
async fn find_matchmake_session_by_gathering_id_detail(
&self,
gid: u32,
) -> Result<MatchmakeSession, ErrorCode>;
}

View file

@ -5,8 +5,12 @@ use rnex_core::PID;
pub mod notification_types {
pub const OWNERSHIP_CHANGED: u32 = 4000;
pub const HOST_CHANGED: u32 = 110000;
pub const REQUEST_JOIN_GATHERING: u32 = 101;
pub const END_GATHERING: u32 = 102;
}
cfg_if::cfg_if! {
if #[cfg(feature = "v3-5-0")]{
#[derive(RmcSerialize, Debug, Default, Clone)]
#[rmc_struct(0)]
pub struct NotificationEvent {
@ -17,6 +21,18 @@ pub struct NotificationEvent {
pub str_param: String,
pub param_3: PID,
}
} else {
#[derive(RmcSerialize, Debug, Default, Clone)]
#[rmc_struct(0)]
pub struct NotificationEvent {
pub pid_source: PID,
pub notif_type: u32,
pub param_1: PID,
pub param_2: PID,
pub str_param: String,
}
}
}
#[rmc_proto(14, NoReturn)]
pub trait Notification {

View file

@ -1,3 +1,4 @@
use cfg_if::cfg_if;
use macros::RmcSerialize;
use rnex_core::kerberos::KerberosDateTime;
use rnex_core::rmc::structures::variant::Variant;
@ -27,29 +28,49 @@ pub struct MatchmakeParam {
pub params: Vec<(String, Variant)>,
}
// rmc structure
#[derive(RmcSerialize, Debug, Clone, Default)]
#[rmc_struct(3)]
pub struct MatchmakeSession {
//inherits from
#[extends]
pub gathering: Gathering,
cfg_if! {
if #[cfg(feature = "v3-5-0")]{
#[derive(RmcSerialize, Debug, Clone, Default)]
#[rmc_struct(3)]
pub struct MatchmakeSession {
//inherits from
#[extends]
pub gathering: Gathering,
pub gamemode: u32,
pub attributes: Vec<u32>,
pub open_participation: bool,
pub matchmake_system_type: u32,
pub application_buffer: Vec<u8>,
pub participation_count: u32,
pub progress_score: u8,
pub session_key: Vec<u8>,
pub option0: u32,
pub matchmake_param: MatchmakeParam,
pub datetime: KerberosDateTime,
pub user_password: String,
pub refer_gid: u32,
pub user_password_enabled: bool,
pub system_password_enabled: bool,
pub gamemode: u32,
pub attributes: Vec<u32>,
pub open_participation: bool,
pub matchmake_system_type: u32,
pub application_buffer: Vec<u8>,
pub participation_count: u32,
pub progress_score: u8,
pub session_key: Vec<u8>,
pub option0: u32,
pub matchmake_param: MatchmakeParam,
pub datetime: KerberosDateTime,
pub user_password: String,
pub refer_gid: u32,
pub user_password_enabled: bool,
pub system_password_enabled: bool,
}
} else {
#[derive(RmcSerialize, Debug, Clone, Default)]
#[rmc_struct(0)]
pub struct MatchmakeSession {
//inherits from
#[extends]
pub gathering: Gathering,
pub gamemode: u32,
pub attributes: Vec<u32>,
pub open_participation: bool,
pub matchmake_system_type: u32,
pub application_buffer: Vec<u8>,
pub participation_count: u32,
pub progress_score: u8,
pub session_key: Vec<u8>,
}
}
}
#[derive(RmcSerialize, Debug, Clone)]