From 781fea1e3594a4728c37bb94f8e6f461e3a36912 Mon Sep 17 00:00:00 2001 From: Joshua Goins Date: Fri, 11 Jul 2025 23:21:18 -0400 Subject: [PATCH] Fix Chronofoil capturing not working This was because Kawari was not seeing the KeepAliveRequest like the retail Lobby server does, and Chronofoil didn't know what to do. Fixes #113 --- src/bin/kawari-lobby.rs | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/bin/kawari-lobby.rs b/src/bin/kawari-lobby.rs index e7d2a62..2e839a2 100644 --- a/src/bin/kawari-lobby.rs +++ b/src/bin/kawari-lobby.rs @@ -1,5 +1,6 @@ use kawari::RECEIVE_BUFFER_SIZE; use kawari::common::GameData; +use kawari::common::timestamp_secs; use kawari::config::get_config; use kawari::get_supported_expac_versions; use kawari::ipc::kawari::CustomIpcData; @@ -10,6 +11,8 @@ use kawari::ipc::lobby::{ClientLobbyIpcData, ServerLobbyIpcSegment}; use kawari::lobby::LobbyConnection; use kawari::lobby::send_custom_world_packet; use kawari::packet::ConnectionType; +use kawari::packet::PacketSegment; +use kawari::packet::SegmentType; use kawari::packet::oodle::OodleNetwork; use kawari::packet::{PacketState, SegmentData, send_keep_alive}; use std::fs; @@ -195,6 +198,21 @@ async fn main() { selected_service_account: None, }; + // as seen in retail, the server sends a KeepAliveRequest before doing *anything* + // TODO: i think the zone server does this too, but in the wrong order + { + connection + .send_segment(PacketSegment { + segment_type: SegmentType::KeepAliveRequest, + data: SegmentData::KeepAliveRequest { + id: 0xE0037603u32, + timestamp: timestamp_secs(), + }, + ..Default::default() + }) + .await; + } + tokio::spawn(async move { let mut buf = vec![0; RECEIVE_BUFFER_SIZE]; loop { @@ -342,6 +360,9 @@ async fn main() { ) .await } + SegmentData::KeepAliveResponse { .. } => { + // we can throw this away + } _ => { panic!("The server is recieving a response packet!") }