1
Fork 0
mirror of https://github.com/redstrate/Kawari.git synced 2025-05-06 04:37:46 +00:00

Use more accurate names for some client lobby packet types

This commit is contained in:
Joshua Goins 2025-05-01 22:36:30 -04:00
parent 6971ef1fc8
commit 2ec54fa6ec
4 changed files with 15 additions and 15 deletions

View file

@ -312,17 +312,17 @@
], ],
"ClientLobbyIpcType": [ "ClientLobbyIpcType": [
{ {
"name": "RequestCharacterList", "name": "ServiceLogin",
"opcode": 3, "opcode": 3,
"size": 24 "size": 24
}, },
{ {
"name": "RequestEnterWorld", "name": "GameLogin",
"opcode": 4, "opcode": 4,
"size": 32 "size": 32
}, },
{ {
"name": "ClientVersionInfo", "name": "LoginEx",
"opcode": 5, "opcode": 5,
"size": 1144 "size": 1144
}, },

View file

@ -65,7 +65,7 @@ async fn main() {
connection.initialize_encryption(phrase, key).await connection.initialize_encryption(phrase, key).await
} }
SegmentType::Ipc { data } => match &data.data { SegmentType::Ipc { data } => match &data.data {
ClientLobbyIpcData::ClientVersionInfo { ClientLobbyIpcData::LoginEx {
sequence, sequence,
session_id, session_id,
version_info, version_info,
@ -98,7 +98,7 @@ async fn main() {
connection.send_error(*sequence, 1012, 13101).await; connection.send_error(*sequence, 1012, 13101).await;
} }
} }
ClientLobbyIpcData::RequestCharacterList { sequence } => { ClientLobbyIpcData::ServiceLogin { sequence } => {
// TODO: support selecting a service account // TODO: support selecting a service account
connection.selected_service_account = connection.selected_service_account =
Some(connection.service_accounts[0].id); Some(connection.service_accounts[0].id);
@ -112,7 +112,7 @@ async fn main() {
connection.send_account_list().await; connection.send_account_list().await;
} }
ClientLobbyIpcData::RequestEnterWorld { ClientLobbyIpcData::GameLogin {
sequence, sequence,
content_id, content_id,
} => { } => {

View file

@ -35,10 +35,10 @@ impl Default for ClientLobbyIpcSegment {
Self { Self {
unk1: 0x14, unk1: 0x14,
unk2: 0, unk2: 0,
op_code: ClientLobbyIpcType::ClientVersionInfo, op_code: ClientLobbyIpcType::LoginEx,
server_id: 0, server_id: 0,
timestamp: 0, timestamp: 0,
data: ClientLobbyIpcData::ClientVersionInfo { data: ClientLobbyIpcData::LoginEx {
sequence: 0, sequence: 0,
session_id: String::new(), session_id: String::new(),
version_info: String::new(), version_info: String::new(),
@ -81,8 +81,8 @@ impl Default for ServerLobbyIpcSegment {
#[derive(Debug, Clone)] #[derive(Debug, Clone)]
pub enum ClientLobbyIpcData { pub enum ClientLobbyIpcData {
/// Sent by the client after exchanging encryption information with the lobby server. /// Sent by the client after exchanging encryption information with the lobby server.
#[br(pre_assert(*magic == ClientLobbyIpcType::ClientVersionInfo))] #[br(pre_assert(*magic == ClientLobbyIpcType::LoginEx))]
ClientVersionInfo { LoginEx {
sequence: u64, sequence: u64,
#[brw(pad_before = 10)] // full of nonsense i don't understand yet #[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 // unknown stuff at the end, it's not completely empty
}, },
/// Sent by the client when it requests the character list in the lobby. /// Sent by the client when it requests the character list in the lobby.
#[br(pre_assert(*magic == ClientLobbyIpcType::RequestCharacterList))] #[br(pre_assert(*magic == ClientLobbyIpcType::ServiceLogin))]
RequestCharacterList { ServiceLogin {
#[brw(pad_before = 16)] #[brw(pad_before = 16)]
sequence: u64, sequence: u64,
// TODO: what is in here? // TODO: what is in here?
@ -109,8 +109,8 @@ pub enum ClientLobbyIpcData {
#[br(pre_assert(*magic == ClientLobbyIpcType::LobbyCharacterAction))] #[br(pre_assert(*magic == ClientLobbyIpcType::LobbyCharacterAction))]
LobbyCharacterAction(LobbyCharacterAction), LobbyCharacterAction(LobbyCharacterAction),
/// Sent by the client when it requests to enter a world. /// Sent by the client when it requests to enter a world.
#[br(pre_assert(*magic == ClientLobbyIpcType::RequestEnterWorld))] #[br(pre_assert(*magic == ClientLobbyIpcType::GameLogin))]
RequestEnterWorld { GameLogin {
sequence: u64, sequence: u64,
content_id: u64, content_id: u64,
// TODO: what else is in here? // TODO: what else is in here?

View file

@ -157,7 +157,7 @@ pub async fn send_packet<T: ReadWriteIpcSegment>(
size: size as u32, size: size as u32,
connection_type, connection_type,
segment_count: segments.len() as u16, segment_count: segments.len() as u16,
unk3: 0, version: 0,
compression_type, compression_type,
unk4: 0, unk4: 0,
uncompressed_size: uncompressed_size as u32, uncompressed_size: uncompressed_size as u32,