add data to structs which were missing it

This commit is contained in:
Maple 2026-04-25 19:15:23 +02:00
commit 9d89bc56e0
3 changed files with 75 additions and 45 deletions

View file

@ -101,6 +101,7 @@ pub fn friend_info_from_user(data: &UserData) -> FriendInfo {
nna_info: data.info.clone(), nna_info: data.info.clone(),
presence: data.presence.clone(), presence: data.presence.clone(),
comment: Comment { comment: Comment {
data: Data {},
unk: 0, unk: 0,
message: "haii =w=".to_string(), message: "haii =w=".to_string(),
last_changed: KerberosDateTime::now(), last_changed: KerberosDateTime::now(),
@ -140,54 +141,59 @@ impl Friends for FriendsUser {
}; };
drop(data); drop(data);
let mut fr_list = let mut fr_list = vec![FriendInfo {
vec![FriendInfo { data: Data{},
became_friends: KerberosDateTime::now(),
comment: Comment {
data: Data{}, data: Data{},
became_friends: KerberosDateTime::now(), last_changed: KerberosDateTime::now(),
comment: Comment { message: "I'm just a dummy account :3".to_string(),
last_changed: KerberosDateTime::now(), unk: 0,
message: "I'm just a dummy account :3".to_string(), },
unk: 0, last_online: KerberosDateTime::now(),
}, nna_info: NNAInfo {
last_online: KerberosDateTime::now(), data: Data{},
nna_info: NNAInfo { principal_basic_info: PrincipalBasicInfo {
principal_basic_info: PrincipalBasicInfo { data: Data{},
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,
pid: 101, pid: 101,
unk: 0, nnid: "dummy:3".to_string(),
unk2: 0, mii: MiiV2{
unk3: 0, data: Data{},
unk4: 0, date_time: KerberosDateTime::now(),
unk5: 0, name: "TheDummy".to_string(),
unk6: 0, mii_data: hex::decode("030000402bd7c32986a771f2dc6b35e31da15e37ff7c0000391e6f006f006d0069000000000000000000000000004040001065033568641e2013661a611821640f0000290052485000000000000000000000000000000000000000000000e838").unwrap(),
unk7: 0 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"); println!("acquiring user and current friends locks");
let users = self.fm.users.read().await; let users = self.fm.users.read().await;
@ -235,11 +241,13 @@ impl Friends for FriendsUser {
println!("done..."); println!("done...");
Ok(( Ok((
PrincipalPreference { PrincipalPreference {
data: Data {},
block_friend_request: false, block_friend_request: false,
show_online: false, show_online: false,
show_playing_title: false, show_playing_title: false,
}, },
Comment { Comment {
data: Data {},
last_changed: KerberosDateTime::now(), last_changed: KerberosDateTime::now(),
message: "".to_string(), message: "".to_string(),
unk: 0, unk: 0,

View file

@ -7,6 +7,8 @@ use rnex_core::rmc::structures::{data::Data, rmc_struct};
#[derive(RmcSerialize, Debug, Clone)] #[derive(RmcSerialize, Debug, Clone)]
#[rmc_struct(0)] #[rmc_struct(0)]
pub struct MiiV2 { pub struct MiiV2 {
#[extends]
pub data: Data,
pub name: String, pub name: String,
pub unk: u8, pub unk: u8,
pub unk2: u8, pub unk2: u8,
@ -17,6 +19,8 @@ pub struct MiiV2 {
#[derive(RmcSerialize, Debug, Clone)] #[derive(RmcSerialize, Debug, Clone)]
#[rmc_struct(0)] #[rmc_struct(0)]
pub struct PrincipalBasicInfo { pub struct PrincipalBasicInfo {
#[extends]
pub data: Data,
pub pid: u32, pub pid: u32,
pub nnid: String, pub nnid: String,
pub mii: MiiV2, pub mii: MiiV2,
@ -26,6 +30,8 @@ pub struct PrincipalBasicInfo {
#[derive(RmcSerialize, Debug, Clone)] #[derive(RmcSerialize, Debug, Clone)]
#[rmc_struct(0)] #[rmc_struct(0)]
pub struct NNAInfo { pub struct NNAInfo {
#[extends]
pub data: Data,
pub principal_basic_info: PrincipalBasicInfo, pub principal_basic_info: PrincipalBasicInfo,
pub unk: u8, pub unk: u8,
pub unk2: u8, pub unk2: u8,
@ -34,6 +40,8 @@ pub struct NNAInfo {
#[derive(RmcSerialize, Clone, Copy, Debug)] #[derive(RmcSerialize, Clone, Copy, Debug)]
#[rmc_struct(0)] #[rmc_struct(0)]
pub struct GameKey { pub struct GameKey {
#[extends]
pub data: Data,
pub tid: u64, pub tid: u64,
pub version: u16, pub version: u16,
} }
@ -41,6 +49,8 @@ pub struct GameKey {
#[derive(RmcSerialize, Clone, Debug)] #[derive(RmcSerialize, Clone, Debug)]
#[rmc_struct(0)] #[rmc_struct(0)]
pub struct NintendoPresenceV2 { pub struct NintendoPresenceV2 {
#[extends]
pub data: Data,
pub changed_flags: u32, pub changed_flags: u32,
pub is_online: bool, pub is_online: bool,
pub game_key: GameKey, pub game_key: GameKey,
@ -60,6 +70,8 @@ pub struct NintendoPresenceV2 {
#[derive(RmcSerialize)] #[derive(RmcSerialize)]
#[rmc_struct(0)] #[rmc_struct(0)]
pub struct PrincipalPreference { pub struct PrincipalPreference {
#[extends]
pub data: Data,
pub show_online: bool, pub show_online: bool,
pub show_playing_title: bool, pub show_playing_title: bool,
pub block_friend_request: bool, pub block_friend_request: bool,
@ -68,6 +80,8 @@ pub struct PrincipalPreference {
#[derive(RmcSerialize)] #[derive(RmcSerialize)]
#[rmc_struct(0)] #[rmc_struct(0)]
pub struct Comment { pub struct Comment {
#[extends]
pub data: Data,
pub unk: u8, pub unk: u8,
pub message: String, pub message: String,
pub last_changed: KerberosDateTime, pub last_changed: KerberosDateTime,
@ -89,6 +103,8 @@ pub struct FriendInfo {
#[derive(RmcSerialize)] #[derive(RmcSerialize)]
#[rmc_struct(0)] #[rmc_struct(0)]
pub struct FriendRequestMessage { pub struct FriendRequestMessage {
#[extends]
pub data: Data,
pub friend_request_id: u64, pub friend_request_id: u64,
pub is_recieved: u8, pub is_recieved: u8,
pub unk: u8, pub unk: u8,
@ -103,6 +119,8 @@ pub struct FriendRequestMessage {
#[derive(RmcSerialize)] #[derive(RmcSerialize)]
#[rmc_struct(0)] #[rmc_struct(0)]
pub struct FriendRequest { pub struct FriendRequest {
#[extends]
pub data: Data,
pub basic_info: PrincipalBasicInfo, pub basic_info: PrincipalBasicInfo,
pub request_message: FriendRequestMessage, pub request_message: FriendRequestMessage,
pub sent_on: KerberosDateTime, pub sent_on: KerberosDateTime,
@ -111,6 +129,8 @@ pub struct FriendRequest {
#[derive(RmcSerialize)] #[derive(RmcSerialize)]
#[rmc_struct(0)] #[rmc_struct(0)]
pub struct BlacklistedPrincipal { pub struct BlacklistedPrincipal {
#[extends]
pub data: Data,
pub basic_info: PrincipalBasicInfo, pub basic_info: PrincipalBasicInfo,
pub game_key: GameKey, pub game_key: GameKey,
pub since: KerberosDateTime, pub since: KerberosDateTime,
@ -118,6 +138,8 @@ pub struct BlacklistedPrincipal {
#[derive(RmcSerialize)] #[derive(RmcSerialize)]
#[rmc_struct(0)] #[rmc_struct(0)]
pub struct PersistentNotification { pub struct PersistentNotification {
#[extends]
pub data: Data,
pub unk1: u64, pub unk1: u64,
pub unk2: u32, pub unk2: u32,
pub unk3: u32, pub unk3: u32,

View file

@ -1,5 +1,5 @@
use macros::RmcSerialize; use macros::RmcSerialize;
#[derive(RmcSerialize)] #[derive(RmcSerialize, Debug, Clone, Copy)]
#[rmc_struct(0)] #[rmc_struct(0)]
pub struct Data {} pub struct Data {}