From 5972833136f942144ac3de0aca65c33eee0cd06d Mon Sep 17 00:00:00 2001 From: Maple Nebel Date: Tue, 28 Apr 2026 22:56:36 +0200 Subject: [PATCH] add utility protocol --- rnex-core/src/nex/user.rs | 11 +++++++++++ rnex-core/src/rmc/protocols/mod.rs | 1 + rnex-core/src/rmc/protocols/util.rs | 14 ++++++++++++++ 3 files changed, 26 insertions(+) create mode 100644 rnex-core/src/rmc/protocols/util.rs diff --git a/rnex-core/src/nex/user.rs b/rnex-core/src/nex/user.rs index dbbac7b..44721ed 100644 --- a/rnex-core/src/nex/user.rs +++ b/rnex-core/src/nex/user.rs @@ -11,6 +11,9 @@ use rnex_core::prudp::station_url::UrlOptions::{ use rnex_core::rmc::protocols::matchmake::{ Matchmake, RawMatchmake, RawMatchmakeInfo, RemoteMatchmake, }; +use rnex_core::rmc::protocols::util::{ + Utility, RawUtility, RawUtilityInfo, RemoteUtility, +}; use rnex_core::rmc::protocols::matchmake_ext::{ MatchmakeExt, RawMatchmakeExt, RawMatchmakeExtInfo, RemoteMatchmakeExt, }; @@ -65,6 +68,7 @@ cfg_if! { Matchmake, NatTraversal, Ranking, + Utility, DataStore } ); @@ -76,6 +80,7 @@ cfg_if! { MatchmakeExt, Matchmake, NatTraversal, + Utility, Ranking } ); @@ -767,6 +772,12 @@ fn fetch_team_votes(fest_id: u32) -> Result, ErrorCode> { }) } +impl Utility for User{ + async fn acquire_nex_unique_id(&self) -> Result{ + return Ok(rand::random()) + } +} + impl Ranking for User { async fn competition_ranking_get_param( &self, diff --git a/rnex-core/src/rmc/protocols/mod.rs b/rnex-core/src/rmc/protocols/mod.rs index 391ecdf..4b00e29 100644 --- a/rnex-core/src/rmc/protocols/mod.rs +++ b/rnex-core/src/rmc/protocols/mod.rs @@ -12,6 +12,7 @@ pub mod nintendo_notification; pub mod notifications; pub mod ranking; pub mod secure; +pub mod util; use crate::result::ResultExtension; use crate::rmc::message::RMCMessage; diff --git a/rnex-core/src/rmc/protocols/util.rs b/rnex-core/src/rmc/protocols/util.rs new file mode 100644 index 0000000..8da6a5f --- /dev/null +++ b/rnex-core/src/rmc/protocols/util.rs @@ -0,0 +1,14 @@ +use macros::{RmcSerialize, method_id, rmc_proto}; + +use rnex_core::{ + PID, + rmc::{response::ErrorCode, structures::any::Any}, +}; + +use crate::{kerberos::KerberosDateTime, rmc::protocols::friends::NNAInfo}; + +#[rmc_proto(110)] +pub trait Utility { + #[method_id(1)] + async fn acquire_nex_unique_id(&self) -> Result; +}