rust-nex/rnex-core/src/rmc/protocols/ranking.rs

50 lines
1.3 KiB
Rust
Raw Normal View History

2026-04-26 13:15:56 +02:00
use macros::{RmcSerialize, method_id, rmc_proto};
2026-04-06 13:35:55 +00:00
use rnex_core::kerberos::KerberosDateTime;
use rnex_core::rmc::structures::qbuffer::QBuffer;
2026-04-20 14:06:04 +02:00
use rnex_core::rmc::structures::resultsrange::ResultsRange;
2026-04-06 13:35:55 +00:00
use rnex_core::rmc::response::ErrorCode;
use rnex_core::rmc::structures::ranking::UploadCompetitionData;
2025-11-08 12:04:39 +00:00
#[derive(RmcSerialize, Debug, Default, Clone)]
#[rmc_struct(1)]
2026-04-06 13:35:55 +00:00
pub struct CompetitionRankingGetParam {
pub unk: u32,
pub range: ResultsRange,
pub festival_ids: Vec<u32>,
2025-11-08 12:04:39 +00:00
}
#[derive(RmcSerialize, Debug, Default, Clone)]
#[rmc_struct(0)]
2026-04-26 13:15:56 +02:00
pub struct CompetitionRankingScoreInfo {
2026-04-06 13:35:55 +00:00
pub fest_id: u32,
pub score_data: Vec<CompetitionRankingScoreData>,
pub unk: u32,
pub team_wins: Vec<u32>,
2026-04-26 13:15:56 +02:00
pub team_votes: Vec<u32>,
2025-11-08 12:04:39 +00:00
}
2026-04-06 13:35:55 +00:00
#[derive(RmcSerialize, Debug, Clone)]
#[rmc_struct(0)]
2026-04-26 13:15:56 +02:00
pub struct CompetitionRankingScoreData {
2026-04-06 13:35:55 +00:00
pub unk: u32,
pub pid: u32,
pub score: u32,
pub modified: KerberosDateTime,
pub unk2: u8,
2026-04-26 13:15:56 +02:00
pub appdata: QBuffer,
2026-04-06 13:35:55 +00:00
}
2025-05-15 20:53:56 +02:00
#[rmc_proto(112)]
2026-04-26 13:15:56 +02:00
pub trait Ranking {
2026-04-06 13:35:55 +00:00
#[method_id(16)]
2026-04-26 13:15:56 +02:00
async fn competition_ranking_get_param(
&self,
param: CompetitionRankingGetParam,
) -> Result<Vec<CompetitionRankingScoreInfo>, ErrorCode>;
2026-04-06 13:35:55 +00:00
#[method_id(18)]
2026-04-26 13:15:56 +02:00
async fn upload_competition_ranking_score(
&self,
param: UploadCompetitionData,
) -> Result<bool, ErrorCode>;
2026-04-06 13:35:55 +00:00
}