2025-09-21 15:59:27 +02:00
|
|
|
use rnex_core::rmc::response::ErrorCode;
|
|
|
|
|
use rnex_core::rmc::structures::any::Any;
|
2025-03-23 10:54:01 +01:00
|
|
|
use crate::rmc::structures::connection_data::ConnectionData;
|
2025-09-21 15:59:27 +02:00
|
|
|
use rnex_core::rmc::structures::qresult::QResult;
|
2025-03-23 10:54:01 +01:00
|
|
|
use macros::{method_id, rmc_proto};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// This is the representation for `Ticket Granting`(for details see the
|
|
|
|
|
/// [kinnay wiki entry](https://github.com/kinnay/NintendoClients/wiki/Authentication-Protocol))
|
|
|
|
|
#[rmc_proto(10)]
|
|
|
|
|
pub trait Auth {
|
2025-03-24 23:31:25 +01:00
|
|
|
/// representation of the `Login` method(for details see the
|
|
|
|
|
/// [kinnay wiki entry](https://github.com/kinnay/NintendoClients/wiki/Authentication-Protocol))
|
2025-03-23 10:54:01 +01:00
|
|
|
#[method_id(1)]
|
|
|
|
|
async fn login(&self, name: String) -> Result<(), ErrorCode>;
|
|
|
|
|
|
2025-03-24 23:31:25 +01:00
|
|
|
/// representation of the `LoginEx` method(for details see the
|
|
|
|
|
/// [kinnay wiki entry](https://github.com/kinnay/NintendoClients/wiki/Authentication-Protocol))
|
2025-03-23 10:54:01 +01:00
|
|
|
#[method_id(2)]
|
|
|
|
|
async fn login_ex(
|
|
|
|
|
&self,
|
|
|
|
|
name: String,
|
|
|
|
|
extra_data: Any,
|
|
|
|
|
) -> Result<(QResult, u32, Vec<u8>, ConnectionData, String), ErrorCode>;
|
|
|
|
|
|
2025-03-24 23:31:25 +01:00
|
|
|
/// representation of the `RequestTicket` method(for details see the
|
|
|
|
|
/// [kinnay wiki entry](https://github.com/kinnay/NintendoClients/wiki/Authentication-Protocol))
|
2025-03-23 10:54:01 +01:00
|
|
|
#[method_id(3)]
|
|
|
|
|
async fn request_ticket(
|
|
|
|
|
&self,
|
|
|
|
|
source_pid: u32,
|
|
|
|
|
destination_pid: u32,
|
|
|
|
|
) -> Result<(QResult, Vec<u8>), ErrorCode>;
|
|
|
|
|
|
2025-03-24 23:31:25 +01:00
|
|
|
/// representation of the `GetPID` method(for details see the
|
|
|
|
|
/// [kinnay wiki entry](https://github.com/kinnay/NintendoClients/wiki/Authentication-Protocol))
|
2025-03-23 10:54:01 +01:00
|
|
|
#[method_id(4)]
|
|
|
|
|
async fn get_pid(&self, username: String) -> Result<u32, ErrorCode>;
|
|
|
|
|
|
2025-03-24 23:31:25 +01:00
|
|
|
/// representation of the `LoginWithContext` method(for details see the
|
|
|
|
|
/// [kinnay wiki entry](https://github.com/kinnay/NintendoClients/wiki/Authentication-Protocol))
|
2025-03-23 10:54:01 +01:00
|
|
|
#[method_id(5)]
|
|
|
|
|
async fn get_name(&self, pid: u32) -> Result<String, ErrorCode>;
|
2025-03-24 23:31:25 +01:00
|
|
|
|
|
|
|
|
// `LoginWithContext` is left out here because we don't need it right now and versioning still
|
|
|
|
|
// needs to be figured out
|
2025-03-23 10:54:01 +01:00
|
|
|
}
|