1
Fork 0
mirror of https://github.com/redstrate/Kawari.git synced 2025-07-13 17:07:45 +00:00

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
This commit is contained in:
Joshua Goins 2025-07-11 23:21:18 -04:00
parent e6dfdce38a
commit 781fea1e35

View file

@ -1,5 +1,6 @@
use kawari::RECEIVE_BUFFER_SIZE; use kawari::RECEIVE_BUFFER_SIZE;
use kawari::common::GameData; use kawari::common::GameData;
use kawari::common::timestamp_secs;
use kawari::config::get_config; use kawari::config::get_config;
use kawari::get_supported_expac_versions; use kawari::get_supported_expac_versions;
use kawari::ipc::kawari::CustomIpcData; use kawari::ipc::kawari::CustomIpcData;
@ -10,6 +11,8 @@ use kawari::ipc::lobby::{ClientLobbyIpcData, ServerLobbyIpcSegment};
use kawari::lobby::LobbyConnection; use kawari::lobby::LobbyConnection;
use kawari::lobby::send_custom_world_packet; use kawari::lobby::send_custom_world_packet;
use kawari::packet::ConnectionType; use kawari::packet::ConnectionType;
use kawari::packet::PacketSegment;
use kawari::packet::SegmentType;
use kawari::packet::oodle::OodleNetwork; use kawari::packet::oodle::OodleNetwork;
use kawari::packet::{PacketState, SegmentData, send_keep_alive}; use kawari::packet::{PacketState, SegmentData, send_keep_alive};
use std::fs; use std::fs;
@ -195,6 +198,21 @@ async fn main() {
selected_service_account: None, 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 { tokio::spawn(async move {
let mut buf = vec![0; RECEIVE_BUFFER_SIZE]; let mut buf = vec![0; RECEIVE_BUFFER_SIZE];
loop { loop {
@ -342,6 +360,9 @@ async fn main() {
) )
.await .await
} }
SegmentData::KeepAliveResponse { .. } => {
// we can throw this away
}
_ => { _ => {
panic!("The server is recieving a response packet!") panic!("The server is recieving a response packet!")
} }