remove one test
This commit is contained in:
parent
e6ec245b87
commit
9d3a25fd95
3 changed files with 2 additions and 59 deletions
|
|
@ -43,60 +43,3 @@ impl Any {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
|
||||||
mod test {
|
|
||||||
use crate::rmc::structures::{
|
|
||||||
RmcSerialize,
|
|
||||||
any::Any,
|
|
||||||
matchmake::{Gathering, MatchmakeSession},
|
|
||||||
};
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn test() {
|
|
||||||
let any = Any {
|
|
||||||
name: "MatchmakeSession".into(),
|
|
||||||
data: [
|
|
||||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 2, 0, 98, 0, 0, 0, 0, 0, 0, 0, 32, 0, 0,
|
|
||||||
0, 0, 0, 0, 0, 20, 0, 68, 111, 111, 114, 115, 32, 70, 114, 105, 101, 110, 100, 32,
|
|
||||||
73, 110, 118, 105, 116, 101, 0, 0, 0, 0, 0, 6, 0, 0, 0, 2, 0, 0, 0, 3, 0, 0, 0, 0,
|
|
||||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 3, 0, 0, 0, 1, 2, 3, 0,
|
|
||||||
0, 0, 0, 0, 0, 0, 0, 0,
|
|
||||||
]
|
|
||||||
.into(),
|
|
||||||
};
|
|
||||||
|
|
||||||
println!("{}", hex::encode(&any.data));
|
|
||||||
|
|
||||||
let _: MatchmakeSession = any.try_get().unwrap().unwrap();
|
|
||||||
let sess = MatchmakeSession {
|
|
||||||
gathering: Gathering {
|
|
||||||
self_gid: 0,
|
|
||||||
owner_pid: 0,
|
|
||||||
host_pid: 0,
|
|
||||||
minimum_participants: 2,
|
|
||||||
maximum_participants: 2,
|
|
||||||
participant_policy: 98,
|
|
||||||
policy_argument: 0,
|
|
||||||
flags: 32,
|
|
||||||
state: 0,
|
|
||||||
description: "Doors Friend Invite".into(),
|
|
||||||
},
|
|
||||||
gamemode: 0,
|
|
||||||
attributes: [2, 3, 0, 0, 0, 0].into(),
|
|
||||||
open_participation: false,
|
|
||||||
matchmake_system_type: 2,
|
|
||||||
application_buffer: [1, 2, 3].into(),
|
|
||||||
participation_count: 0,
|
|
||||||
#[cfg(feature = "v3-5-0")]
|
|
||||||
progress_score: 0,
|
|
||||||
session_key: [].into(),
|
|
||||||
};
|
|
||||||
|
|
||||||
let any = Any::new(&sess).unwrap();
|
|
||||||
|
|
||||||
let sess2: MatchmakeSession = any.try_get().unwrap().unwrap();
|
|
||||||
|
|
||||||
assert_eq!(sess, sess2)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ pub struct Gathering {
|
||||||
}
|
}
|
||||||
|
|
||||||
// rmc structure
|
// rmc structure
|
||||||
#[derive(RmcSerialize, Debug, Clone, Default)]
|
#[derive(RmcSerialize, Debug, Clone, Default, PartialEq)]
|
||||||
#[rmc_struct(0)]
|
#[rmc_struct(0)]
|
||||||
pub struct MatchmakeParam {
|
pub struct MatchmakeParam {
|
||||||
pub params: Vec<(String, Variant)>,
|
pub params: Vec<(String, Variant)>,
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ use rnex_core::rmc::structures;
|
||||||
use rnex_core::rmc::structures::{Result, RmcSerialize};
|
use rnex_core::rmc::structures::{Result, RmcSerialize};
|
||||||
use std::io::{Read, Write};
|
use std::io::{Read, Write};
|
||||||
|
|
||||||
#[derive(Debug, Clone, Default)]
|
#[derive(Debug, Clone, Default, PartialEq)]
|
||||||
pub enum Variant {
|
pub enum Variant {
|
||||||
#[default]
|
#[default]
|
||||||
None,
|
None,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue