more stuff
All checks were successful
Build and Test / minecraft-wiiu (push) Successful in 5m4s
Build and Test / sonic-transformed (push) Successful in 5m4s
Build and Test / wii-sports-club (push) Successful in 5m5s
Build and Test / puyopuyo (push) Successful in 5m10s
Build and Test / fast-racing-neo (push) Successful in 5m10s
Build and Test / mario-tennis (push) Successful in 5m11s
Build and Test / splatoon-testfire (push) Successful in 5m22s
Build and Test / splatoon (push) Successful in 5m21s
Build and Test / wii-u-chat (push) Successful in 5m26s
Build and Test / friends (push) Successful in 5m32s
Build and Test / super-mario-maker (push) Successful in 5m33s

This commit is contained in:
Maple Nebel 2026-07-08 01:51:27 +02:00
commit 45a3f7e637
3 changed files with 49 additions and 16 deletions

View file

@ -9,6 +9,7 @@ use rc4::KeyInit;
use rc4::cipher::StreamCipherCoreWrapper;
use rc4::{Rc4, Rc4Core, StreamCipher};
use rnex_core::rmc::structures::RmcSerialize;
use std::fmt::Display;
use std::io::{Read, Write};
use typenum::U16;
use typenum::Unsigned;
@ -33,6 +34,21 @@ type Md5Hmac = Hmac<md5::Md5>;
#[repr(transparent)]
pub struct KerberosDateTime(pub u64);
impl Display for KerberosDateTime {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(
f,
"{}.{}.{} {}:{}:{}",
self.get_year(),
self.get_month(),
self.get_days(),
self.get_hours(),
self.get_minutes(),
self.get_seconds()
)
}
}
impl KerberosDateTime {
// this is the time which smm returned as the expriy date, we use it as a
// date so far into the future that it might as well just be never more generally
@ -86,13 +102,20 @@ impl KerberosDateTime {
(self.0 >> 26) & 0xFFFFFFFF
}
pub fn to_regular_time(&self) -> chrono::DateTime<Utc> {
let date = match NaiveDate::from_ymd_opt(
self.get_year() as i32,
self.get_month() as u32,
self.get_days() as u32,
) {
Some(v) => v,
None => {
println!("invalid datetime...: {}", self);
Default::default()
}
};
NaiveDateTime::new(
NaiveDate::from_ymd_opt(
self.get_year() as i32,
self.get_month() as u32,
self.get_days() as u32,
)
.unwrap_or_default(),
date,
NaiveTime::from_hms_opt(
self.get_hours() as u32,
self.get_minutes() as u32,
@ -106,7 +129,7 @@ impl KerberosDateTime {
impl Default for KerberosDateTime {
fn default() -> Self {
Self::now()
KerberosDateTime(0)
}
}

View file

@ -627,7 +627,7 @@ impl FriendsWiiU for FriendsUser {
.insert(self.pid, self.this.clone());
<Self as FriendsWiiU>::update_presence(self, presence).await?;
Ok((
dbg!(Ok((
PrincipalPreference {
data: Data {},
block_friend_request: query.principal_preference_block_friend_requests,
@ -649,7 +649,7 @@ impl FriendsWiiU for FriendsUser {
// todo: persistent notifications
vec![],
false,
))
)))
}
async fn add_friend(&self, friend: PID) -> Result<(FriendRequest, FriendInfo), ErrorCode> {
@ -791,7 +791,17 @@ impl FriendsWiiU for FriendsUser {
.await;
}
Ok((fr, Default::default()))
Ok((
fr,
FriendInfo {
presence: NintendoPresenceV2 {
game_key,
app_data: vec![0x00],
..Default::default()
},
..Default::default()
},
))
}
async fn cancel_friend_request(&self, id: u64) -> Result<(), ErrorCode> {

View file

@ -79,7 +79,7 @@ pub struct PrincipalPreference {
pub block_friend_request: bool,
}
#[derive(RmcSerialize, Default)]
#[derive(RmcSerialize, Default, Debug)]
#[rmc_struct(0)]
pub struct Comment {
#[extends]
@ -89,7 +89,7 @@ pub struct Comment {
pub last_changed: KerberosDateTime,
}
#[derive(RmcSerialize, Default)]
#[derive(RmcSerialize, Default, Debug)]
#[rmc_struct(0)]
pub struct FriendInfo {
#[extends]
@ -102,7 +102,7 @@ pub struct FriendInfo {
pub unk: u64,
}
#[derive(RmcSerialize)]
#[derive(RmcSerialize, Debug)]
#[rmc_struct(0)]
pub struct FriendRequestMessage {
#[extends]
@ -118,7 +118,7 @@ pub struct FriendRequestMessage {
pub expires_on: KerberosDateTime,
}
#[derive(RmcSerialize)]
#[derive(RmcSerialize, Debug)]
#[rmc_struct(0)]
pub struct FriendRequest {
#[extends]
@ -128,7 +128,7 @@ pub struct FriendRequest {
pub sent_on: KerberosDateTime,
}
#[derive(RmcSerialize)]
#[derive(RmcSerialize, Debug)]
#[rmc_struct(0)]
pub struct BlacklistedPrincipal {
#[extends]
@ -137,7 +137,7 @@ pub struct BlacklistedPrincipal {
pub game_key: GameKey,
pub since: KerberosDateTime,
}
#[derive(RmcSerialize)]
#[derive(RmcSerialize, Debug)]
#[rmc_struct(0)]
pub struct PersistentNotification {
#[extends]