From 2649985b3259dcfc2e984079d48078a45c67c5d4 Mon Sep 17 00:00:00 2001 From: Joshua Goins Date: Sun, 9 Mar 2025 10:13:47 -0400 Subject: [PATCH] Fill out more fields of ClientSelectData Thanks to FFXIVClientStructs, which already has much of this documented. --- src/bin/kawari-lobby.rs | 22 ++++++++++---------- src/client_select_data.rs | 43 ++++++++++++++++++++------------------- 2 files changed, 33 insertions(+), 32 deletions(-) diff --git a/src/bin/kawari-lobby.rs b/src/bin/kawari-lobby.rs index fb7029b..5331f5f 100644 --- a/src/bin/kawari-lobby.rs +++ b/src/bin/kawari-lobby.rs @@ -235,17 +235,17 @@ async fn send_lobby_info(socket: &mut WriteHalf, state: &State, seque { let select_data = ClientSelectData { game_name_unk: "Final Fantasy".to_string(), - version_maybe: 1, - unk1: [0; 30], - unk2: 0, - unk3: 0, - unk4: 0, - unk5: 0, - unk6: 0, - unk7: 0, + current_class: 2, + class_levels: [5; 30], + race: 0, + subrace: 0, + gender: 0, + birth_month: 5, + birth_day: 5, + guardian: 2, unk8: 0, unk9: 0, - unk10: 0, + zone_id: 1000, unk11: 0, customize: ClientCustomizeData { race: 3, @@ -279,11 +279,11 @@ async fn send_lobby_info(socket: &mut WriteHalf, state: &State, seque unk14: [0; 10], unk15: 0, unk16: 0, - unk17: 0, + legacy_character: 0, unk18: 0, unk19: 0, unk20: 0, - unk21: String::new(), + unk21: "hello".to_string(), unk22: 0, unk23: 0, }; diff --git a/src/client_select_data.rs b/src/client_select_data.rs index d61b7dd..8ee7498 100644 --- a/src/client_select_data.rs +++ b/src/client_select_data.rs @@ -58,20 +58,20 @@ impl ClientCustomizeData { ]) } } - +/// See https://github.com/aers/FFXIVClientStructs/blob/main/FFXIVClientStructs/FFXIV/Application/Network/WorkDefinitions/ClientSelectData.cs pub struct ClientSelectData { pub game_name_unk: String, - pub version_maybe: i32, - pub unk1: [i32; 30], - pub unk2: i32, - pub unk3: i32, - pub unk4: i32, - pub unk5: i32, - pub unk6: i32, - pub unk7: i32, + pub current_class: i32, + pub class_levels: [i32; 30], + pub race: i32, + pub subrace: i32, + pub gender: i32, + pub birth_month: i32, + pub birth_day: i32, + pub guardian: i32, pub unk8: i32, pub unk9: i32, - pub unk10: i32, + pub zone_id: i32, pub unk11: i32, pub customize: ClientCustomizeData, pub unk12: i32, @@ -79,7 +79,8 @@ pub struct ClientSelectData { pub unk14: [i32; 10], pub unk15: i32, pub unk16: i32, - pub unk17: i32, + /// If set to 1, the user is granted one opportunity to edit their character and are prompted to re-choose their class. + pub legacy_character: i32, pub unk18: i32, pub unk19: i32, pub unk20: i32, @@ -92,17 +93,17 @@ impl ClientSelectData { pub fn to_json(&self) -> String { let content = json!([ self.game_name_unk, - self.version_maybe.to_string(), - self.unk1.map(|x| x.to_string()), - self.unk2.to_string(), - self.unk3.to_string(), - self.unk4.to_string(), - self.unk5.to_string(), - self.unk6.to_string(), - self.unk7.to_string(), + self.current_class.to_string(), + self.class_levels.map(|x| x.to_string()), + self.race.to_string(), + self.subrace.to_string(), + self.gender.to_string(), + self.birth_month.to_string(), + self.birth_day.to_string(), + self.guardian.to_string(), self.unk8.to_string(), self.unk9.to_string(), - self.unk10.to_string(), + self.zone_id.to_string(), self.unk11.to_string(), self.customize.to_json(), self.unk12.to_string(), @@ -110,7 +111,7 @@ impl ClientSelectData { self.unk14.map(|x| x.to_string()), self.unk15.to_string(), self.unk16.to_string(), - self.unk17.to_string(), + self.legacy_character.to_string(), self.unk18.to_string(), self.unk19.to_string(), self.unk20.to_string(),