serialize data correctly
All checks were successful
Build and Test / minecraft-wiiu (push) Successful in 5m23s
Build and Test / super-mario-maker (push) Successful in 5m28s
Build and Test / friends (push) Successful in 5m45s
Build and Test / splatoon (push) Successful in 6m10s
Build and Test / splatoon-testfire (push) Successful in 6m20s
Build and Test / fast-racing-neo (push) Successful in 6m26s
Build and Test / sonic-transformed (push) Successful in 6m27s
Build and Test / mario-tennis (push) Successful in 6m41s
Build and Test / wii-u-chat (push) Successful in 6m41s
Build and Test / puyopuyo (push) Successful in 7m7s
Build and Test / wii-sports-club (push) Successful in 7m12s

This commit is contained in:
red binder 2026-07-22 02:46:23 +02:00
commit 569f9a53e3
2 changed files with 11 additions and 5 deletions

View file

@ -5,6 +5,7 @@ use rnex_prudp::encryption::EncryptionPair;
use rnex_prudp::ticket::read_secure_connection_data;
use rnex_util::PID;
use rnex_util::account::Account;
use std::io::{Write, Result};
//type Rc4U32 = StreamCipherCoreWrapper<Rc4Core<U32>>;
@ -37,6 +38,13 @@ pub fn generate_secure_encryption_pairs(
vec
}
pub fn serialize_slice(data: &[u8], writer: &mut impl Write) -> Result<()> {
let len = data.len() as u32;
writer.write_all(&len.to_le_bytes())?;
writer.write_all(data)?;
Ok(())
}
pub struct Secure(pub &'static str, pub Account);
pub struct SecureInstance {
@ -67,10 +75,8 @@ impl CryptoHandler for Secure {
let mut response = Vec::new();
response.extend_from_slice(&(response.len() as u32).to_le_bytes());
response.extend_from_slice(&data[..]);
//data.serialize(&mut response).ok()?;
serialize_slice(data, &mut response).ok()?;
let encryption_pairs = generate_secure_encryption_pairs(session_key, substream_count);

View file

@ -957,12 +957,12 @@ impl<E: CryptoHandlerConnectionInstance> SendingConnection<E> {
impl<E: CryptoHandlerConnectionInstance> Drop for InternalConnection<E> {
fn drop(&mut self) {
println!("yatta(internal conn)");
println!("s2s connection disconnected");
}
}
impl Drop for CommonConnection {
fn drop(&mut self) {
println!("yatta(common conn)");
println!("client disconnected");
}
}