From a417b08e4ebcab0af15955b52bf120bbf6540503 Mon Sep 17 00:00:00 2001 From: andy Date: Fri, 31 Dec 2021 21:22:54 +0000 Subject: [PATCH] joystick_config -> controller_config for consistency --- src/character/character.rs | 4 ++-- src/character/settings.rs | 4 ++-- src/packet/login.rs | 14 +++++++------- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/character/character.rs b/src/character/character.rs index 80e416c..7dc6751 100644 --- a/src/character/character.rs +++ b/src/character/character.rs @@ -273,7 +273,7 @@ impl std::default::Default for Bank { pub struct KeyTeamConfig { pub _unknown: [u8; 0x114], pub keyboard_config: [u8; 0x16C], - pub joystick_config: [u8; 0x38], + pub controller_config: [u8; 0x38], pub guildcard: u32, pub team_id: u32, pub team_info: [u32; 2], @@ -354,7 +354,7 @@ pub struct DBChar { pub struct DBOpts { pub blocked: [u32; 30], pub keyboard_config: [u8; 0x16C], - pub joystick_config: [u8; 0x38], + pub controller_config: [u8; 0x38], pub option_flags: u32, pub shortcuts: [u8; 0xA40], pub symbol_chats: [u8; 0x4E0], diff --git a/src/character/settings.rs b/src/character/settings.rs index 1693d03..881425c 100644 --- a/src/character/settings.rs +++ b/src/character/settings.rs @@ -479,7 +479,7 @@ pub const DEFAULT_CONTROLLER_CONFIG: [u8; 56] = [ pub struct UserSettings { pub blocked_users: [u32; 0x1E], pub keyboard_config: [u8; 0x16C], - pub joystick_config: [u8; 0x38], + pub controller_config: [u8; 0x38], pub option_flags: u32, pub shortcuts: [u8; 0xA40], pub symbol_chats: [u8; 0x4E0], @@ -492,7 +492,7 @@ impl Default for UserSettings { UserSettings { blocked_users: [0; 0x1E], keyboard_config: DEFAULT_KEY_CONFIG, - joystick_config: DEFAULT_JOYSTICK_CONFIG, + controller_config: DEFAULT_JOYSTICK_CONFIG, option_flags: 0, shortcuts: [0; 0xA40], symbol_chats: DEFAULT_SYMBOLCHATS, diff --git a/src/packet/login.rs b/src/packet/login.rs index 7a506fd..933e2db 100644 --- a/src/packet/login.rs +++ b/src/packet/login.rs @@ -211,7 +211,7 @@ pub struct RequestSettings { pub struct SendKeyAndTeamSettings { unknown: [u8; 0x114], key_config: [u8; 0x16C], - joystick_config: [u8; 0x38], + controller_config: [u8; 0x38], guildcard: u32, team_id: u32, //team_info: [u32; 2], @@ -226,11 +226,11 @@ pub struct 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 { unknown: [0; 0x114], key_config: key_config, - joystick_config: joystick_config, + controller_config: controller_config, guildcard: guildcard, team_id: team_id, //team_info: [0; 2], @@ -551,16 +551,16 @@ mod tests { let mut rng = rand::thread_rng(); 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 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(); assert!(bytes[2] == 0xe2); assert!(bytes[8 + 0x114] == key_config[0]); - assert!(bytes[8 + 0x114 + 0x16C] == joystick_config[0]); + assert!(bytes[8 + 0x114 + 0x16C] == controller_config[0]); } #[test]