From 929516da5a33595f943f00b0229f1750a49b8119 Mon Sep 17 00:00:00 2001 From: red binder Date: Tue, 23 Jun 2026 12:10:55 +0200 Subject: [PATCH] placeholder for Friends3DS proto --- Cargo.lock | 10 +-- rnex-core/Cargo.toml | 2 +- rnex-core/src/nex/friends_handler.rs | 115 ++++++++++++++++++++++++++- 3 files changed, 120 insertions(+), 7 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index cc00939..9ad2257 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1693,7 +1693,7 @@ dependencies = [ "libc", "percent-encoding", "pin-project-lite", - "socket2 0.5.10", + "socket2 0.6.3", "tokio", "tower-service", "tracing", @@ -2091,9 +2091,9 @@ checksum = "1d87ecb2933e8aeadb3e3a02b828fed80a7528047e68b4f424523a0981a3a084" [[package]] name = "nex-account" -version = "0.2.0" +version = "0.2.1" source = "sparse+https://crates.spbr.net/api/v1/crates/" -checksum = "10e60c4ce2c2fd11862b85dd0176e0de57b4e9057b78ee98d9b00c82fa978601" +checksum = "51215ae67dfb36017956435ee4935bd62d64b62a8dd716c4614e11c8c29f941e" dependencies = [ "hmac 0.13.0", "log", @@ -3595,7 +3595,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32497e9a4c7b38532efcdebeef879707aa9f794296a4f0244f6f69e9bc8574bd" dependencies = [ "fastrand", - "getrandom 0.4.2", + "getrandom 0.3.4", "once_cell", "rustix", "windows-sys 0.61.2", @@ -4237,7 +4237,7 @@ version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" dependencies = [ - "windows-sys 0.48.0", + "windows-sys 0.61.2", ] [[package]] diff --git a/rnex-core/Cargo.toml b/rnex-core/Cargo.toml index c64f6ba..66c2fc3 100644 --- a/rnex-core/Cargo.toml +++ b/rnex-core/Cargo.toml @@ -37,7 +37,7 @@ urlencoding = "2.1.3" futures = "0.3.32" async-trait = "0.1.89" ctor = "1.0.7" -nex-account = { version = "0.2.0", registry = "spbr" } +nex-account = { version = "0.2.1", registry = "spbr" } tonic = "0.14.6" [dev-dependencies] diff --git a/rnex-core/src/nex/friends_handler.rs b/rnex-core/src/nex/friends_handler.rs index 1b83c09..94c9bda 100644 --- a/rnex-core/src/nex/friends_handler.rs +++ b/rnex-core/src/nex/friends_handler.rs @@ -16,6 +16,9 @@ use rnex_core::rmc::protocols::account_management::{ use rnex_core::rmc::protocols::friends_wiiu::{ FriendsWiiU, RawFriendsWiiU, RawFriendsWiiUInfo, RemoteFriendsWiiU, }; +use rnex_core::rmc::protocols::friends_3ds::{ + Friends3DS, RawFriends3DS, RawFriends3DSInfo, RemoteFriends3DS, +}; use rnex_core::rmc::protocols::nintendo_notification::{ NintendoNotification, RawNintendoNotification, RawNintendoNotificationInfo, RemoteNintendoNotification, @@ -56,11 +59,13 @@ use crate::executables::common::get_db; use nex_account::derive_pid_hmac; use nex_account::grpc::ActCreateInfo; use nex_account::grpc::nex_account_service_client::NexAccountServiceClient; +use crate::rmc::protocols::friends_3ds::{FriendComment, FriendMii, FriendMiiList, FriendPersistentInfo, FriendPicture, FriendPresence, FriendRelationship, Mii, MiiList, MyProfile, NintendoPresence, PlayedGame}; define_rmc_proto!( proto FriendsUser{ Secure, - FriendsWiiU + FriendsWiiU, + Friends3DS } ); define_rmc_proto!( @@ -120,6 +125,114 @@ impl FriendsManager { } } +// ALL of this is stubbed +impl Friends3DS for FriendsUser { + async fn update_profile(&self, profile: MyProfile) -> Result<(), ErrorCode> { + Err(ErrorCode::Core_NotImplemented) + } + + async fn update_mii(&self, profile: Mii) -> Result<(), ErrorCode> { + Err(ErrorCode::Core_NotImplemented) + } + + async fn update_mii_list(&self, profile: MiiList) -> Result<(), ErrorCode> { + Err(ErrorCode::Core_NotImplemented) + } + + async fn update_played_games(&self, profile: Vec) -> Result<(), ErrorCode> { + Err(ErrorCode::Core_NotImplemented) + } + + async fn update_preference(&self, show_online_status: bool, show_current_title: bool, block_friend_requests: bool) -> Result<(), ErrorCode> { + // stubbed + Ok(()) + } + + async fn get_friend_mii(&self, friends: Vec) -> Result, ErrorCode> { + Err(ErrorCode::Core_NotImplemented) + } + + async fn get_friend_mii_list(&self, friends: Vec) -> Result, ErrorCode> { + Err(ErrorCode::Core_NotImplemented) + } + + async fn is_active_game(&self, unk: Vec, game_key: crate::rmc::protocols::friends_3ds::GameKey) -> Result, ErrorCode> { + Err(ErrorCode::Core_NotImplemented) + } + + async fn get_principal_id_by_local_friend_code(&self, unk1: u64, unk2: Vec) -> Result, ErrorCode> { + Err(ErrorCode::Core_NotImplemented) + } + + async fn get_friend_relationships(&self, unk2: Vec) -> Result, ErrorCode> { + Err(ErrorCode::Core_NotImplemented) + } + + async fn add_friend_by_pid(&self, unk: u64, pid: PID) -> Result { + Err(ErrorCode::Core_NotImplemented) + } + + async fn add_friend_by_lst_pid(&self, unk: u64, pid: Vec) -> Result, ErrorCode> { + Err(ErrorCode::Core_NotImplemented) + } + + async fn remove_friend_by_local_code(&self, local_code: u64) -> Result<(), ErrorCode> { + Err(ErrorCode::Core_NotImplemented) + } + + async fn remove_friend_by_pid(&self, pid: PID) -> Result<(), ErrorCode> { + Err(ErrorCode::Core_NotImplemented) + } + + async fn get_all_friends(&self) -> Result, ErrorCode> { + Err(ErrorCode::Core_NotImplemented) + } + + async fn update_blacklist(&self) -> Result<(), ErrorCode> { + Ok(()) + } + + async fn sync_friend(&self, unk1: u64, unk2: Vec, unk3: Vec) -> Result, ErrorCode> { + Err(ErrorCode::Core_NotImplemented) + } + + async fn update_presence(&self, nintendo_presence: NintendoPresence, unk: bool) -> Result<(), ErrorCode> { + Ok(()) + } + + async fn update_favorite_game_key(&self, game_key: crate::rmc::protocols::friends_3ds::GameKey) -> Result<(), ErrorCode> { + Ok(()) + } + + async fn update_comment(&self, comment: String) -> Result<(), ErrorCode> { + Ok(()) + } + + async fn update_picture(&self, unk: u32, picture: Vec) -> Result<(), ErrorCode> { + Err(ErrorCode::Core_NotImplemented) + } + + async fn get_friend_presence(&self, unk: Vec) -> Result, ErrorCode> { + Err(ErrorCode::Core_NotImplemented) + } + + async fn get_friend_comment(&self, unk: Vec) -> Result, ErrorCode> { + Err(ErrorCode::Core_NotImplemented) + } + + async fn get_friend_picture(&self, unk: Vec) -> Result, ErrorCode> { + Err(ErrorCode::Core_NotImplemented) + } + + async fn get_friend_persistent_info(&self, unk: Vec) -> Result, ErrorCode> { + Err(ErrorCode::Core_NotImplemented) + } + + async fn send_invitation(&self, unk: Vec) -> Result<(), ErrorCode> { + Err(ErrorCode::Core_NotImplemented) + } +} + impl FriendsWiiU for FriendsUser { async fn update_and_get_all_information( &self,