Add NEX results and fix timers

This commit is contained in:
red binder 2026-04-06 13:35:55 +00:00 committed by Maple
commit 55b3959797
8 changed files with 586 additions and 52 deletions

View file

@ -42,7 +42,8 @@ impl RMCMessage{
error!("received incorrect rmc packet: expected size {} but found {}", size, header_size + rest_of_data.len());
}
// println!("rmc packet: protoid: {}, method id: {}", protocol_id, method_id);
// println!("{}", hex::encode(&rest_of_data));
//stream.
Ok(Self{

View file

@ -1,33 +1,51 @@
use macros::{rmc_struct, rmc_proto, RmcSerialize};
use macros::{rmc_struct, rmc_proto, RmcSerialize, method_id};
use rnex_core::kerberos::KerberosDateTime;
use rnex_core::rmc::structures::qbuffer::QBuffer;
use rnex_core::rmc::response::ErrorCode;
use rnex_core::rmc::structures::ranking::UploadCompetitionData;
#[derive(RmcSerialize, Debug, Default, Clone)]
struct ResultsRange{
offset: u32,
size: u32
#[rmc_struct(0)]
pub struct ResultsRange{
pub offset: u32,
pub size: u32
}
#[derive(RmcSerialize, Debug, Default, Clone)]
#[rmc_struct(1)]
struct CompetitionRankingGetParam{
unk: u32,
range: ResultsRange,
festival_ids: Vec<u32>,
pub struct CompetitionRankingGetParam {
pub unk: u32,
pub range: ResultsRange,
pub festival_ids: Vec<u32>,
}
#[derive(RmcSerialize, Debug, Default, Clone)]
#[rmc_struct(0)]
struct CompetitionRankingScoreInfo{
fest_id: u32,
score_data: Vec<u32>,
unk: u32,
team_wins: Vec<u32>,
team_votes: Vec<u32>
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: u32,
pub score: u32,
pub modified: KerberosDateTime,
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(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>;
}

View file

@ -3,8 +3,7 @@ use bytemuck::bytes_of;
use v_byte_helpers::{IS_BIG_ENDIAN, ReadExtensions};
use crate::rmc::structures::{Result, RmcSerialize};
#[derive(Debug)]
#[derive(Clone, Debug)]
pub struct QBuffer(pub Vec<u8>);
impl RmcSerialize for QBuffer{

View file

@ -4,15 +4,15 @@ use rnex_core::rmc::structures::qbuffer::QBuffer;
#[derive(RmcSerialize, Debug)]
#[rmc_struct(0)]
struct UploadCompetitionData {
winning_team: u32,
splatfest_id: u32,
unk_2: u32,
unk_3: u32,
team_id_1: u8,
team_id_2: u8,
unk_5: u32,
player_data: QBuffer,
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)]