From 0d026373db1db1a0f355ee348700a291e8b52715 Mon Sep 17 00:00:00 2001 From: Maple Date: Sat, 25 Apr 2026 14:24:33 +0200 Subject: [PATCH] fix compile error --- macros/src/lib.rs | 12 ++++++++++-- prudpv0/src/server.rs | 2 +- rnex-core/src/executables/friends_backend.rs | 6 ++++-- rnex-core/src/nex/friends_handler.rs | 5 ++--- 4 files changed, 17 insertions(+), 8 deletions(-) diff --git a/macros/src/lib.rs b/macros/src/lib.rs index d0fc909..432fc03 100644 --- a/macros/src/lib.rs +++ b/macros/src/lib.rs @@ -10,8 +10,8 @@ use syn::parse::{Parse, ParseStream}; use syn::punctuated::Punctuated; use syn::spanned::Spanned; use syn::{ - parse_macro_input, Attribute, Data, DataStruct, DeriveInput, Fields, FnArg, LitInt, Pat, Token, - TraitItem, + parse_macro_input, Attribute, Data, DataStruct, DeriveInput, Fields, FnArg, Lit, LitInt, + LitStr, Pat, Token, TraitItem, }; struct ProtoInputParams { @@ -400,6 +400,10 @@ pub fn rmc_serialize(input: TokenStream) -> TokenStream { // generate base data + let str_name = Lit::Str(LitStr::new( + &derive_input.ident.to_string(), + derive_input.ident.span(), + )); let ident = derive_input.ident; let tokens = quote! { @@ -414,6 +418,10 @@ pub fn rmc_serialize(input: TokenStream) -> TokenStream { } #write_size + + fn name() -> &'static str{ + #str_name + } } }; diff --git a/prudpv0/src/server.rs b/prudpv0/src/server.rs index a336abb..d7a6dcc 100644 --- a/prudpv0/src/server.rs +++ b/prudpv0/src/server.rs @@ -145,7 +145,7 @@ impl Server { }; info!("send attempt {}", n); - self.socket + this.socket .send_to(&data, conn.addr.regular_socket_addr) .await; diff --git a/rnex-core/src/executables/friends_backend.rs b/rnex-core/src/executables/friends_backend.rs index 6dceda1..5dfcf02 100644 --- a/rnex-core/src/executables/friends_backend.rs +++ b/rnex-core/src/executables/friends_backend.rs @@ -9,7 +9,9 @@ use tokio::net::TcpListener; use crate::{ executables::common::{OWN_IP_PRIVATE, SERVER_PORT, new_simple_backend}, - nex::friends_handler::{FriendsGuest, FriendsManager, FriendsUser, RemoteFriendsUser}, + nex::friends_handler::{ + FriendsGuest, FriendsManager, FriendsUser, RemoteFriendRemote, RemoteFriendsUser, + }, reggie::UnitPacketRead, rmc::{ protocols::{ @@ -59,7 +61,7 @@ pub async fn start_friends_backend() { data: Default::default(), current_friends: Default::default(), this: this.clone(), - remote: RemoteFriendsUser::new(r), + remote: RemoteFriendRemote::new(r), }) }); } else { diff --git a/rnex-core/src/nex/friends_handler.rs b/rnex-core/src/nex/friends_handler.rs index 2d9c2a8..adab2b9 100644 --- a/rnex-core/src/nex/friends_handler.rs +++ b/rnex-core/src/nex/friends_handler.rs @@ -37,9 +37,8 @@ use rnex_core::rmc::protocols::friends::{GameKey, MiiV2, PrincipalBasicInfo}; use rnex_core::PID; -use crate::nex::user; -use crate::rmc::protocols::account_management::NintendoCreateAccountData; -use crate::rmc::protocols::nintendo_notification::NintendoNotificationEvent; +use rnex_core::rmc::protocols::account_management::NintendoCreateAccountData; +use rnex_core::rmc::protocols::nintendo_notification::NintendoNotificationEvent; use rnex_core::rmc::structures::RmcSerialize; define_rmc_proto!(