|
@ -211,7 +211,7 @@ pub struct RequestSettings { |
|
|
pub struct SendKeyAndTeamSettings {
|
|
|
pub struct SendKeyAndTeamSettings {
|
|
|
unknown: [u8; 0x114],
|
|
|
unknown: [u8; 0x114],
|
|
|
key_config: [u8; 0x16C],
|
|
|
key_config: [u8; 0x16C],
|
|
|
joystick_config: [u8; 0x38],
|
|
|
|
|
|
|
|
|
controller_config: [u8; 0x38],
|
|
|
guildcard: u32,
|
|
|
guildcard: u32,
|
|
|
team_id: u32,
|
|
|
team_id: u32,
|
|
|
//team_info: [u32; 2],
|
|
|
//team_info: [u32; 2],
|
|
@ -226,11 +226,11 @@ pub struct SendKeyAndTeamSettings { |
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
impl SendKeyAndTeamSettings {
|
|
|
impl SendKeyAndTeamSettings {
|
|
|
pub fn new(key_config: [u8; 0x16C], joystick_config: [u8; 0x38], guildcard: u32, team_id: u32) -> SendKeyAndTeamSettings {
|
|
|
|
|
|
|
|
|
pub fn new(key_config: [u8; 0x16C], controller_config: [u8; 0x38], guildcard: u32, team_id: u32) -> SendKeyAndTeamSettings {
|
|
|
SendKeyAndTeamSettings {
|
|
|
SendKeyAndTeamSettings {
|
|
|
unknown: [0; 0x114],
|
|
|
unknown: [0; 0x114],
|
|
|
key_config: key_config,
|
|
|
key_config: key_config,
|
|
|
joystick_config: joystick_config,
|
|
|
|
|
|
|
|
|
controller_config: controller_config,
|
|
|
guildcard: guildcard,
|
|
|
guildcard: guildcard,
|
|
|
team_id: team_id,
|
|
|
team_id: team_id,
|
|
|
//team_info: [0; 2],
|
|
|
//team_info: [0; 2],
|
|
@ -551,16 +551,16 @@ mod tests { |
|
|
let mut rng = rand::thread_rng();
|
|
|
let mut rng = rand::thread_rng();
|
|
|
|
|
|
|
|
|
let mut key_config = [0u8; 0x16C];
|
|
|
let mut key_config = [0u8; 0x16C];
|
|
|
let mut joystick_config = [0u8; 0x38];
|
|
|
|
|
|
|
|
|
let mut controller_config = [0u8; 0x38];
|
|
|
|
|
|
|
|
|
rng.fill(&mut key_config[..]);
|
|
|
rng.fill(&mut key_config[..]);
|
|
|
rng.fill(&mut joystick_config[..]);
|
|
|
|
|
|
let pkt = super::SendKeyAndTeamSettings::new(key_config, joystick_config, 123, 456);
|
|
|
|
|
|
|
|
|
rng.fill(&mut controller_config[..]);
|
|
|
|
|
|
let pkt = super::SendKeyAndTeamSettings::new(key_config, controller_config, 123, 456);
|
|
|
let bytes = pkt.as_bytes();
|
|
|
let bytes = pkt.as_bytes();
|
|
|
|
|
|
|
|
|
assert!(bytes[2] == 0xe2);
|
|
|
assert!(bytes[2] == 0xe2);
|
|
|
assert!(bytes[8 + 0x114] == key_config[0]);
|
|
|
assert!(bytes[8 + 0x114] == key_config[0]);
|
|
|
assert!(bytes[8 + 0x114 + 0x16C] == joystick_config[0]);
|
|
|
|
|
|
|
|
|
assert!(bytes[8 + 0x114 + 0x16C] == controller_config[0]);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
#[test]
|
|
|
#[test]
|
|
|