From 31ba751142c82caa86ed125772098ae46084c004 Mon Sep 17 00:00:00 2001 From: Maple Nebel Date: Sat, 20 Jun 2026 01:28:15 +0200 Subject: [PATCH] fix auth and make console use no response version of message delivery --- .cargo/config.toml | 2 ++ rnex-core/src/nex/remote_console.rs | 5 +++-- rnex-core/src/rmc/protocols/auth.rs | 14 +++++++++++++- 3 files changed, 18 insertions(+), 3 deletions(-) create mode 100644 .cargo/config.toml diff --git a/.cargo/config.toml b/.cargo/config.toml new file mode 100644 index 0000000..74244fd --- /dev/null +++ b/.cargo/config.toml @@ -0,0 +1,2 @@ +[registries] +spbr = { index = "sparse+https://crates.spbr.net/api/v1/crates/" } diff --git a/rnex-core/src/nex/remote_console.rs b/rnex-core/src/nex/remote_console.rs index 016dca1..56663d3 100644 --- a/rnex-core/src/nex/remote_console.rs +++ b/rnex-core/src/nex/remote_console.rs @@ -1,6 +1,7 @@ use crate::define_rmc_proto; use crate::rmc::protocols::message_delivery::{ - MessageDelivery, RawMessageDelivery, RawMessageDeliveryInfo, RemoteMessageDelivery, + MessageDeliveryNoResponse, RawMessageDeliveryNoResponse, RawMessageDeliveryNoResponseInfo, + RemoteMessageDeliveryNoResponse, }; use crate::rmc::protocols::nat_traversal::{ NatTraversalConsole, RawNatTraversalConsole, RawNatTraversalConsoleInfo, @@ -14,7 +15,7 @@ define_rmc_proto!( proto Console{ Notification, NatTraversalConsole, - MessageDelivery + MessageDeliveryNoResponse } ); /* diff --git a/rnex-core/src/rmc/protocols/auth.rs b/rnex-core/src/rmc/protocols/auth.rs index a065418..fd1ec2e 100644 --- a/rnex-core/src/rmc/protocols/auth.rs +++ b/rnex-core/src/rmc/protocols/auth.rs @@ -1,6 +1,7 @@ use crate::rmc::structures::connection_data::{ConnectionData, ConnectionDataOld}; +use crate::rmc::structures::data::Data; use cfg_if::cfg_if; -use macros::{method_id, rmc_proto}; +use macros::{RmcSerialize, method_id, rmc_proto}; use rnex_core::PID; use rnex_core::rmc::response::ErrorCode; use rnex_core::rmc::structures::any::Any; @@ -56,3 +57,14 @@ pub trait Auth { // `LoginWithContext` is left out here because we don't need it right now and versioning still // needs to be figured out } + +#[derive(RmcSerialize)] +#[rmc_struct(0)] +struct AuthenticationInfo { + #[extends] + pub data: Data, + pub auth_token: String, + pub ngs_version: u32, + pub auth_token_type: u8, + pub server_version: u32, +}