|
|
@ -210,7 +210,7 @@ pub struct RequestSettings { |
|
|
|
#[pso_packet(0xE2)]
|
|
|
|
pub struct SendKeyAndTeamSettings {
|
|
|
|
unknown: [u8; 0x114],
|
|
|
|
key_config: [u8; 0x16C],
|
|
|
|
keyboard_config: [u8; 0x16C],
|
|
|
|
gamepad_config: [u8; 0x38],
|
|
|
|
guildcard: u32,
|
|
|
|
team_id: u32,
|
|
|
@ -226,10 +226,10 @@ pub struct SendKeyAndTeamSettings { |
|
|
|
}
|
|
|
|
|
|
|
|
impl SendKeyAndTeamSettings {
|
|
|
|
pub fn new(key_config: [u8; 0x16C], gamepad_config: [u8; 0x38], guildcard: u32, team_id: u32) -> SendKeyAndTeamSettings {
|
|
|
|
pub fn new(keyboard_config: [u8; 0x16C], gamepad_config: [u8; 0x38], guildcard: u32, team_id: u32) -> SendKeyAndTeamSettings {
|
|
|
|
SendKeyAndTeamSettings {
|
|
|
|
unknown: [0; 0x114],
|
|
|
|
key_config: key_config,
|
|
|
|
keyboard_config: keyboard_config,
|
|
|
|
gamepad_config: gamepad_config,
|
|
|
|
guildcard: guildcard,
|
|
|
|
team_id: team_id,
|
|
|
@ -550,16 +550,16 @@ mod tests { |
|
|
|
|
|
|
|
let mut rng = rand::thread_rng();
|
|
|
|
|
|
|
|
let mut key_config = [0u8; 0x16C];
|
|
|
|
let mut keyboard_config = [0u8; 0x16C];
|
|
|
|
let mut gamepad_config = [0u8; 0x38];
|
|
|
|
|
|
|
|
rng.fill(&mut key_config[..]);
|
|
|
|
rng.fill(&mut keyboard_config[..]);
|
|
|
|
rng.fill(&mut gamepad_config[..]);
|
|
|
|
let pkt = super::SendKeyAndTeamSettings::new(key_config, gamepad_config, 123, 456);
|
|
|
|
let pkt = super::SendKeyAndTeamSettings::new(keyboard_config, gamepad_config, 123, 456);
|
|
|
|
let bytes = pkt.as_bytes();
|
|
|
|
|
|
|
|
assert!(bytes[2] == 0xe2);
|
|
|
|
assert!(bytes[8 + 0x114] == key_config[0]);
|
|
|
|
assert!(bytes[8 + 0x114] == keyboard_config[0]);
|
|
|
|
assert!(bytes[8 + 0x114 + 0x16C] == gamepad_config[0]);
|
|
|
|
}
|
|
|
|
|
|
|
|