diff --git a/src/ipc.rs b/src/ipc.rs index 6a3d565..a624429 100644 --- a/src/ipc.rs +++ b/src/ipc.rs @@ -13,7 +13,7 @@ pub enum IPCOpCode { } #[binrw] -#[derive(Debug, Clone)] +#[derive(Debug, Clone, Default)] pub struct ServiceAccount { pub id: u32, pub unk1: u32, @@ -49,7 +49,7 @@ pub enum IPCStructData { // Server->Client IPC LobbyServiceAccountList { sequence: u64, - #[brw(pad_before = 4)] + #[brw(pad_before = 1)] num_service_accounts: u8, unk1: u8, #[brw(pad_after = 4)] @@ -77,9 +77,9 @@ impl IPCSegment { pub fn calc_size(&self) -> u32 { let header = 16; header - + match self.data { - IPCStructData::ClientVersionInfo { .. } => todo!(), - IPCStructData::LobbyServiceAccountList { .. } => 19, - } + + match self.data { + IPCStructData::ClientVersionInfo { .. } => todo!(), + IPCStructData::LobbyServiceAccountList { .. } => 24 + (8 * 80), + } } } diff --git a/src/packet.rs b/src/packet.rs index b64759b..af4c75b 100644 --- a/src/packet.rs +++ b/src/packet.rs @@ -231,12 +231,14 @@ pub async fn parse_packet(socket: &mut WriteHalf, data: &[u8], state: .unwrap(); // send the client the service account list - let service_accounts = [ServiceAccount { + let mut service_accounts = [ServiceAccount { id: 0x002E4A2B, unk1: 0, index: 0, - name: "Test Service Account".to_string(), - }]; + name: "FINAL FANTASY XIV".to_string(), + }].to_vec(); + // add any empty boys + service_accounts.resize(8, ServiceAccount::default()); let service_account_list = IPCStructData::LobbyServiceAccountList { sequence: 0,