diff --git a/rnex-core/src/nex/friends_handler.rs b/rnex-core/src/nex/friends_handler.rs index 08cca05..941b747 100644 --- a/rnex-core/src/nex/friends_handler.rs +++ b/rnex-core/src/nex/friends_handler.rs @@ -101,6 +101,7 @@ pub fn friend_info_from_user(data: &UserData) -> FriendInfo { nna_info: data.info.clone(), presence: data.presence.clone(), comment: Comment { + data: Data {}, unk: 0, message: "haii =w=".to_string(), last_changed: KerberosDateTime::now(), @@ -140,54 +141,59 @@ impl Friends for FriendsUser { }; drop(data); - let mut fr_list = - vec![FriendInfo { + let mut fr_list = vec![FriendInfo { + data: Data{}, + became_friends: KerberosDateTime::now(), + comment: Comment { data: Data{}, - became_friends: KerberosDateTime::now(), - comment: Comment { - last_changed: KerberosDateTime::now(), - message: "I'm just a dummy account :3".to_string(), - unk: 0, - }, - last_online: KerberosDateTime::now(), - nna_info: NNAInfo { - principal_basic_info: PrincipalBasicInfo { - pid: 101, - nnid: "dummy:3".to_string(), - mii: MiiV2{ - date_time: KerberosDateTime::now(), - name: "TheDummy".to_string(), - mii_data: hex::decode("030000402bd7c32986a771f2dc6b35e31da15e37ff7c0000391e6f006f006d0069000000000000000000000000004040001065033568641e2013661a611821640f0000290052485000000000000000000000000000000000000000000000e838").unwrap(), - unk: 0, - unk2: 0, - }, - unk: 0 - }, - unk: 0, - unk2: 0 - }, - presence: NintendoPresenceV2{ - changed_flags: 0, - message: "".to_string(), - app_data: vec![], - game_key: GameKey{ - tid: 0x00050002101ce400, - version: 0x0 - }, - game_server_id: 0, - is_online: true, - gid: 0, + last_changed: KerberosDateTime::now(), + message: "I'm just a dummy account :3".to_string(), + unk: 0, + }, + last_online: KerberosDateTime::now(), + nna_info: NNAInfo { + data: Data{}, + principal_basic_info: PrincipalBasicInfo { + data: Data{}, pid: 101, - unk: 0, - unk2: 0, - unk3: 0, - unk4: 0, - unk5: 0, - unk6: 0, - unk7: 0 + nnid: "dummy:3".to_string(), + mii: MiiV2{ + data: Data{}, + date_time: KerberosDateTime::now(), + name: "TheDummy".to_string(), + mii_data: hex::decode("030000402bd7c32986a771f2dc6b35e31da15e37ff7c0000391e6f006f006d0069000000000000000000000000004040001065033568641e2013661a611821640f0000290052485000000000000000000000000000000000000000000000e838").unwrap(), + unk: 0, + unk2: 0, + }, + unk: 0 }, - unk: 0 - }]; + unk: 0, + unk2: 0 + }, + presence: NintendoPresenceV2{ + data: Data{}, + changed_flags: 0, + message: "".to_string(), + app_data: vec![], + game_key: GameKey{ + data: Data{}, + tid: 0x00050002101ce400, + version: 0x0 + }, + game_server_id: 0, + is_online: true, + gid: 0, + pid: 101, + unk: 0, + unk2: 0, + unk3: 0, + unk4: 0, + unk5: 0, + unk6: 0, + unk7: 0 + }, + unk: 0 + }]; println!("acquiring user and current friends locks"); let users = self.fm.users.read().await; @@ -235,11 +241,13 @@ impl Friends for FriendsUser { println!("done..."); Ok(( PrincipalPreference { + data: Data {}, block_friend_request: false, show_online: false, show_playing_title: false, }, Comment { + data: Data {}, last_changed: KerberosDateTime::now(), message: "".to_string(), unk: 0, diff --git a/rnex-core/src/rmc/protocols/friends.rs b/rnex-core/src/rmc/protocols/friends.rs index fa32120..81dd63e 100644 --- a/rnex-core/src/rmc/protocols/friends.rs +++ b/rnex-core/src/rmc/protocols/friends.rs @@ -7,6 +7,8 @@ use rnex_core::rmc::structures::{data::Data, rmc_struct}; #[derive(RmcSerialize, Debug, Clone)] #[rmc_struct(0)] pub struct MiiV2 { + #[extends] + pub data: Data, pub name: String, pub unk: u8, pub unk2: u8, @@ -17,6 +19,8 @@ pub struct MiiV2 { #[derive(RmcSerialize, Debug, Clone)] #[rmc_struct(0)] pub struct PrincipalBasicInfo { + #[extends] + pub data: Data, pub pid: u32, pub nnid: String, pub mii: MiiV2, @@ -26,6 +30,8 @@ pub struct PrincipalBasicInfo { #[derive(RmcSerialize, Debug, Clone)] #[rmc_struct(0)] pub struct NNAInfo { + #[extends] + pub data: Data, pub principal_basic_info: PrincipalBasicInfo, pub unk: u8, pub unk2: u8, @@ -34,6 +40,8 @@ pub struct NNAInfo { #[derive(RmcSerialize, Clone, Copy, Debug)] #[rmc_struct(0)] pub struct GameKey { + #[extends] + pub data: Data, pub tid: u64, pub version: u16, } @@ -41,6 +49,8 @@ pub struct GameKey { #[derive(RmcSerialize, Clone, Debug)] #[rmc_struct(0)] pub struct NintendoPresenceV2 { + #[extends] + pub data: Data, pub changed_flags: u32, pub is_online: bool, pub game_key: GameKey, @@ -60,6 +70,8 @@ pub struct NintendoPresenceV2 { #[derive(RmcSerialize)] #[rmc_struct(0)] pub struct PrincipalPreference { + #[extends] + pub data: Data, pub show_online: bool, pub show_playing_title: bool, pub block_friend_request: bool, @@ -68,6 +80,8 @@ pub struct PrincipalPreference { #[derive(RmcSerialize)] #[rmc_struct(0)] pub struct Comment { + #[extends] + pub data: Data, pub unk: u8, pub message: String, pub last_changed: KerberosDateTime, @@ -89,6 +103,8 @@ pub struct FriendInfo { #[derive(RmcSerialize)] #[rmc_struct(0)] pub struct FriendRequestMessage { + #[extends] + pub data: Data, pub friend_request_id: u64, pub is_recieved: u8, pub unk: u8, @@ -103,6 +119,8 @@ pub struct FriendRequestMessage { #[derive(RmcSerialize)] #[rmc_struct(0)] pub struct FriendRequest { + #[extends] + pub data: Data, pub basic_info: PrincipalBasicInfo, pub request_message: FriendRequestMessage, pub sent_on: KerberosDateTime, @@ -111,6 +129,8 @@ pub struct FriendRequest { #[derive(RmcSerialize)] #[rmc_struct(0)] pub struct BlacklistedPrincipal { + #[extends] + pub data: Data, pub basic_info: PrincipalBasicInfo, pub game_key: GameKey, pub since: KerberosDateTime, @@ -118,6 +138,8 @@ pub struct BlacklistedPrincipal { #[derive(RmcSerialize)] #[rmc_struct(0)] pub struct PersistentNotification { + #[extends] + pub data: Data, pub unk1: u64, pub unk2: u32, pub unk3: u32, diff --git a/rnex-core/src/rmc/structures/data.rs b/rnex-core/src/rmc/structures/data.rs index 0350c96..c6064ae 100644 --- a/rnex-core/src/rmc/structures/data.rs +++ b/rnex-core/src/rmc/structures/data.rs @@ -1,5 +1,5 @@ use macros::RmcSerialize; -#[derive(RmcSerialize)] +#[derive(RmcSerialize, Debug, Clone, Copy)] #[rmc_struct(0)] pub struct Data {}