progress
Some checks failed
Build and Test / super-mario-maker (push) Failing after 10m30s
Build and Test / fast-racing-neo (push) Failing after 11m40s
Build and Test / friends (push) Failing after 11m56s
Build and Test / wii-sports-club (push) Failing after 12m9s
Build and Test / splatoon (push) Failing after 12m14s
Build and Test / puyopuyo (push) Failing after 12m23s
Build and Test / wii-u-chat (push) Failing after 12m23s
Build and Test / mario-tennis (push) Failing after 12m23s
Build and Test / sonic-transformed (push) Failing after 12m23s
Build and Test / splatoon-testfire (push) Failing after 12m30s
Build and Test / minecraft-wiiu (push) Failing after 12m37s
Some checks failed
Build and Test / super-mario-maker (push) Failing after 10m30s
Build and Test / fast-racing-neo (push) Failing after 11m40s
Build and Test / friends (push) Failing after 11m56s
Build and Test / wii-sports-club (push) Failing after 12m9s
Build and Test / splatoon (push) Failing after 12m14s
Build and Test / puyopuyo (push) Failing after 12m23s
Build and Test / wii-u-chat (push) Failing after 12m23s
Build and Test / mario-tennis (push) Failing after 12m23s
Build and Test / sonic-transformed (push) Failing after 12m23s
Build and Test / splatoon-testfire (push) Failing after 12m30s
Build and Test / minecraft-wiiu (push) Failing after 12m37s
This commit is contained in:
parent
7dd502aa7a
commit
4ff0a5efcc
187 changed files with 4526 additions and 5132 deletions
16
rnex-protocols/auth-protos/Cargo.toml
Normal file
16
rnex-protocols/auth-protos/Cargo.toml
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
[package]
|
||||
name = "rnex-auth-protos"
|
||||
version = "0.1.0"
|
||||
edition = "2024"
|
||||
|
||||
[dependencies]
|
||||
cfg-if = "1.0.4"
|
||||
ctor = "1.0.8"
|
||||
rnex-rmc = { path = "../../rnex-rmc" }
|
||||
tokio = { version = "1.52.3", features = ["time", "sync"] }
|
||||
|
||||
[features]
|
||||
nx = []
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
89
rnex-protocols/auth-protos/src/auth.rs
Normal file
89
rnex-protocols/auth-protos/src/auth.rs
Normal file
|
|
@ -0,0 +1,89 @@
|
|||
use cfg_if::cfg_if;
|
||||
use rnex_rmc::{
|
||||
RmcSerialize,
|
||||
any::Any,
|
||||
data::Data,
|
||||
method_id,
|
||||
qresult::QResult,
|
||||
response::ErrorCode,
|
||||
rmc_proto,
|
||||
util::{PID, date_time::DateTime},
|
||||
};
|
||||
|
||||
#[derive(Debug, RmcSerialize)]
|
||||
#[rmc_struct(1)]
|
||||
pub struct ConnectionData {
|
||||
pub station_url: String,
|
||||
pub special_protocols: Vec<u8>,
|
||||
pub special_station_url: String,
|
||||
pub date_time: DateTime,
|
||||
}
|
||||
|
||||
#[derive(Debug, RmcSerialize)]
|
||||
#[rmc_struct(1)]
|
||||
pub struct ConnectionDataOld {
|
||||
pub station_url: String,
|
||||
pub special_protocols: Vec<u8>,
|
||||
pub special_station_url: String,
|
||||
}
|
||||
|
||||
cfg_if! {
|
||||
if #[cfg(feature = "nx")]{
|
||||
type LoginExRet = (QResult, PID, Vec<u8>, ConnectionData, String, String);
|
||||
type RequestTicketRet = (QResult, Vec<u8>, String);
|
||||
} else {
|
||||
type LoginExRet = (QResult, PID, Vec<u8>, ConnectionData, String);
|
||||
type RequestTicketRet = (QResult, Vec<u8>);
|
||||
}
|
||||
}
|
||||
|
||||
/// 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 {
|
||||
/// representation of the `Login` method(for details see the
|
||||
/// [kinnay wiki entry](https://github.com/kinnay/NintendoClients/wiki/Authentication-Protocol))
|
||||
#[method_id(1)]
|
||||
async fn login(
|
||||
&self,
|
||||
name: String,
|
||||
) -> Result<(QResult, PID, Vec<u8>, ConnectionDataOld, String), ErrorCode>;
|
||||
|
||||
/// representation of the `LoginEx` method(for details see the
|
||||
/// [kinnay wiki entry](https://github.com/kinnay/NintendoClients/wiki/Authentication-Protocol))
|
||||
#[method_id(2)]
|
||||
async fn login_ex(&self, name: String, extra_data: Any) -> Result<LoginExRet, ErrorCode>;
|
||||
|
||||
/// representation of the `RequestTicket` method(for details see the
|
||||
/// [kinnay wiki entry](https://github.com/kinnay/NintendoClients/wiki/Authentication-Protocol))
|
||||
#[method_id(3)]
|
||||
async fn request_ticket(
|
||||
&self,
|
||||
source_pid: PID,
|
||||
destination_pid: PID,
|
||||
) -> Result<RequestTicketRet, ErrorCode>;
|
||||
|
||||
/// representation of the `GetPID` method(for details see the
|
||||
/// [kinnay wiki entry](https://github.com/kinnay/NintendoClients/wiki/Authentication-Protocol))
|
||||
#[method_id(4)]
|
||||
async fn get_pid(&self, username: String) -> Result<u32, ErrorCode>;
|
||||
|
||||
/// representation of the `LoginWithContext` method(for details see the
|
||||
/// [kinnay wiki entry](https://github.com/kinnay/NintendoClients/wiki/Authentication-Protocol))
|
||||
#[method_id(5)]
|
||||
async fn get_name(&self, pid: PID) -> Result<String, ErrorCode>;
|
||||
|
||||
// `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,
|
||||
}
|
||||
11
rnex-protocols/auth-protos/src/lib.rs
Normal file
11
rnex-protocols/auth-protos/src/lib.rs
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
#![allow(async_fn_in_trait)]
|
||||
|
||||
use rnex_rmc::define_rmc_proto;
|
||||
pub mod auth;
|
||||
use auth::{Auth, RawAuth, RawAuthInfo, RemoteAuth};
|
||||
|
||||
define_rmc_proto!(
|
||||
proto AuthProtocol{
|
||||
Auth
|
||||
}
|
||||
);
|
||||
11
rnex-protocols/base-protos/Cargo.toml
Normal file
11
rnex-protocols/base-protos/Cargo.toml
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
[package]
|
||||
name = "rnex-base-protos"
|
||||
version = "0.1.0"
|
||||
edition = "2024"
|
||||
|
||||
[dependencies]
|
||||
ctor = "1.0.8"
|
||||
rnex-rmc = { path = "../../rnex-rmc" }
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
31
rnex-protocols/base-protos/src/lib.rs
Normal file
31
rnex-protocols/base-protos/src/lib.rs
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
#![allow(async_fn_in_trait)]
|
||||
|
||||
use rnex_rmc::{RmcSerialize, define_rmc_proto};
|
||||
pub mod secure;
|
||||
pub mod util;
|
||||
use secure::{RawSecure, RawSecureInfo, RemoteSecure, Secure};
|
||||
use util::{RawUtility, RawUtilityInfo, RemoteUtility, Utility};
|
||||
|
||||
#[derive(RmcSerialize, Debug, Default, Clone)]
|
||||
#[rmc_struct(0)]
|
||||
pub struct ResultsRange {
|
||||
pub offset: u32,
|
||||
pub size: u32,
|
||||
}
|
||||
|
||||
impl ResultsRange {
|
||||
pub fn make_from_list<T: Clone>(&self, list: &[T]) -> Vec<T> {
|
||||
let end = usize::max(list.len(), self.offset as usize + self.size as usize);
|
||||
|
||||
list.get(self.offset as usize..end)
|
||||
.unwrap_or_default()
|
||||
.into()
|
||||
}
|
||||
}
|
||||
|
||||
define_rmc_proto!(
|
||||
proto BaseProtocol{
|
||||
Secure,
|
||||
Utility,
|
||||
}
|
||||
);
|
||||
38
rnex-protocols/base-protos/src/secure.rs
Normal file
38
rnex-protocols/base-protos/src/secure.rs
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
use rnex_rmc::{
|
||||
RmcSerialize, any::Any, data::Data, method_id, qresult::QResult, response::ErrorCode,
|
||||
rmc_proto, util::station_url::StationUrl,
|
||||
};
|
||||
|
||||
#[derive(RmcSerialize)]
|
||||
#[rmc_struct(0)]
|
||||
struct NintendoLoginData {
|
||||
#[extends]
|
||||
data: Data,
|
||||
token: String,
|
||||
}
|
||||
|
||||
#[derive(RmcSerialize)]
|
||||
#[rmc_struct(0)]
|
||||
struct AccountExtraInfo {
|
||||
#[extends]
|
||||
data: Data,
|
||||
token: String,
|
||||
}
|
||||
|
||||
#[rmc_proto(11)]
|
||||
pub trait Secure {
|
||||
#[method_id(1)]
|
||||
async fn register(
|
||||
&self,
|
||||
station_urls: Vec<StationUrl>,
|
||||
) -> Result<(QResult, u32, StationUrl), ErrorCode>;
|
||||
|
||||
#[method_id(4)]
|
||||
async fn register_ex(
|
||||
&self,
|
||||
station_urls: Vec<StationUrl>,
|
||||
data: Any,
|
||||
) -> Result<(QResult, u32, StationUrl), ErrorCode>;
|
||||
#[method_id(7)]
|
||||
async fn replace_url(&self, target: StationUrl, dest: StationUrl) -> Result<(), ErrorCode>;
|
||||
}
|
||||
9
rnex-protocols/base-protos/src/util.rs
Normal file
9
rnex-protocols/base-protos/src/util.rs
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
use rnex_rmc::{method_id, response::ErrorCode, rmc_proto};
|
||||
|
||||
#[rmc_proto(110)]
|
||||
pub trait Utility {
|
||||
#[method_id(1)]
|
||||
async fn acquire_nex_unique_id(&self) -> Result<u64, ErrorCode>;
|
||||
#[method_id(7)]
|
||||
async fn get_integer_settings(&self, index: u32) -> Result<Vec<(u16, i32)>, ErrorCode>;
|
||||
}
|
||||
12
rnex-protocols/ds-protos/Cargo.toml
Normal file
12
rnex-protocols/ds-protos/Cargo.toml
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
[package]
|
||||
name = "rnex-ds-protos"
|
||||
version = "0.1.0"
|
||||
edition = "2024"
|
||||
|
||||
[dependencies]
|
||||
ctor = "1.0.8"
|
||||
rnex-rmc = { path = "../../rnex-rmc" }
|
||||
rnex-base-protos = { path = "../base-protos" }
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
460
rnex-protocols/ds-protos/src/datastore.rs
Normal file
460
rnex-protocols/ds-protos/src/datastore.rs
Normal file
|
|
@ -0,0 +1,460 @@
|
|||
use rnex_base_protos::ResultsRange;
|
||||
use rnex_rmc::{
|
||||
RmcSerialize, method_id,
|
||||
qbuffer::QBuffer,
|
||||
qresult::QResult,
|
||||
response::ErrorCode,
|
||||
rmc_proto,
|
||||
util::{PID, date_time::DateTime},
|
||||
};
|
||||
|
||||
#[derive(RmcSerialize, Clone, Debug, Default)]
|
||||
#[rmc_struct(0)]
|
||||
pub struct PersistenceTarget {
|
||||
pub owner: PID,
|
||||
pub persistence_slot_id: u16,
|
||||
}
|
||||
|
||||
#[derive(RmcSerialize, Clone, Debug, Default)]
|
||||
#[rmc_struct(0)]
|
||||
pub struct Permission {
|
||||
pub permission: u8,
|
||||
pub recipient_ids: Vec<PID>,
|
||||
}
|
||||
|
||||
#[derive(RmcSerialize, Clone, Default)]
|
||||
#[rmc_struct(0)]
|
||||
pub struct RatingInfoWithSlot {
|
||||
pub slot: i8,
|
||||
pub rating: RatingInfo,
|
||||
}
|
||||
|
||||
#[derive(RmcSerialize, Clone, Default)]
|
||||
#[rmc_struct(0)]
|
||||
pub struct RatingInfo {
|
||||
pub total_value: i64,
|
||||
pub count: u32,
|
||||
pub initial_value: i64,
|
||||
}
|
||||
|
||||
#[derive(RmcSerialize, Clone, Default)]
|
||||
#[rmc_struct(0)]
|
||||
pub struct GetMetaParam {
|
||||
pub dataid: i64,
|
||||
pub persistence_target: PersistenceTarget,
|
||||
pub result_option: u8,
|
||||
pub access_password: i64,
|
||||
}
|
||||
|
||||
#[derive(RmcSerialize, Clone, Default)]
|
||||
#[rmc_struct(0)]
|
||||
pub struct GetMetaInfo {
|
||||
pub dataid: i64,
|
||||
pub owner: PID,
|
||||
pub size: u32,
|
||||
pub name: String,
|
||||
pub data_type: u16,
|
||||
pub meta_binary: QBuffer,
|
||||
pub permission: Permission,
|
||||
pub del_permission: Permission,
|
||||
pub created_time: DateTime,
|
||||
pub updated_time: DateTime,
|
||||
pub period: u16,
|
||||
pub status: u8,
|
||||
pub referred_count: u32,
|
||||
pub refer_dat_id: u32,
|
||||
pub flag: u32,
|
||||
pub referred_time: DateTime,
|
||||
pub expire_time: DateTime,
|
||||
pub tags: Vec<String>,
|
||||
pub ratings: Vec<RatingInfoWithSlot>,
|
||||
}
|
||||
|
||||
#[derive(RmcSerialize, Clone, Debug)]
|
||||
#[rmc_struct(0)]
|
||||
pub struct RatingInitParam {
|
||||
pub flag: u8,
|
||||
pub internal_flag: u8,
|
||||
pub lock_type: u8,
|
||||
pub initial_value: i64,
|
||||
pub range_min: i32,
|
||||
pub range_max: i32,
|
||||
pub period_hour: i8,
|
||||
pub period_duration: i16,
|
||||
}
|
||||
|
||||
#[derive(RmcSerialize, Clone, Debug)]
|
||||
#[rmc_struct(0)]
|
||||
pub struct RatingInitParamWithSlot {
|
||||
pub slot: i8,
|
||||
pub param: RatingInitParam,
|
||||
}
|
||||
|
||||
#[derive(RmcSerialize, Clone, Debug)]
|
||||
#[rmc_struct(0)]
|
||||
pub struct PersistenceInitParam {
|
||||
pub persistence_slot_id: u16,
|
||||
pub delete_last_object: bool,
|
||||
}
|
||||
|
||||
#[derive(RmcSerialize, Clone)]
|
||||
#[rmc_struct(0)]
|
||||
pub struct KeyValue {
|
||||
pub key: String,
|
||||
pub value: String,
|
||||
}
|
||||
|
||||
#[derive(RmcSerialize, Clone, Debug)]
|
||||
#[rmc_struct(0)]
|
||||
pub struct PreparePostParam {
|
||||
pub size: i32,
|
||||
pub name: String,
|
||||
pub data_type: i16,
|
||||
pub meta_binary: QBuffer,
|
||||
pub permission: Permission,
|
||||
pub del_permission: Permission,
|
||||
pub flag: i32,
|
||||
pub period: i16,
|
||||
pub refer_data_id: i32,
|
||||
pub tags: Vec<String>,
|
||||
pub rating_init_params: Vec<RatingInitParamWithSlot>,
|
||||
pub persistence_init_param: PersistenceInitParam,
|
||||
pub extra_data: Vec<String>,
|
||||
}
|
||||
|
||||
#[derive(RmcSerialize, Clone)]
|
||||
#[rmc_struct(0)]
|
||||
pub struct ReqPostInfo {
|
||||
pub dataid: i64,
|
||||
pub url: String,
|
||||
pub request_headers: Vec<KeyValue>,
|
||||
pub form_fields: Vec<KeyValue>,
|
||||
pub root_ca_cert: Vec<u8>,
|
||||
}
|
||||
|
||||
#[derive(RmcSerialize, Clone)]
|
||||
#[rmc_struct(0)]
|
||||
pub struct CompletePostParam {
|
||||
pub dataid: i64,
|
||||
pub success: bool,
|
||||
}
|
||||
|
||||
#[derive(RmcSerialize, Clone)]
|
||||
#[rmc_struct(0)]
|
||||
pub struct RateCustomRankingParam {
|
||||
pub dataid: i64,
|
||||
pub appid: u32,
|
||||
pub score: u32,
|
||||
pub period: u16,
|
||||
}
|
||||
|
||||
#[derive(RmcSerialize, Clone)]
|
||||
#[rmc_struct(0)]
|
||||
pub struct BufferQueueParam {
|
||||
pub dataid: i64,
|
||||
pub slot: i32,
|
||||
}
|
||||
|
||||
// I just realized I forgot to add "DataStore" in front of the structs. I can't be assed to change it, sucks to be you lol.
|
||||
|
||||
#[derive(RmcSerialize, Clone)]
|
||||
#[rmc_struct(0)]
|
||||
pub struct DataStoreGetCustomRankingByDataIDParam {
|
||||
pub application_id: u32,
|
||||
pub data_id_list: Vec<i64>,
|
||||
pub result_option: u8,
|
||||
}
|
||||
|
||||
#[derive(RmcSerialize, Clone)]
|
||||
#[rmc_struct(0)]
|
||||
pub struct DataStoreCustomRankingResult {
|
||||
pub order: u32,
|
||||
pub score: u32,
|
||||
pub meta_info: GetMetaInfo,
|
||||
}
|
||||
|
||||
#[derive(RmcSerialize, Clone)]
|
||||
#[rmc_struct(0)]
|
||||
pub struct DataStorePrepareGetParam {
|
||||
pub dataid: i64,
|
||||
pub lockid: u32,
|
||||
pub persistence_target: PersistenceTarget,
|
||||
pub access_password: i64,
|
||||
pub extra_data: Vec<String>,
|
||||
}
|
||||
|
||||
#[derive(RmcSerialize, Clone)]
|
||||
#[rmc_struct(0)]
|
||||
pub struct DataStoreReqGetInfo {
|
||||
pub url: String,
|
||||
pub request_headers: Vec<KeyValue>,
|
||||
pub size: u32,
|
||||
pub root_ca_cert: Vec<u8>,
|
||||
pub dataid: i64,
|
||||
}
|
||||
|
||||
#[derive(RmcSerialize, Clone)]
|
||||
#[rmc_struct(1)]
|
||||
pub struct DataStoreSearchParam {
|
||||
pub search_target: u8,
|
||||
pub owner_ids: Vec<PID>,
|
||||
pub owner_type: u8,
|
||||
pub destination_ids: Vec<i64>,
|
||||
pub data_type: u16,
|
||||
pub created_after: DateTime,
|
||||
pub created_before: DateTime,
|
||||
pub updated_after: DateTime,
|
||||
pub updated_before: DateTime,
|
||||
pub refer_dat_id: u32,
|
||||
pub tags: Vec<String>,
|
||||
pub result_order_column: u8,
|
||||
pub result_order: u8,
|
||||
pub result_range: ResultsRange,
|
||||
pub result_option: u8,
|
||||
pub minimal_rating_frequency: u32,
|
||||
pub use_cache: bool,
|
||||
}
|
||||
|
||||
#[derive(RmcSerialize, Clone, Debug)]
|
||||
#[rmc_struct(0)]
|
||||
pub struct AttachFileParam {
|
||||
pub post_param: PreparePostParam,
|
||||
pub refer_data_id: i64,
|
||||
pub content_type: String,
|
||||
}
|
||||
|
||||
#[derive(RmcSerialize, Clone)]
|
||||
#[rmc_struct(0)]
|
||||
pub struct DataStoreRatingTarget {
|
||||
pub dataid: i64,
|
||||
pub slot: i8,
|
||||
}
|
||||
|
||||
#[derive(RmcSerialize, Clone)]
|
||||
#[rmc_struct(0)]
|
||||
pub struct DataStoreRateObjectParam {
|
||||
pub rating_value: i32,
|
||||
pub access_password: i64,
|
||||
}
|
||||
|
||||
#[derive(RmcSerialize, Clone, Default, Debug)]
|
||||
#[rmc_struct(0)]
|
||||
pub struct DataStoreChangeMetaCompareParam {
|
||||
pub comparison_flag: u32,
|
||||
pub name: String,
|
||||
pub permission: Permission,
|
||||
pub del_permission: Permission,
|
||||
pub period: u16,
|
||||
pub meta_binary: QBuffer,
|
||||
pub tags: Vec<String>,
|
||||
pub referred_cnt: u32,
|
||||
pub data_type: u16,
|
||||
pub status: u8,
|
||||
}
|
||||
|
||||
#[derive(RmcSerialize, Clone, Default, Debug)]
|
||||
#[rmc_struct(0)]
|
||||
pub struct DataStoreChangeMetaParam {
|
||||
pub dataid: i64,
|
||||
pub modifies_flag: u32,
|
||||
pub name: String,
|
||||
pub permission: Permission,
|
||||
pub del_permission: Permission,
|
||||
pub period: u16,
|
||||
pub meta_binary: QBuffer,
|
||||
pub tags: Vec<String>,
|
||||
pub update_password: i64,
|
||||
pub referred_cnt: u32,
|
||||
pub data_type: u16,
|
||||
pub status: u8,
|
||||
pub compare_param: DataStoreChangeMetaCompareParam,
|
||||
}
|
||||
|
||||
#[derive(RmcSerialize, Clone, Default, Debug)]
|
||||
#[rmc_struct(0)]
|
||||
pub struct DataStoreUploadCourseRecordParam {
|
||||
pub dataid: i64,
|
||||
pub slot: u8,
|
||||
pub score: i32,
|
||||
}
|
||||
|
||||
#[derive(RmcSerialize, Clone, Default, Debug)]
|
||||
#[rmc_struct(0)]
|
||||
pub struct DataStoreGetCourseRecordParam {
|
||||
pub dataid: i64,
|
||||
pub slot: u8,
|
||||
}
|
||||
|
||||
#[derive(RmcSerialize, Clone, Default, Debug)]
|
||||
#[rmc_struct(0)]
|
||||
pub struct DataStoreGetCourseRecordResult {
|
||||
pub dataid: i64,
|
||||
pub slot: u8,
|
||||
pub first_pid: u32,
|
||||
pub best_pid: u32,
|
||||
pub best_score: i32,
|
||||
pub created_time: DateTime,
|
||||
pub updated_time: DateTime,
|
||||
}
|
||||
|
||||
#[derive(RmcSerialize, Clone)]
|
||||
#[rmc_struct(0)]
|
||||
pub struct DataStoreFileServerObjectInfo {
|
||||
pub dataid: i64,
|
||||
pub get_info: DataStoreReqGetInfo,
|
||||
}
|
||||
|
||||
#[derive(RmcSerialize, Clone)]
|
||||
#[rmc_struct(0)]
|
||||
pub struct DataStoreReportCourseParam {
|
||||
pub dataid: i64,
|
||||
pub mii_name: String,
|
||||
pub report_category: i8,
|
||||
pub report_reason: String,
|
||||
}
|
||||
|
||||
#[derive(RmcSerialize, Clone)]
|
||||
#[rmc_struct(0)]
|
||||
pub struct DataStoreDeleteParam {
|
||||
pub dataid: i64,
|
||||
pub update_password: i64,
|
||||
}
|
||||
|
||||
#[derive(RmcSerialize, Clone)]
|
||||
#[rmc_struct(0)]
|
||||
pub struct DataStoreCustomRankingRatingCondition {
|
||||
pub slot: i8,
|
||||
pub min_value: i32,
|
||||
pub max_value: i32,
|
||||
}
|
||||
|
||||
#[derive(RmcSerialize, Clone)]
|
||||
#[rmc_struct(0)]
|
||||
pub struct DataStoreGetCustomRankingParam {
|
||||
pub application_id: u32,
|
||||
pub condition: DataStoreCustomRankingRatingCondition,
|
||||
pub result_option: u8,
|
||||
pub result_range: ResultsRange,
|
||||
}
|
||||
|
||||
#[rmc_proto(115)]
|
||||
pub trait DataStore {
|
||||
#[method_id(4)]
|
||||
async fn delete_object(&self, param: DataStoreDeleteParam) -> Result<(), ErrorCode>;
|
||||
#[method_id(8)]
|
||||
async fn get_meta(&self, metaparam: GetMetaParam) -> Result<GetMetaInfo, ErrorCode>;
|
||||
#[method_id(24)]
|
||||
async fn prepare_post_object(
|
||||
&self,
|
||||
postparam: PreparePostParam,
|
||||
) -> Result<ReqPostInfo, ErrorCode>;
|
||||
#[method_id(25)]
|
||||
async fn prepare_get_object(
|
||||
&self,
|
||||
prepare_get_param: DataStorePrepareGetParam,
|
||||
) -> Result<DataStoreReqGetInfo, ErrorCode>;
|
||||
#[method_id(26)]
|
||||
async fn complete_post_object(&self, completeparam: CompletePostParam)
|
||||
-> Result<(), ErrorCode>;
|
||||
#[method_id(36)]
|
||||
async fn get_metas_multiple_param(
|
||||
&self,
|
||||
params: Vec<GetMetaParam>,
|
||||
) -> Result<(Vec<GetMetaInfo>, Vec<QResult>), ErrorCode>;
|
||||
#[method_id(48)]
|
||||
async fn rate_custom_ranking(
|
||||
&self,
|
||||
rankingparam: Vec<RateCustomRankingParam>,
|
||||
) -> Result<(), ErrorCode>;
|
||||
#[method_id(61)]
|
||||
async fn get_application_config(&self, appid: u32) -> Result<Vec<i32>, ErrorCode>;
|
||||
#[method_id(49)]
|
||||
async fn get_custom_ranking(
|
||||
&self,
|
||||
param: DataStoreGetCustomRankingParam,
|
||||
) -> Result<(Vec<DataStoreCustomRankingResult>, Vec<QResult>), ErrorCode>;
|
||||
#[method_id(50)]
|
||||
async fn get_custom_ranking_by_data_id(
|
||||
&self,
|
||||
custom_ranking_param: DataStoreGetCustomRankingByDataIDParam,
|
||||
) -> Result<(Vec<DataStoreCustomRankingResult>, Vec<QResult>), ErrorCode>;
|
||||
#[method_id(53)]
|
||||
async fn add_to_buffer_queues(
|
||||
&self,
|
||||
bufferparam: Vec<BufferQueueParam>,
|
||||
buffers: Vec<QBuffer>,
|
||||
) -> Result<Vec<QResult>, ErrorCode>;
|
||||
#[method_id(54)]
|
||||
async fn get_buffer_queue(
|
||||
&self,
|
||||
bufferparam: BufferQueueParam,
|
||||
) -> Result<Vec<QBuffer>, ErrorCode>;
|
||||
#[method_id(65)]
|
||||
async fn followings_latest_course_search_object(
|
||||
&self,
|
||||
course_search_param: DataStoreSearchParam,
|
||||
extra_data: Vec<String>,
|
||||
) -> Result<Vec<DataStoreCustomRankingResult>, ErrorCode>;
|
||||
#[method_id(66)]
|
||||
async fn recommended_course_search_object(
|
||||
&self,
|
||||
course_search_param: DataStoreSearchParam,
|
||||
extra_data: Vec<String>,
|
||||
) -> Result<Vec<DataStoreCustomRankingResult>, ErrorCode>;
|
||||
#[method_id(74)]
|
||||
async fn get_application_config_string(
|
||||
&self,
|
||||
application_id: u32,
|
||||
) -> Result<Vec<String>, ErrorCode>;
|
||||
#[method_id(38)]
|
||||
async fn change_meta(&self, param: DataStoreChangeMetaParam) -> Result<(), ErrorCode>;
|
||||
#[method_id(40)]
|
||||
async fn rate_objects(
|
||||
&self,
|
||||
targets: Vec<DataStoreRatingTarget>,
|
||||
params: Vec<DataStoreRateObjectParam>,
|
||||
_transactional: bool,
|
||||
fetch_ratings: bool,
|
||||
) -> Result<(Vec<RatingInfo>, Vec<QResult>), ErrorCode>;
|
||||
#[method_id(45)]
|
||||
async fn get_object_infos(
|
||||
&self,
|
||||
dataids: Vec<i64>,
|
||||
) -> Result<Vec<DataStoreFileServerObjectInfo>, ErrorCode>;
|
||||
#[method_id(57)]
|
||||
async fn complete_attach_file(
|
||||
&self,
|
||||
complete_attach_param: CompletePostParam,
|
||||
) -> Result<String, ErrorCode>;
|
||||
#[method_id(59)]
|
||||
async fn prepare_attach_file(
|
||||
&self,
|
||||
attach_file_param: AttachFileParam,
|
||||
) -> Result<ReqPostInfo, ErrorCode>;
|
||||
#[method_id(71)]
|
||||
async fn upload_course_record(
|
||||
&self,
|
||||
upload_course_record_param: DataStoreUploadCourseRecordParam,
|
||||
) -> Result<(), ErrorCode>;
|
||||
#[method_id(72)]
|
||||
async fn get_course_record(
|
||||
&self,
|
||||
get_course_record_param: DataStoreGetCourseRecordParam,
|
||||
) -> Result<DataStoreGetCourseRecordResult, ErrorCode>;
|
||||
#[method_id(79)]
|
||||
async fn check_rate_custom_ranking_counter(
|
||||
&self,
|
||||
application_id: u32,
|
||||
) -> Result<bool, ErrorCode>;
|
||||
#[method_id(82)]
|
||||
async fn ctr_pickup_course_search_object(
|
||||
&self,
|
||||
course_search_param: DataStoreSearchParam,
|
||||
extra_data: Vec<String>,
|
||||
) -> Result<Vec<DataStoreCustomRankingResult>, ErrorCode>;
|
||||
#[method_id(87)]
|
||||
async fn report_course(
|
||||
&self,
|
||||
report_course_param: DataStoreReportCourseParam,
|
||||
) -> Result<(), ErrorCode>;
|
||||
}
|
||||
11
rnex-protocols/ds-protos/src/lib.rs
Normal file
11
rnex-protocols/ds-protos/src/lib.rs
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
#![allow(async_fn_in_trait)]
|
||||
|
||||
pub mod datastore;
|
||||
use datastore::{DataStore, RawDataStore, RawDataStoreInfo, RemoteDataStore};
|
||||
use rnex_rmc::define_rmc_proto;
|
||||
|
||||
define_rmc_proto!(
|
||||
proto DatastoreProtocol{
|
||||
DataStore
|
||||
}
|
||||
);
|
||||
11
rnex-protocols/fpd-protos/Cargo.toml
Normal file
11
rnex-protocols/fpd-protos/Cargo.toml
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
[package]
|
||||
name = "rnex-fpd-protos"
|
||||
version = "0.1.0"
|
||||
edition = "2024"
|
||||
|
||||
[dependencies]
|
||||
ctor = "1.0.8"
|
||||
rnex-rmc = { path = "../../rnex-rmc" }
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
45
rnex-protocols/fpd-protos/src/account_management.rs
Normal file
45
rnex-protocols/fpd-protos/src/account_management.rs
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
use rnex_rmc::{
|
||||
RmcSerialize,
|
||||
any::Any,
|
||||
data::Data,
|
||||
method_id,
|
||||
response::ErrorCode,
|
||||
rmc_proto,
|
||||
util::{PID, date_time::DateTime},
|
||||
};
|
||||
|
||||
use crate::friends_wiiu::NNAInfo;
|
||||
|
||||
#[derive(RmcSerialize, Debug, Clone)]
|
||||
#[rmc_struct(0)]
|
||||
pub struct NintendoCreateAccountData {
|
||||
#[extends]
|
||||
pub data: Data,
|
||||
pub nna_info: NNAInfo,
|
||||
pub nex_token: String,
|
||||
pub birthday: DateTime,
|
||||
pub unk: u64,
|
||||
}
|
||||
|
||||
#[derive(RmcSerialize, Debug, Clone)]
|
||||
#[rmc_struct(0)]
|
||||
pub struct AccountExtraInfo {
|
||||
#[extends]
|
||||
pub data: Data,
|
||||
pub unk1: u64,
|
||||
pub unk2: u32,
|
||||
pub nex_token: String,
|
||||
}
|
||||
|
||||
#[rmc_proto(25)]
|
||||
pub trait AccountManagement {
|
||||
#[method_id(27)]
|
||||
async fn nintendo_create_account(
|
||||
&self,
|
||||
principal_name: String,
|
||||
key: String,
|
||||
groups: u32,
|
||||
email: String,
|
||||
auth_data: Any,
|
||||
) -> Result<(PID, String), ErrorCode>;
|
||||
}
|
||||
254
rnex-protocols/fpd-protos/src/friends_3ds.rs
Normal file
254
rnex-protocols/fpd-protos/src/friends_3ds.rs
Normal file
|
|
@ -0,0 +1,254 @@
|
|||
use rnex_rmc::{
|
||||
RmcSerialize,
|
||||
data::Data,
|
||||
list::Buffer,
|
||||
method_id,
|
||||
response::ErrorCode,
|
||||
rmc_proto,
|
||||
util::{PID, date_time::DateTime},
|
||||
};
|
||||
|
||||
#[derive(RmcSerialize)]
|
||||
#[rmc_struct(0)]
|
||||
pub struct MyProfile {
|
||||
#[extends]
|
||||
pub data: Data,
|
||||
pub region: u8,
|
||||
pub country: u8,
|
||||
pub area: u8,
|
||||
pub language: u8,
|
||||
pub platform: u8,
|
||||
pub local_friend_code_seed: u64,
|
||||
pub mac_address: String,
|
||||
pub serial_number: String,
|
||||
}
|
||||
|
||||
#[derive(RmcSerialize)]
|
||||
#[rmc_struct(0)]
|
||||
pub struct Mii {
|
||||
#[extends]
|
||||
pub data: Data,
|
||||
pub name: String,
|
||||
pub profanity: bool,
|
||||
pub char_set: u8, // 0 is JPN/USA/EUR, 1 is CHN, 2 is KOR and 3 is TWN
|
||||
pub mii_data: Vec<u8>,
|
||||
}
|
||||
|
||||
#[derive(RmcSerialize)]
|
||||
#[rmc_struct(0)]
|
||||
pub struct MiiList {
|
||||
#[extends]
|
||||
pub data: Data,
|
||||
pub unk1: String,
|
||||
pub unk2: bool,
|
||||
pub unk3: u8,
|
||||
pub mii_data: Vec<Buffer>,
|
||||
}
|
||||
|
||||
#[derive(RmcSerialize, Debug)]
|
||||
#[rmc_struct(0)]
|
||||
pub struct GameKey {
|
||||
#[extends]
|
||||
pub data: Data,
|
||||
pub title_id: u64,
|
||||
pub version: u16,
|
||||
}
|
||||
|
||||
#[derive(RmcSerialize)]
|
||||
#[rmc_struct(0)]
|
||||
pub struct PlayedGame {
|
||||
#[extends]
|
||||
pub data: Data,
|
||||
pub game_key: GameKey,
|
||||
pub date_time: DateTime,
|
||||
}
|
||||
|
||||
#[derive(RmcSerialize)]
|
||||
#[rmc_struct(0)]
|
||||
pub struct FriendInfo {
|
||||
pub pid: u32,
|
||||
pub unk2: DateTime,
|
||||
}
|
||||
|
||||
#[derive(RmcSerialize)]
|
||||
#[rmc_struct(0)]
|
||||
pub struct FriendMii {
|
||||
#[extends]
|
||||
pub data: Data,
|
||||
pub pid: PID,
|
||||
pub mii: Mii,
|
||||
pub modified_at: DateTime,
|
||||
}
|
||||
|
||||
#[derive(RmcSerialize)]
|
||||
#[rmc_struct(0)]
|
||||
pub struct FriendMiiList {
|
||||
#[extends]
|
||||
pub data: Data,
|
||||
pub unk1: u32,
|
||||
pub mii_list: MiiList,
|
||||
pub unk2: DateTime,
|
||||
}
|
||||
|
||||
#[derive(RmcSerialize)]
|
||||
#[rmc_struct(0)]
|
||||
pub struct FriendRelationship {
|
||||
#[extends]
|
||||
pub data: Data,
|
||||
pub pid: u32,
|
||||
pub local_friend_code: u64,
|
||||
pub relationship_type: u8,
|
||||
}
|
||||
|
||||
#[derive(RmcSerialize)]
|
||||
#[rmc_struct(0)]
|
||||
pub struct NintendoPresence {
|
||||
#[extends]
|
||||
pub data: Data,
|
||||
pub changed_bit_flag: u32,
|
||||
pub game_key: GameKey,
|
||||
pub game_mode_desctiption: String,
|
||||
pub join_availibility_flag: u32,
|
||||
pub mm_system_type: u8,
|
||||
pub join_game_id: u32,
|
||||
pub join_game_mode: u32,
|
||||
pub owner_pid: PID,
|
||||
pub join_group_id: u32,
|
||||
pub application_arg: Buffer,
|
||||
}
|
||||
#[derive(RmcSerialize)]
|
||||
#[rmc_struct(0)]
|
||||
pub struct FriendPresence {
|
||||
#[extends]
|
||||
pub data: Data,
|
||||
pub pid: u32,
|
||||
pub presence: NintendoPresence,
|
||||
}
|
||||
#[derive(RmcSerialize)]
|
||||
#[rmc_struct(0)]
|
||||
pub struct FriendComment {
|
||||
#[extends]
|
||||
pub data: Data,
|
||||
pub pid: PID,
|
||||
pub comment: String,
|
||||
pub modified_at: DateTime,
|
||||
}
|
||||
#[derive(RmcSerialize)]
|
||||
#[rmc_struct(0)]
|
||||
pub struct FriendPicture {
|
||||
#[extends]
|
||||
pub data: Data,
|
||||
pub unk1: u32,
|
||||
pub pic_data: Vec<u32>,
|
||||
pub date_time: DateTime,
|
||||
}
|
||||
|
||||
#[derive(RmcSerialize)]
|
||||
#[rmc_struct(0)]
|
||||
pub struct FriendPersistentInfo {
|
||||
#[extends]
|
||||
pub data: Data,
|
||||
pub pid: PID,
|
||||
pub region: u8,
|
||||
pub country: u8,
|
||||
pub area: u8,
|
||||
pub language: u8,
|
||||
pub platform: u8,
|
||||
pub game_key: GameKey,
|
||||
pub message: String,
|
||||
pub msg_updated_at: DateTime,
|
||||
pub friended_at: DateTime,
|
||||
pub last_online: DateTime,
|
||||
}
|
||||
|
||||
#[rmc_proto(101)]
|
||||
pub trait Friends3DS {
|
||||
#[method_id(1)]
|
||||
async fn update_profile(&self, profile: MyProfile) -> Result<(), ErrorCode>;
|
||||
#[method_id(2)]
|
||||
async fn update_mii(&self, profile: Mii) -> Result<(), ErrorCode>;
|
||||
#[method_id(3)]
|
||||
async fn update_mii_list(&self, profile: MiiList) -> Result<(), ErrorCode>;
|
||||
#[method_id(4)]
|
||||
async fn update_played_games(&self, profile: Vec<PlayedGame>) -> Result<(), ErrorCode>;
|
||||
#[method_id(5)]
|
||||
async fn update_preference(
|
||||
&self,
|
||||
show_online_status: bool,
|
||||
show_current_title: bool,
|
||||
block_friend_requests: bool,
|
||||
) -> Result<(), ErrorCode>;
|
||||
|
||||
#[method_id(6)]
|
||||
async fn get_friend_mii(&self, friends: Vec<FriendInfo>) -> Result<Vec<FriendMii>, ErrorCode>;
|
||||
#[method_id(7)]
|
||||
async fn get_friend_mii_list(
|
||||
&self,
|
||||
friends: Vec<FriendInfo>,
|
||||
) -> Result<Vec<FriendMiiList>, ErrorCode>;
|
||||
#[method_id(8)]
|
||||
async fn is_active_game(&self, unk: Vec<u32>, game_key: GameKey)
|
||||
-> Result<Vec<u32>, ErrorCode>;
|
||||
#[method_id(9)]
|
||||
async fn get_principal_id_by_local_friend_code(
|
||||
&self,
|
||||
unk1: u64,
|
||||
unk2: Vec<u64>,
|
||||
) -> Result<Vec<FriendRelationship>, ErrorCode>;
|
||||
#[method_id(10)]
|
||||
async fn get_friend_relationships(
|
||||
&self,
|
||||
unk2: Vec<u32>,
|
||||
) -> Result<Vec<FriendRelationship>, ErrorCode>;
|
||||
#[method_id(11)]
|
||||
async fn add_friend_by_pid(&self, unk: u64, pid: PID) -> Result<FriendRelationship, ErrorCode>;
|
||||
#[method_id(12)]
|
||||
async fn add_friend_by_lst_pid(
|
||||
&self,
|
||||
unk: u64,
|
||||
pid: Vec<PID>,
|
||||
) -> Result<Vec<FriendRelationship>, ErrorCode>;
|
||||
#[method_id(13)]
|
||||
async fn remove_friend_by_local_code(&self, local_code: u64) -> Result<(), ErrorCode>;
|
||||
#[method_id(14)]
|
||||
async fn remove_friend_by_pid(&self, pid: PID) -> Result<(), ErrorCode>;
|
||||
#[method_id(15)]
|
||||
async fn get_all_friends(&self) -> Result<Vec<FriendRelationship>, ErrorCode>;
|
||||
#[method_id(16)]
|
||||
async fn update_blacklist(&self) -> Result<(), ErrorCode>;
|
||||
#[method_id(17)]
|
||||
async fn sync_friend(
|
||||
&self,
|
||||
unk1: u64,
|
||||
unk2: Vec<u32>,
|
||||
unk3: Vec<u64>,
|
||||
) -> Result<Vec<FriendRelationship>, ErrorCode>;
|
||||
#[method_id(18)]
|
||||
async fn update_presence(
|
||||
&self,
|
||||
nintendo_presence: NintendoPresence,
|
||||
unk: bool,
|
||||
) -> Result<(), ErrorCode>;
|
||||
#[method_id(19)]
|
||||
async fn update_favorite_game_key(&self, game_key: GameKey) -> Result<(), ErrorCode>;
|
||||
#[method_id(20)]
|
||||
async fn update_comment(&self, comment: String) -> Result<(), ErrorCode>;
|
||||
#[method_id(21)]
|
||||
async fn update_picture(&self, unk: u32, picture: Vec<u8>) -> Result<(), ErrorCode>;
|
||||
#[method_id(22)]
|
||||
async fn get_friend_presence(&self, unk: Vec<u32>) -> Result<Vec<FriendPresence>, ErrorCode>;
|
||||
#[method_id(23)]
|
||||
async fn get_friend_comment(
|
||||
&self,
|
||||
unk: Vec<FriendInfo>,
|
||||
) -> Result<Vec<FriendComment>, ErrorCode>;
|
||||
#[method_id(24)]
|
||||
async fn get_friend_picture(&self, unk: Vec<u32>) -> Result<Vec<FriendPicture>, ErrorCode>;
|
||||
#[method_id(25)]
|
||||
async fn get_friend_persistent_info(
|
||||
&self,
|
||||
unk: Vec<u32>,
|
||||
) -> Result<Vec<FriendPersistentInfo>, ErrorCode>;
|
||||
#[method_id(26)]
|
||||
async fn send_invitation(&self, unk: Vec<u32>) -> Result<(), ErrorCode>;
|
||||
}
|
||||
244
rnex-protocols/fpd-protos/src/friends_wiiu.rs
Normal file
244
rnex-protocols/fpd-protos/src/friends_wiiu.rs
Normal file
|
|
@ -0,0 +1,244 @@
|
|||
use rnex_rmc::{
|
||||
RmcSerialize,
|
||||
data::Data,
|
||||
method_id,
|
||||
qbuffer::QBuffer,
|
||||
response::ErrorCode,
|
||||
rmc_proto,
|
||||
util::{PID, date_time::DateTime},
|
||||
};
|
||||
|
||||
#[derive(RmcSerialize, Debug, Clone, Default)]
|
||||
#[rmc_struct(0)]
|
||||
pub struct MiiV2 {
|
||||
#[extends]
|
||||
pub data: Data,
|
||||
pub name: QBuffer,
|
||||
pub unk: u8,
|
||||
pub unk2: u8,
|
||||
pub mii_data: Vec<u8>,
|
||||
pub date_time: DateTime,
|
||||
}
|
||||
|
||||
#[derive(RmcSerialize, Debug, Clone, Default)]
|
||||
#[rmc_struct(0)]
|
||||
pub struct PrincipalBasicInfo {
|
||||
#[extends]
|
||||
pub data: Data,
|
||||
pub pid: PID,
|
||||
pub nnid: String,
|
||||
pub mii: MiiV2,
|
||||
pub unk: u8,
|
||||
}
|
||||
|
||||
#[derive(RmcSerialize, Debug, Clone, Default)]
|
||||
#[rmc_struct(0)]
|
||||
pub struct NNAInfo {
|
||||
#[extends]
|
||||
pub data: Data,
|
||||
pub principal_basic_info: PrincipalBasicInfo,
|
||||
pub unk: u8,
|
||||
pub unk2: u8,
|
||||
}
|
||||
|
||||
#[derive(RmcSerialize, Clone, Copy, Debug, Default)]
|
||||
#[rmc_struct(0)]
|
||||
pub struct GameKey {
|
||||
#[extends]
|
||||
pub data: Data,
|
||||
pub tid: i64,
|
||||
pub version: i16,
|
||||
}
|
||||
|
||||
#[derive(RmcSerialize, Clone, Debug, Default)]
|
||||
#[rmc_struct(0)]
|
||||
pub struct NintendoPresenceV2 {
|
||||
#[extends]
|
||||
pub data: Data,
|
||||
pub changed_flags: u32,
|
||||
pub is_online: bool,
|
||||
pub game_key: GameKey,
|
||||
pub unk: u8,
|
||||
pub message: String,
|
||||
pub unk2: u32,
|
||||
pub unk3: u8,
|
||||
pub game_server_id: u32,
|
||||
pub unk4: u32,
|
||||
pub pid: u32,
|
||||
pub gid: u32,
|
||||
pub app_data: Vec<u8>,
|
||||
pub unk5: u8,
|
||||
pub unk6: u8,
|
||||
pub unk7: u8,
|
||||
}
|
||||
#[derive(RmcSerialize, Clone, Debug)]
|
||||
#[rmc_struct(0)]
|
||||
pub struct PrincipalPreference {
|
||||
#[extends]
|
||||
pub data: Data,
|
||||
pub show_online: bool,
|
||||
pub show_playing_title: bool,
|
||||
pub block_friend_request: bool,
|
||||
}
|
||||
|
||||
#[derive(RmcSerialize, Default, Debug)]
|
||||
#[rmc_struct(0)]
|
||||
pub struct Comment {
|
||||
#[extends]
|
||||
pub data: Data,
|
||||
pub unk: u8,
|
||||
pub message: String,
|
||||
pub last_changed: DateTime,
|
||||
}
|
||||
|
||||
#[derive(RmcSerialize, Default, Debug)]
|
||||
#[rmc_struct(0)]
|
||||
pub struct FriendInfo {
|
||||
#[extends]
|
||||
pub data: Data,
|
||||
pub nna_info: NNAInfo,
|
||||
pub presence: NintendoPresenceV2,
|
||||
pub comment: Comment,
|
||||
pub became_friends: DateTime,
|
||||
pub last_online: DateTime,
|
||||
pub unk: u64,
|
||||
}
|
||||
|
||||
#[derive(RmcSerialize, Debug, Clone)]
|
||||
#[rmc_struct(0)]
|
||||
pub struct FriendRequestMessage {
|
||||
#[extends]
|
||||
pub data: Data,
|
||||
pub friend_request_id: i64,
|
||||
pub is_recieved: bool,
|
||||
pub unk: u8,
|
||||
pub message: String,
|
||||
pub unk2: u8,
|
||||
pub unk3: String,
|
||||
pub game_key: GameKey,
|
||||
pub unk4: DateTime,
|
||||
pub expires_on: DateTime,
|
||||
}
|
||||
|
||||
#[derive(RmcSerialize, Debug, Clone)]
|
||||
#[rmc_struct(0)]
|
||||
pub struct FriendRequest {
|
||||
#[extends]
|
||||
pub data: Data,
|
||||
pub basic_info: PrincipalBasicInfo,
|
||||
pub request_message: FriendRequestMessage,
|
||||
pub sent_on: DateTime,
|
||||
}
|
||||
|
||||
#[derive(RmcSerialize, Debug, Default)]
|
||||
#[rmc_struct(0)]
|
||||
pub struct BlacklistedPrincipal {
|
||||
#[extends]
|
||||
pub data: Data,
|
||||
pub basic_info: PrincipalBasicInfo,
|
||||
pub game_key: GameKey,
|
||||
pub since: DateTime,
|
||||
}
|
||||
#[derive(RmcSerialize, Debug)]
|
||||
#[rmc_struct(0)]
|
||||
pub struct PersistentNotification {
|
||||
#[extends]
|
||||
pub data: Data,
|
||||
pub unk1: u64,
|
||||
pub unk2: u32,
|
||||
pub unk3: u32,
|
||||
pub unk4: u32,
|
||||
pub unk5: String,
|
||||
}
|
||||
|
||||
#[derive(RmcSerialize)]
|
||||
#[rmc_struct(0)]
|
||||
pub struct PrincipalRequestBlockSetting {
|
||||
#[extends]
|
||||
pub data: Data,
|
||||
pub pid: PID,
|
||||
pub blocked: bool,
|
||||
}
|
||||
|
||||
#[rmc_proto(102)]
|
||||
pub trait FriendsWiiU {
|
||||
#[method_id(1)]
|
||||
async fn update_and_get_all_information(
|
||||
&self,
|
||||
info: NNAInfo,
|
||||
presence: NintendoPresenceV2,
|
||||
date_time: DateTime,
|
||||
) -> Result<
|
||||
(
|
||||
PrincipalPreference,
|
||||
Comment,
|
||||
Vec<FriendInfo>,
|
||||
Vec<FriendRequest>,
|
||||
Vec<FriendRequest>,
|
||||
Vec<BlacklistedPrincipal>,
|
||||
bool,
|
||||
Vec<PersistentNotification>,
|
||||
bool,
|
||||
),
|
||||
ErrorCode,
|
||||
>;
|
||||
#[method_id(2)]
|
||||
async fn add_friend(&self, friend: PID) -> Result<(FriendRequest, FriendInfo), ErrorCode>;
|
||||
#[method_id(3)]
|
||||
async fn add_friend_by_name(
|
||||
&self,
|
||||
name: String,
|
||||
) -> Result<(FriendRequest, FriendInfo), ErrorCode>;
|
||||
#[method_id(4)]
|
||||
async fn remove_friend(&self, friend: PID) -> Result<(), ErrorCode>;
|
||||
#[method_id(5)]
|
||||
async fn add_friend_request(
|
||||
&self,
|
||||
friend: PID,
|
||||
unk1: u8,
|
||||
message: String,
|
||||
unk2: u8,
|
||||
unk3: String,
|
||||
game_key: GameKey,
|
||||
unk4: DateTime,
|
||||
) -> Result<(FriendRequest, FriendInfo), ErrorCode>;
|
||||
#[method_id(6)]
|
||||
async fn cancel_friend_request(&self, id: u64) -> Result<(), ErrorCode>;
|
||||
#[method_id(7)]
|
||||
async fn accept_friend_request(&self, id: u64) -> Result<FriendInfo, ErrorCode>;
|
||||
#[method_id(8)]
|
||||
async fn delete_friend_request(&self, id: u64) -> Result<(), ErrorCode>;
|
||||
#[method_id(9)]
|
||||
async fn deny_friend_request(&self, id: u64) -> Result<BlacklistedPrincipal, ErrorCode>;
|
||||
#[method_id(10)]
|
||||
async fn mark_friend_requests_as_received(&self, ids: Vec<u64>) -> Result<(), ErrorCode>;
|
||||
#[method_id(11)]
|
||||
async fn add_blacklist(
|
||||
&self,
|
||||
principal: BlacklistedPrincipal,
|
||||
) -> Result<BlacklistedPrincipal, ErrorCode>;
|
||||
#[method_id(12)]
|
||||
async fn remove_blacklist(&self, id: PID) -> Result<(), ErrorCode>;
|
||||
#[method_id(13)]
|
||||
async fn update_presence(&self, presence: NintendoPresenceV2) -> Result<(), ErrorCode>;
|
||||
#[method_id(14)]
|
||||
async fn update_mii(&self, presence: MiiV2) -> Result<DateTime, ErrorCode>;
|
||||
#[method_id(15)]
|
||||
async fn update_comment(&self, presence: Comment) -> Result<DateTime, ErrorCode>;
|
||||
#[method_id(16)]
|
||||
async fn update_preference(&self, preference: PrincipalPreference) -> Result<(), ErrorCode>;
|
||||
#[method_id(17)]
|
||||
async fn get_basic_info(&self, pids: Vec<PID>) -> Result<Vec<PrincipalBasicInfo>, ErrorCode>;
|
||||
#[method_id(18)]
|
||||
async fn delete_persistent_notification(
|
||||
&self,
|
||||
notifs: Vec<PersistentNotification>,
|
||||
) -> Result<(), ErrorCode>;
|
||||
#[method_id(19)]
|
||||
async fn check_setting_status(&self) -> Result<u8, ErrorCode>;
|
||||
#[method_id(20)]
|
||||
async fn get_request_block_settings(
|
||||
&self,
|
||||
pids: Vec<PID>,
|
||||
) -> Result<Vec<PrincipalRequestBlockSetting>, ErrorCode>;
|
||||
}
|
||||
33
rnex-protocols/fpd-protos/src/lib.rs
Normal file
33
rnex-protocols/fpd-protos/src/lib.rs
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
#![allow(async_fn_in_trait)]
|
||||
|
||||
use rnex_rmc::define_rmc_proto;
|
||||
pub mod account_management;
|
||||
pub mod friends_3ds;
|
||||
pub mod friends_wiiu;
|
||||
pub mod nintendo_notification;
|
||||
use account_management::{
|
||||
AccountManagement, RawAccountManagement, RawAccountManagementInfo, RemoteAccountManagement,
|
||||
};
|
||||
use friends_3ds::{Friends3DS, RawFriends3DS, RawFriends3DSInfo, RemoteFriends3DS};
|
||||
use friends_wiiu::{FriendsWiiU, RawFriendsWiiU, RawFriendsWiiUInfo, RemoteFriendsWiiU};
|
||||
use nintendo_notification::{
|
||||
NintendoNotification, RawNintendoNotification, RawNintendoNotificationInfo,
|
||||
RemoteNintendoNotification,
|
||||
};
|
||||
|
||||
define_rmc_proto!(
|
||||
proto FriendsUser{
|
||||
FriendsWiiU,
|
||||
Friends3DS
|
||||
}
|
||||
);
|
||||
define_rmc_proto!(
|
||||
proto FriendRemote{
|
||||
NintendoNotification
|
||||
}
|
||||
);
|
||||
define_rmc_proto!(
|
||||
proto FriendsGuest{
|
||||
AccountManagement
|
||||
}
|
||||
);
|
||||
40
rnex-protocols/fpd-protos/src/nintendo_notification.rs
Normal file
40
rnex-protocols/fpd-protos/src/nintendo_notification.rs
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
use rnex_rmc::{RmcSerialize, any::Any, data::Data, method_id, rmc_proto, util::PID};
|
||||
|
||||
#[derive(RmcSerialize)]
|
||||
#[rmc_struct(0)]
|
||||
pub struct NintendoNotificationEvent {
|
||||
pub event_type: u32,
|
||||
pub sender: PID,
|
||||
pub data: Any,
|
||||
}
|
||||
|
||||
#[derive(RmcSerialize, Default)]
|
||||
#[rmc_struct(0)]
|
||||
pub struct NintendoNotificationEventGeneral {
|
||||
#[extends]
|
||||
pub data: Data,
|
||||
pub param1: u32,
|
||||
pub param2: u64,
|
||||
pub param3: u64,
|
||||
pub str_param: String,
|
||||
}
|
||||
|
||||
#[derive(RmcSerialize)]
|
||||
#[rmc_struct(0)]
|
||||
pub struct NintendoNotificationEventProfile {
|
||||
#[extends]
|
||||
pub data: Data,
|
||||
pub region: u8,
|
||||
pub country: u8,
|
||||
pub area: u8,
|
||||
pub language: u8,
|
||||
pub platform: u8,
|
||||
}
|
||||
|
||||
#[rmc_proto(100, NoReturn)]
|
||||
pub trait NintendoNotification {
|
||||
#[method_id(1)]
|
||||
async fn process_nintendo_notification_event_1(&self, notif: NintendoNotificationEvent);
|
||||
#[method_id(2)]
|
||||
async fn process_nintendo_notification_event_2(&self, notif: NintendoNotificationEvent);
|
||||
}
|
||||
22
rnex-protocols/mm-protos/Cargo.toml
Normal file
22
rnex-protocols/mm-protos/Cargo.toml
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
[package]
|
||||
name = "rnex-mm-protos"
|
||||
version = "0.1.0"
|
||||
edition = "2024"
|
||||
|
||||
[dependencies]
|
||||
ctor = "1.0.8"
|
||||
rnex-rmc = { path = "../../rnex-rmc" }
|
||||
cfg-if = "1.0.4"
|
||||
rnex-base-protos = { path = "../base-protos" }
|
||||
|
||||
[features]
|
||||
third-notif-param = []
|
||||
v3-3-2 = []
|
||||
v3-4-0 = ["v3-3-2", "third-notif-param"]
|
||||
v3-5-0 = ["v3-4-0"]
|
||||
v3-8-15 = ["v3-5-0"]
|
||||
v3-10-22 = ["v3-8-15"]
|
||||
v4-3-11 = ["v3-8-15"]
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
34
rnex-protocols/mm-protos/src/lib.rs
Normal file
34
rnex-protocols/mm-protos/src/lib.rs
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
#![allow(async_fn_in_trait)]
|
||||
|
||||
use rnex_rmc::define_rmc_proto;
|
||||
|
||||
pub mod matchmake;
|
||||
pub mod matchmake_ext;
|
||||
pub mod matchmake_extension;
|
||||
pub mod nat_traversal;
|
||||
pub mod notifications;
|
||||
use matchmake::{Matchmake, RawMatchmake, RawMatchmakeInfo, RemoteMatchmake};
|
||||
use matchmake_ext::{MatchmakeExt, RawMatchmakeExt, RawMatchmakeExtInfo, RemoteMatchmakeExt};
|
||||
use matchmake_extension::{
|
||||
MatchmakeExtension, RawMatchmakeExtension, RawMatchmakeExtensionInfo, RemoteMatchmakeExtension,
|
||||
};
|
||||
use nat_traversal::{
|
||||
NatTraversal, NatTraversalConsole, RawNatTraversal, RawNatTraversalConsole,
|
||||
RawNatTraversalConsoleInfo, RawNatTraversalInfo, RemoteNatTraversal, RemoteNatTraversalConsole,
|
||||
};
|
||||
use notifications::{Notification, RawNotification, RawNotificationInfo, RemoteNotification};
|
||||
|
||||
define_rmc_proto!(
|
||||
proto MatchMakingProtocol{
|
||||
MatchmakeExtension,
|
||||
MatchmakeExt,
|
||||
Matchmake,
|
||||
NatTraversal
|
||||
}
|
||||
);
|
||||
define_rmc_proto!(
|
||||
proto MatchMakingClientProtocol{
|
||||
Notification,
|
||||
NatTraversalConsole,
|
||||
}
|
||||
);
|
||||
192
rnex-protocols/mm-protos/src/matchmake.rs
Normal file
192
rnex-protocols/mm-protos/src/matchmake.rs
Normal file
|
|
@ -0,0 +1,192 @@
|
|||
use cfg_if::cfg_if;
|
||||
use rnex_rmc::{
|
||||
RmcSerialize,
|
||||
any::Any,
|
||||
method_id,
|
||||
response::ErrorCode,
|
||||
rmc_proto,
|
||||
string_set::StringSet,
|
||||
util::{PID, station_url::StationUrl},
|
||||
variant::Variant,
|
||||
};
|
||||
|
||||
#[derive(RmcSerialize, Debug, Clone, Default, PartialEq)]
|
||||
#[rmc_struct(0)]
|
||||
pub struct Gathering {
|
||||
pub self_gid: u32,
|
||||
pub owner_pid: PID,
|
||||
pub host_pid: PID,
|
||||
pub minimum_participants: u16,
|
||||
pub maximum_participants: u16,
|
||||
pub participant_policy: u32,
|
||||
pub policy_argument: u32,
|
||||
pub flags: u32,
|
||||
pub state: u32,
|
||||
pub description: String,
|
||||
}
|
||||
|
||||
// rmc structure
|
||||
#[derive(RmcSerialize, Debug, Clone, Default, PartialEq)]
|
||||
#[rmc_struct(0)]
|
||||
pub struct MatchmakeParam {
|
||||
pub params: Vec<(String, Variant)>,
|
||||
}
|
||||
|
||||
cfg_if! {
|
||||
if #[cfg(feature = "v3-5-0")]{
|
||||
use rnex_core::kerberos::KerberosDateTime;
|
||||
#[derive(RmcSerialize, Debug, Clone, Default, PartialEq)]
|
||||
#[rmc_struct(3)]
|
||||
pub struct MatchmakeSession {
|
||||
//inherits from
|
||||
#[extends]
|
||||
pub gathering: Gathering,
|
||||
|
||||
pub gamemode: u32,
|
||||
pub attributes: Vec<u32>,
|
||||
pub open_participation: bool,
|
||||
pub matchmake_system_type: u32,
|
||||
pub application_buffer: Vec<u8>,
|
||||
pub participation_count: u32,
|
||||
pub progress_score: u8,
|
||||
pub session_key: Vec<u8>,
|
||||
pub option0: u32,
|
||||
pub matchmake_param: MatchmakeParam,
|
||||
pub datetime: KerberosDateTime,
|
||||
pub user_password: String,
|
||||
pub refer_gid: u32,
|
||||
pub user_password_enabled: bool,
|
||||
pub system_password_enabled: bool,
|
||||
}
|
||||
} else {
|
||||
#[derive(RmcSerialize, Debug, Clone, Default, PartialEq)]
|
||||
#[rmc_struct(0)]
|
||||
pub struct MatchmakeSession {
|
||||
//inherits from
|
||||
#[extends]
|
||||
pub gathering: Gathering,
|
||||
|
||||
pub gamemode: u32,
|
||||
pub attributes: Vec<u32>,
|
||||
pub open_participation: bool,
|
||||
pub matchmake_system_type: u32,
|
||||
pub application_buffer: Vec<u8>,
|
||||
pub participation_count: u32,
|
||||
pub session_key: Vec<u8>,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(RmcSerialize, Debug, Clone)]
|
||||
#[rmc_struct(3)]
|
||||
pub struct MatchmakeSessionSearchCriteria {
|
||||
pub attribs: Vec<StringSet<u32>>,
|
||||
pub game_mode: String,
|
||||
pub minimum_participants: String,
|
||||
pub maximum_participants: String,
|
||||
pub matchmake_system_type: String,
|
||||
pub vacant_only: bool,
|
||||
pub exclude_locked: bool,
|
||||
pub exclude_non_host_pid: bool,
|
||||
pub selection_method: u32,
|
||||
pub vacant_participants: u16,
|
||||
pub matchmake_param: MatchmakeParam,
|
||||
pub exclude_user_password_set: bool,
|
||||
pub exclude_system_password_set: bool,
|
||||
pub refer_gid: u32,
|
||||
}
|
||||
|
||||
#[derive(RmcSerialize, Debug, Clone)]
|
||||
#[rmc_struct(0)]
|
||||
pub struct AutoMatchmakeParam {
|
||||
pub matchmake_session: MatchmakeSession,
|
||||
pub additional_participants: Vec<PID>,
|
||||
pub gid_for_participation_check: u32,
|
||||
pub auto_matchmake_option: u32,
|
||||
pub join_message: String,
|
||||
pub participation_count: u16,
|
||||
pub search_criteria: Vec<MatchmakeSessionSearchCriteria>,
|
||||
pub target_gids: Vec<u32>,
|
||||
}
|
||||
|
||||
#[derive(RmcSerialize, Debug, Clone)]
|
||||
#[rmc_struct(0)]
|
||||
pub struct CreateMatchmakeSessionParam {
|
||||
pub matchmake_session: MatchmakeSession,
|
||||
pub additional_participants: Vec<PID>,
|
||||
pub gid_for_participation_check: u32,
|
||||
pub create_matchmake_session_option: u32,
|
||||
pub join_message: String,
|
||||
pub participation_count: u16,
|
||||
}
|
||||
|
||||
#[derive(RmcSerialize, Debug, Clone)]
|
||||
#[rmc_struct(0)]
|
||||
pub struct MatchmakeBlockListParam {
|
||||
option_flag: u32,
|
||||
}
|
||||
|
||||
cfg_if! {
|
||||
if #[cfg(feature = "v3-10-22")] {
|
||||
#[derive(RmcSerialize, Debug, Clone)]
|
||||
#[rmc_struct(1)]
|
||||
pub struct JoinMatchmakeSessionParam {
|
||||
pub gid: u32,
|
||||
pub additional_participants: Vec<PID>,
|
||||
pub gid_for_participation_check: u32,
|
||||
pub join_matchmake_session_open: u32,
|
||||
pub join_matchmake_session_behavior: u8,
|
||||
pub user_password: String,
|
||||
pub system_password: String,
|
||||
pub join_message: String,
|
||||
pub participation_count: u16,
|
||||
pub extra_participant: u16,
|
||||
//pub block_list_param: MatchmakeBlockListParam
|
||||
}
|
||||
} else {
|
||||
#[derive(RmcSerialize, Debug, Clone)]
|
||||
#[rmc_struct(0)]
|
||||
pub struct JoinMatchmakeSessionParam {
|
||||
pub gid: u32,
|
||||
pub additional_participants: Vec<PID>,
|
||||
pub gid_for_participation_check: u32,
|
||||
pub join_matchmake_session_open: u32,
|
||||
pub join_matchmake_session_behavior: u8,
|
||||
pub user_password: String,
|
||||
pub system_password: String,
|
||||
pub join_message: String,
|
||||
pub participation_count: u16,
|
||||
//pub extra_participant: u16,
|
||||
//pub block_list_param: MatchmakeBlockListParam
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub mod gathering_flags {
|
||||
pub const PERSISTENT_GATHERING: u32 = 0x1;
|
||||
pub const DISCONNECT_CHANGE_OWNER: u32 = 0x10;
|
||||
pub const PERSISTENT_GATHERING_LEAVE_PARTICIPATION: u32 = 0x40;
|
||||
pub const PERSISTENT_GATHERING_ALLOW_ZERO_USERS: u32 = 0x80;
|
||||
pub const PARTICIPANTS_CHANGE_OWNER: u32 = 0x200;
|
||||
pub const VERBOSE_PARTICIPANTS: u32 = 0x400;
|
||||
pub const VERBOSE_PARTICIPANTS_EX: u32 = 0x800;
|
||||
}
|
||||
|
||||
#[rmc_proto(21)]
|
||||
pub trait Matchmake {
|
||||
#[method_id(2)]
|
||||
async fn unregister_gathering(&self, gid: u32) -> Result<bool, ErrorCode>;
|
||||
#[method_id(21)]
|
||||
async fn find_by_single_id(&self, gid: u32) -> Result<(bool, Any<Gathering>), ErrorCode>;
|
||||
#[method_id(41)]
|
||||
async fn get_session_urls(&self, gid: u32) -> Result<Vec<StationUrl>, ErrorCode>;
|
||||
#[method_id(42)]
|
||||
async fn update_session_host(&self, gid: u32, change_owner: bool) -> Result<(), ErrorCode>;
|
||||
#[method_id(44)]
|
||||
async fn migrate_gathering_ownership(
|
||||
&self,
|
||||
gid: u32,
|
||||
candidates: Vec<PID>,
|
||||
participants_only: bool,
|
||||
) -> Result<(), ErrorCode>;
|
||||
}
|
||||
7
rnex-protocols/mm-protos/src/matchmake_ext.rs
Normal file
7
rnex-protocols/mm-protos/src/matchmake_ext.rs
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
use rnex_rmc::{method_id, response::ErrorCode, rmc_proto};
|
||||
|
||||
#[rmc_proto(50)]
|
||||
pub trait MatchmakeExt {
|
||||
#[method_id(1)]
|
||||
async fn end_participation(&self, gid: u32, message: String) -> Result<bool, ErrorCode>;
|
||||
}
|
||||
108
rnex-protocols/mm-protos/src/matchmake_extension.rs
Normal file
108
rnex-protocols/mm-protos/src/matchmake_extension.rs
Normal file
|
|
@ -0,0 +1,108 @@
|
|||
use rnex_base_protos::ResultsRange;
|
||||
use rnex_rmc::{any::Any, method_id, response::ErrorCode, rmc_proto};
|
||||
|
||||
use crate::{
|
||||
matchmake::{
|
||||
AutoMatchmakeParam, CreateMatchmakeSessionParam, Gathering, JoinMatchmakeSessionParam,
|
||||
MatchmakeSession, MatchmakeSessionSearchCriteria,
|
||||
},
|
||||
notifications::NotificationEvent,
|
||||
};
|
||||
|
||||
#[rmc_proto(109)]
|
||||
pub trait MatchmakeExtension {
|
||||
#[method_id(1)]
|
||||
async fn close_participation(&self, gid: u32) -> Result<(), ErrorCode>;
|
||||
|
||||
#[method_id(2)]
|
||||
async fn open_participation(&self, gid: u32) -> Result<(), ErrorCode>;
|
||||
|
||||
#[method_id(4)]
|
||||
async fn browse_matchmake_session(
|
||||
&self,
|
||||
borwse_criteria: MatchmakeSessionSearchCriteria,
|
||||
result_range: ResultsRange,
|
||||
) -> Result<Vec<Any<Gathering>>, ErrorCode>;
|
||||
#[method_id(6)]
|
||||
async fn create_matchmake_session(
|
||||
&self,
|
||||
gathering: Any<Gathering>,
|
||||
message: String,
|
||||
) -> Result<(u32, Vec<u8>), ErrorCode>;
|
||||
|
||||
#[method_id(9)]
|
||||
async fn update_notification_data(
|
||||
&self,
|
||||
ty: u32,
|
||||
param1: u32,
|
||||
param2: u32,
|
||||
str_param: String,
|
||||
) -> Result<(), ErrorCode>;
|
||||
|
||||
#[method_id(10)]
|
||||
async fn get_friend_notification_data(
|
||||
&self,
|
||||
ty: i32,
|
||||
) -> Result<Vec<NotificationEvent>, ErrorCode>;
|
||||
#[method_id(11)]
|
||||
async fn update_application_buffer(
|
||||
&self,
|
||||
gid: u32,
|
||||
application_buffer: Vec<u8>,
|
||||
) -> Result<(), ErrorCode>;
|
||||
#[method_id(15)]
|
||||
async fn auto_matchmake_with_search_criteria_postpone(
|
||||
&self,
|
||||
criteria: Vec<MatchmakeSessionSearchCriteria>,
|
||||
gathering: Any<Gathering>,
|
||||
join_msg: String,
|
||||
) -> Result<Any<Gathering>, ErrorCode>;
|
||||
|
||||
#[method_id(30)]
|
||||
async fn join_matchmake_session_ex(
|
||||
&self,
|
||||
gid: u32,
|
||||
message: String,
|
||||
dont_care_block_list: bool,
|
||||
// this is to cheat support for v3-3-0
|
||||
//participation_count: u16,
|
||||
) -> Result<Vec<u8>, ErrorCode>;
|
||||
|
||||
#[method_id(8)]
|
||||
async fn modify_current_game_attribute(
|
||||
&self,
|
||||
gid: u32,
|
||||
attrib_index: u32,
|
||||
attrib_val: u32,
|
||||
) -> Result<(), ErrorCode>;
|
||||
|
||||
#[method_id(16)]
|
||||
async fn get_playing_session(&self, pids: Vec<u32>) -> Result<Vec<()>, ErrorCode>;
|
||||
|
||||
#[method_id(34)]
|
||||
#[cfg(feature = "v3-5-0")]
|
||||
async fn update_progress_score(&self, gid: u32, progress: u8) -> Result<(), ErrorCode>;
|
||||
#[method_id(38)]
|
||||
async fn create_matchmake_session_with_param(
|
||||
&self,
|
||||
session: CreateMatchmakeSessionParam,
|
||||
) -> Result<MatchmakeSession, ErrorCode>;
|
||||
|
||||
#[method_id(39)]
|
||||
async fn join_matchmake_session_with_param(
|
||||
&self,
|
||||
session: JoinMatchmakeSessionParam,
|
||||
) -> Result<MatchmakeSession, ErrorCode>;
|
||||
|
||||
#[method_id(40)]
|
||||
async fn auto_matchmake_with_param_postpone(
|
||||
&self,
|
||||
session: AutoMatchmakeParam,
|
||||
) -> Result<MatchmakeSession, ErrorCode>;
|
||||
|
||||
#[method_id(41)]
|
||||
async fn find_matchmake_session_by_gathering_id_detail(
|
||||
&self,
|
||||
gid: u32,
|
||||
) -> Result<MatchmakeSession, ErrorCode>;
|
||||
}
|
||||
36
rnex-protocols/mm-protos/src/nat_traversal.rs
Normal file
36
rnex-protocols/mm-protos/src/nat_traversal.rs
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
use rnex_rmc::{method_id, response::ErrorCode, rmc_proto, util::station_url::StationUrl};
|
||||
|
||||
#[rmc_proto(3)]
|
||||
pub trait NatTraversal {
|
||||
#[method_id(2)]
|
||||
async fn request_probe_initiation(&self, station_to_probe: String) -> Result<(), ErrorCode>;
|
||||
|
||||
#[method_id(3)]
|
||||
async fn request_probe_initialization_ext(
|
||||
&self,
|
||||
target_list: Vec<StationUrl>,
|
||||
station_to_probe: String,
|
||||
) -> Result<(), ErrorCode>;
|
||||
|
||||
#[method_id(4)]
|
||||
async fn report_nat_traversal_result(
|
||||
&self,
|
||||
cid: u32,
|
||||
result: bool,
|
||||
rtt: u32,
|
||||
) -> Result<(), ErrorCode>;
|
||||
|
||||
#[method_id(5)]
|
||||
async fn report_nat_properties(
|
||||
&self,
|
||||
nat_mapping: u32,
|
||||
nat_filtering: u32,
|
||||
rtt: u32,
|
||||
) -> Result<(), ErrorCode>;
|
||||
}
|
||||
|
||||
#[rmc_proto(3, NoReturn)]
|
||||
pub trait NatTraversalConsole {
|
||||
#[method_id(2)]
|
||||
async fn request_probe_initiation(&self, station_to_probe: String);
|
||||
}
|
||||
26
rnex-protocols/mm-protos/src/notifications.rs
Normal file
26
rnex-protocols/mm-protos/src/notifications.rs
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
use rnex_rmc::{RmcSerialize, method_id, rmc_proto, util::PID};
|
||||
|
||||
pub mod notification_types {
|
||||
pub const OWNERSHIP_CHANGED: u32 = 4_000;
|
||||
pub const HOST_CHANGED: u32 = 110_000;
|
||||
pub const REQUEST_JOIN_GATHERING: u32 = 101;
|
||||
pub const END_GATHERING: u32 = 102;
|
||||
}
|
||||
|
||||
#[derive(RmcSerialize, Debug, Default, Clone)]
|
||||
#[rmc_struct(0)]
|
||||
pub struct NotificationEvent {
|
||||
pub pid_source: PID,
|
||||
pub notif_type: u32,
|
||||
pub param_1: PID,
|
||||
pub param_2: PID,
|
||||
pub str_param: String,
|
||||
#[cfg(feature = "third-notif-param")]
|
||||
pub param_3: PID,
|
||||
}
|
||||
|
||||
#[rmc_proto(14, NoReturn)]
|
||||
pub trait Notification {
|
||||
#[method_id(1)]
|
||||
async fn process_notification_event(&self, event: NotificationEvent);
|
||||
}
|
||||
19
rnex-protocols/msg-protos/Cargo.toml
Normal file
19
rnex-protocols/msg-protos/Cargo.toml
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
[package]
|
||||
name = "rnex-msg-protos"
|
||||
version = "0.1.0"
|
||||
edition = "2024"
|
||||
|
||||
[dependencies]
|
||||
ctor = "1.0.8"
|
||||
rnex-rmc = { path = "../../rnex-rmc" }
|
||||
|
||||
[features]
|
||||
v3-3-2 = []
|
||||
v3-4-0 = ["v3-3-2"]
|
||||
v3-5-0 = ["v3-4-0"]
|
||||
v3-8-15 = ["v3-5-0"]
|
||||
v3-10-22 = ["v3-8-15"]
|
||||
v4-3-11 = ["v3-8-15"]
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
22
rnex-protocols/msg-protos/src/lib.rs
Normal file
22
rnex-protocols/msg-protos/src/lib.rs
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
#![allow(async_fn_in_trait)]
|
||||
|
||||
pub mod message_delivery;
|
||||
pub mod messaging;
|
||||
use message_delivery::{
|
||||
MessageDelivery, MessageDeliveryNoResponse, RawMessageDelivery, RawMessageDeliveryInfo,
|
||||
RawMessageDeliveryNoResponse, RawMessageDeliveryNoResponseInfo, RemoteMessageDelivery,
|
||||
RemoteMessageDeliveryNoResponse,
|
||||
};
|
||||
use rnex_rmc::define_rmc_proto;
|
||||
|
||||
define_rmc_proto!(
|
||||
proto MessagingProtocol{
|
||||
MessageDelivery
|
||||
}
|
||||
);
|
||||
|
||||
define_rmc_proto!(
|
||||
proto MessagingClient{
|
||||
MessageDeliveryNoResponse
|
||||
}
|
||||
);
|
||||
14
rnex-protocols/msg-protos/src/message_delivery.rs
Normal file
14
rnex-protocols/msg-protos/src/message_delivery.rs
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
use rnex_rmc::{any::Any, method_id, response::ErrorCode, rmc_proto};
|
||||
|
||||
use crate::messaging::UserMessage;
|
||||
|
||||
#[rmc_proto(27)]
|
||||
pub trait MessageDelivery {
|
||||
#[method_id(1)]
|
||||
async fn deliver_message(&self, message: Any<UserMessage>) -> Result<(), ErrorCode>;
|
||||
}
|
||||
#[rmc_proto(27, NoReturn)]
|
||||
pub trait MessageDeliveryNoResponse {
|
||||
#[method_id(1)]
|
||||
async fn deliver_message(&self, message: Any<UserMessage>);
|
||||
}
|
||||
34
rnex-protocols/msg-protos/src/messaging.rs
Normal file
34
rnex-protocols/msg-protos/src/messaging.rs
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
use rnex_rmc::{RmcSerialize, data::Data, qbuffer::QBuffer, util::date_time::DateTime};
|
||||
|
||||
#[derive(RmcSerialize, Debug, Clone)]
|
||||
#[rmc_struct(0)]
|
||||
pub struct UserMessage {
|
||||
#[extends]
|
||||
pub data: Data,
|
||||
pub id: u32,
|
||||
pub recipient_id: i32,
|
||||
pub recipient_type: u32,
|
||||
pub parent_id: u32,
|
||||
pub pid_sender: u32,
|
||||
pub receptiontime: DateTime,
|
||||
pub life_time: u32,
|
||||
pub flags: u32,
|
||||
pub subject: String,
|
||||
pub sender: String,
|
||||
}
|
||||
|
||||
#[derive(RmcSerialize, Debug, Clone)]
|
||||
#[rmc_struct(0)]
|
||||
pub struct TextMessage {
|
||||
#[extends]
|
||||
pub msg: UserMessage,
|
||||
pub text_body: String,
|
||||
}
|
||||
|
||||
#[derive(RmcSerialize, Debug, Clone)]
|
||||
#[rmc_struct(0)]
|
||||
pub struct BinaryMessage {
|
||||
#[extends]
|
||||
pub msg: UserMessage,
|
||||
pub text_body: QBuffer,
|
||||
}
|
||||
11
rnex-protocols/reggie-protos/Cargo.toml
Normal file
11
rnex-protocols/reggie-protos/Cargo.toml
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
[package]
|
||||
name = "rnex-reggie-protos"
|
||||
version = "0.1.0"
|
||||
edition = "2024"
|
||||
|
||||
[dependencies]
|
||||
ctor = "1.0.8"
|
||||
rnex-rmc = { path = "../../rnex-rmc" }
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
3
rnex-protocols/reggie-protos/src/lib.rs
Normal file
3
rnex-protocols/reggie-protos/src/lib.rs
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
#![allow(async_fn_in_trait)]
|
||||
|
||||
pub mod reggie;
|
||||
22
rnex-protocols/reggie-protos/src/reggie.rs
Normal file
22
rnex-protocols/reggie-protos/src/reggie.rs
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
use std::net::SocketAddrV4;
|
||||
|
||||
use rnex_rmc::{RmcSerialize, define_rmc_proto, method_id, response::ErrorCode, rmc_proto};
|
||||
|
||||
#[rmc_proto(1)]
|
||||
pub trait EdgeNodeManagement {
|
||||
#[method_id(1)]
|
||||
async fn get_url(&self, seed: u64) -> Result<SocketAddrV4, ErrorCode>;
|
||||
}
|
||||
|
||||
define_rmc_proto!(
|
||||
proto EdgeNodeHolder{
|
||||
EdgeNodeManagement
|
||||
}
|
||||
);
|
||||
|
||||
#[derive(RmcSerialize, Debug)]
|
||||
#[repr(u32)]
|
||||
pub enum EdgeNodeHolderConnectOption {
|
||||
DontRegister = 0,
|
||||
Register(SocketAddrV4) = 1,
|
||||
}
|
||||
13
rnex-protocols/rk-protos/Cargo.toml
Normal file
13
rnex-protocols/rk-protos/Cargo.toml
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
[package]
|
||||
name = "rnex-rk-protos"
|
||||
version = "0.1.0"
|
||||
edition = "2024"
|
||||
|
||||
[dependencies]
|
||||
bytemuck = { version = "1.25.0", features = ["derive"] }
|
||||
ctor = "1.0.8"
|
||||
rnex-rmc = { path = "../../rnex-rmc" }
|
||||
rnex-base-protos = { path = "../base-protos" }
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
12
rnex-protocols/rk-protos/src/lib.rs
Normal file
12
rnex-protocols/rk-protos/src/lib.rs
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
#![allow(async_fn_in_trait)]
|
||||
|
||||
use rnex_rmc::define_rmc_proto;
|
||||
|
||||
pub mod ranking;
|
||||
use ranking::{Ranking, RawRanking, RawRankingInfo, RemoteRanking};
|
||||
|
||||
define_rmc_proto!(
|
||||
proto RankingProtocol{
|
||||
Ranking,
|
||||
}
|
||||
);
|
||||
71
rnex-protocols/rk-protos/src/ranking.rs
Normal file
71
rnex-protocols/rk-protos/src/ranking.rs
Normal file
|
|
@ -0,0 +1,71 @@
|
|||
use bytemuck::{Pod, Zeroable};
|
||||
use rnex_base_protos::ResultsRange;
|
||||
use rnex_rmc::{
|
||||
RmcSerialize, method_id,
|
||||
qbuffer::QBuffer,
|
||||
response::ErrorCode,
|
||||
rmc_proto,
|
||||
util::{PID, date_time::DateTime},
|
||||
};
|
||||
|
||||
#[derive(RmcSerialize, Debug)]
|
||||
#[rmc_struct(0)]
|
||||
pub struct UploadCompetitionData {
|
||||
pub unk_1: u32,
|
||||
pub splatfest_id: u32,
|
||||
pub unk_2: u32,
|
||||
pub score: u32,
|
||||
pub team_id: u8,
|
||||
pub team_win: u8,
|
||||
pub is_first_upload: bool,
|
||||
pub appdata: QBuffer,
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Pod, Zeroable)]
|
||||
#[repr(C)]
|
||||
struct UserData {
|
||||
name: [u16; 0x10],
|
||||
}
|
||||
|
||||
#[derive(RmcSerialize, Debug, Default, Clone)]
|
||||
#[rmc_struct(1)]
|
||||
pub struct CompetitionRankingGetParam {
|
||||
pub unk: u32,
|
||||
pub range: ResultsRange,
|
||||
pub festival_ids: Vec<u32>,
|
||||
}
|
||||
|
||||
#[derive(RmcSerialize, Debug, Default, Clone)]
|
||||
#[rmc_struct(0)]
|
||||
pub struct CompetitionRankingScoreInfo {
|
||||
pub fest_id: u32,
|
||||
pub score_data: Vec<CompetitionRankingScoreData>,
|
||||
pub unk: u32,
|
||||
pub team_wins: Vec<u32>,
|
||||
pub team_votes: Vec<u32>,
|
||||
}
|
||||
|
||||
#[derive(RmcSerialize, Debug, Clone)]
|
||||
#[rmc_struct(0)]
|
||||
pub struct CompetitionRankingScoreData {
|
||||
pub unk: u32,
|
||||
pub pid: PID,
|
||||
pub score: u32,
|
||||
pub modified: DateTime,
|
||||
pub unk2: u8,
|
||||
pub appdata: QBuffer,
|
||||
}
|
||||
|
||||
#[rmc_proto(112)]
|
||||
pub trait Ranking {
|
||||
#[method_id(16)]
|
||||
async fn competition_ranking_get_param(
|
||||
&self,
|
||||
param: CompetitionRankingGetParam,
|
||||
) -> Result<Vec<CompetitionRankingScoreInfo>, ErrorCode>;
|
||||
#[method_id(18)]
|
||||
async fn upload_competition_ranking_score(
|
||||
&self,
|
||||
param: UploadCompetitionData,
|
||||
) -> Result<bool, ErrorCode>;
|
||||
}
|
||||
Loading…
Reference in a new issue