diff --git a/resources/opcodes.json b/resources/opcodes.json index feb0dc8..f89e34f 100644 --- a/resources/opcodes.json +++ b/resources/opcodes.json @@ -312,17 +312,17 @@ ], "ClientLobbyIpcType": [ { - "name": "RequestCharacterList", + "name": "ServiceLogin", "opcode": 3, "size": 24 }, { - "name": "RequestEnterWorld", + "name": "GameLogin", "opcode": 4, "size": 32 }, { - "name": "ClientVersionInfo", + "name": "LoginEx", "opcode": 5, "size": 1144 }, diff --git a/src/bin/kawari-lobby.rs b/src/bin/kawari-lobby.rs index bb80c6c..c0a9295 100644 --- a/src/bin/kawari-lobby.rs +++ b/src/bin/kawari-lobby.rs @@ -65,7 +65,7 @@ async fn main() { connection.initialize_encryption(phrase, key).await } SegmentType::Ipc { data } => match &data.data { - ClientLobbyIpcData::ClientVersionInfo { + ClientLobbyIpcData::LoginEx { sequence, session_id, version_info, @@ -98,7 +98,7 @@ async fn main() { connection.send_error(*sequence, 1012, 13101).await; } } - ClientLobbyIpcData::RequestCharacterList { sequence } => { + ClientLobbyIpcData::ServiceLogin { sequence } => { // TODO: support selecting a service account connection.selected_service_account = Some(connection.service_accounts[0].id); @@ -112,7 +112,7 @@ async fn main() { connection.send_account_list().await; } - ClientLobbyIpcData::RequestEnterWorld { + ClientLobbyIpcData::GameLogin { sequence, content_id, } => { diff --git a/src/lobby/ipc/mod.rs b/src/lobby/ipc/mod.rs index 8284581..dee0b72 100644 --- a/src/lobby/ipc/mod.rs +++ b/src/lobby/ipc/mod.rs @@ -35,10 +35,10 @@ impl Default for ClientLobbyIpcSegment { Self { unk1: 0x14, unk2: 0, - op_code: ClientLobbyIpcType::ClientVersionInfo, + op_code: ClientLobbyIpcType::LoginEx, server_id: 0, timestamp: 0, - data: ClientLobbyIpcData::ClientVersionInfo { + data: ClientLobbyIpcData::LoginEx { sequence: 0, session_id: String::new(), version_info: String::new(), @@ -81,8 +81,8 @@ impl Default for ServerLobbyIpcSegment { #[derive(Debug, Clone)] pub enum ClientLobbyIpcData { /// Sent by the client after exchanging encryption information with the lobby server. - #[br(pre_assert(*magic == ClientLobbyIpcType::ClientVersionInfo))] - ClientVersionInfo { + #[br(pre_assert(*magic == ClientLobbyIpcType::LoginEx))] + LoginEx { sequence: u64, #[brw(pad_before = 10)] // full of nonsense i don't understand yet @@ -99,8 +99,8 @@ pub enum ClientLobbyIpcData { // unknown stuff at the end, it's not completely empty }, /// Sent by the client when it requests the character list in the lobby. - #[br(pre_assert(*magic == ClientLobbyIpcType::RequestCharacterList))] - RequestCharacterList { + #[br(pre_assert(*magic == ClientLobbyIpcType::ServiceLogin))] + ServiceLogin { #[brw(pad_before = 16)] sequence: u64, // TODO: what is in here? @@ -109,8 +109,8 @@ pub enum ClientLobbyIpcData { #[br(pre_assert(*magic == ClientLobbyIpcType::LobbyCharacterAction))] LobbyCharacterAction(LobbyCharacterAction), /// Sent by the client when it requests to enter a world. - #[br(pre_assert(*magic == ClientLobbyIpcType::RequestEnterWorld))] - RequestEnterWorld { + #[br(pre_assert(*magic == ClientLobbyIpcType::GameLogin))] + GameLogin { sequence: u64, content_id: u64, // TODO: what else is in here? diff --git a/src/packet/parsing.rs b/src/packet/parsing.rs index 30bd248..907e0f6 100644 --- a/src/packet/parsing.rs +++ b/src/packet/parsing.rs @@ -157,7 +157,7 @@ pub async fn send_packet( size: size as u32, connection_type, segment_count: segments.len() as u16, - unk3: 0, + version: 0, compression_type, unk4: 0, uncompressed_size: uncompressed_size as u32,