mirror of
https://github.com/redstrate/Kawari.git
synced 2025-04-25 16:27:46 +00:00
Remove leftover bits of debugging logging
This commit is contained in:
parent
a021abc3c7
commit
3140dad378
8 changed files with 3 additions and 34 deletions
|
@ -148,7 +148,6 @@ async fn main() {
|
||||||
|
|
||||||
let chara_make =
|
let chara_make =
|
||||||
CharaMake::from_json(&character_action.json);
|
CharaMake::from_json(&character_action.json);
|
||||||
println!("charamake: {:#?}", chara_make);
|
|
||||||
|
|
||||||
// a slightly different character created packet now
|
// a slightly different character created packet now
|
||||||
{
|
{
|
||||||
|
|
|
@ -58,7 +58,6 @@ async fn main() {
|
||||||
.expect("Failed to read data!");
|
.expect("Failed to read data!");
|
||||||
|
|
||||||
if n != 0 {
|
if n != 0 {
|
||||||
println!("recieved {n} bytes...");
|
|
||||||
let (segments, connection_type) = connection.parse_packet(&buf[..n]).await;
|
let (segments, connection_type) = connection.parse_packet(&buf[..n]).await;
|
||||||
for segment in &segments {
|
for segment in &segments {
|
||||||
match &segment.segment_type {
|
match &segment.segment_type {
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
use binrw::binrw;
|
use binrw::binrw;
|
||||||
use std::fs::write;
|
|
||||||
use std::io::Cursor;
|
use std::io::Cursor;
|
||||||
|
|
||||||
use binrw::{BinRead, BinResult};
|
use binrw::{BinRead, BinResult};
|
||||||
|
@ -29,16 +28,9 @@ pub(crate) fn decompress<T: IpcSegmentTrait>(
|
||||||
|
|
||||||
let size = header.size as usize - std::mem::size_of::<PacketHeader>();
|
let size = header.size as usize - std::mem::size_of::<PacketHeader>();
|
||||||
|
|
||||||
println!(
|
|
||||||
"known packet size: {} but decompressing {} bytes",
|
|
||||||
header.size, size
|
|
||||||
);
|
|
||||||
|
|
||||||
let mut data = vec![0; size];
|
let mut data = vec![0; size];
|
||||||
reader.read_exact(&mut data).unwrap();
|
reader.read_exact(&mut data).unwrap();
|
||||||
|
|
||||||
write("compressed.bin", &data).unwrap();
|
|
||||||
|
|
||||||
let data = match header.compression_type {
|
let data = match header.compression_type {
|
||||||
crate::packet::CompressionType::Uncompressed => data,
|
crate::packet::CompressionType::Uncompressed => data,
|
||||||
crate::packet::CompressionType::Oodle => oodle.decode(data, header.uncompressed_size),
|
crate::packet::CompressionType::Oodle => oodle.decode(data, header.uncompressed_size),
|
||||||
|
@ -52,8 +44,6 @@ pub(crate) fn decompress<T: IpcSegmentTrait>(
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
write("decompressed.bin", &data).unwrap();
|
|
||||||
|
|
||||||
let mut cursor = Cursor::new(&data);
|
let mut cursor = Cursor::new(&data);
|
||||||
|
|
||||||
for _ in 0..header.segment_count {
|
for _ in 0..header.segment_count {
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
use std::fs::write;
|
|
||||||
use std::io::Cursor;
|
use std::io::Cursor;
|
||||||
|
|
||||||
use binrw::BinResult;
|
use binrw::BinResult;
|
||||||
|
@ -33,8 +32,6 @@ pub(crate) fn decrypt<T: IpcSegmentTrait>(
|
||||||
let blowfish = Blowfish::new(encryption_key);
|
let blowfish = Blowfish::new(encryption_key);
|
||||||
blowfish.decrypt(&mut data);
|
blowfish.decrypt(&mut data);
|
||||||
|
|
||||||
write("decrypted.bin", &data).unwrap();
|
|
||||||
|
|
||||||
let mut cursor = Cursor::new(&data);
|
let mut cursor = Cursor::new(&data);
|
||||||
T::read_options(&mut cursor, endian, ())
|
T::read_options(&mut cursor, endian, ())
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -19,12 +19,9 @@ where
|
||||||
{
|
{
|
||||||
pub unk1: u8,
|
pub unk1: u8,
|
||||||
pub unk2: u8,
|
pub unk2: u8,
|
||||||
#[br(dbg)]
|
|
||||||
pub op_code: OpCode,
|
pub op_code: OpCode,
|
||||||
#[brw(pad_before = 2)] // empty
|
#[brw(pad_before = 2)] // empty
|
||||||
#[br(dbg)]
|
|
||||||
pub server_id: u16,
|
pub server_id: u16,
|
||||||
#[br(dbg)]
|
|
||||||
pub timestamp: u32,
|
pub timestamp: u32,
|
||||||
#[brw(pad_before = 4)]
|
#[brw(pad_before = 4)]
|
||||||
#[br(args(&op_code))]
|
#[br(args(&op_code))]
|
||||||
|
|
|
@ -91,14 +91,10 @@ pub struct PacketHeader {
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
pub struct PacketSegment<T: IpcSegmentTrait> {
|
pub struct PacketSegment<T: IpcSegmentTrait> {
|
||||||
#[bw(calc = self.calc_size())]
|
#[bw(calc = self.calc_size())]
|
||||||
#[br(dbg)]
|
|
||||||
pub size: u32,
|
pub size: u32,
|
||||||
#[br(dbg)]
|
|
||||||
pub source_actor: u32,
|
pub source_actor: u32,
|
||||||
#[br(dbg)]
|
|
||||||
pub target_actor: u32,
|
pub target_actor: u32,
|
||||||
#[brw(args(size, encryption_key))]
|
#[brw(args(size, encryption_key))]
|
||||||
#[br(dbg)]
|
|
||||||
pub segment_type: SegmentType<T>,
|
pub segment_type: SegmentType<T>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -122,11 +118,9 @@ impl<T: IpcSegmentTrait> PacketSegment<T> {
|
||||||
#[brw(import(oodle: &mut FFXIVOodle, encryption_key: Option<&[u8]>))]
|
#[brw(import(oodle: &mut FFXIVOodle, encryption_key: Option<&[u8]>))]
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
struct Packet<T: IpcSegmentTrait> {
|
struct Packet<T: IpcSegmentTrait> {
|
||||||
#[br(dbg)]
|
|
||||||
header: PacketHeader,
|
header: PacketHeader,
|
||||||
#[bw(args(encryption_key))]
|
#[bw(args(encryption_key))]
|
||||||
#[br(parse_with = decompress, args(oodle, &header, encryption_key,))]
|
#[br(parse_with = decompress, args(oodle, &header, encryption_key,))]
|
||||||
#[br(dbg)]
|
|
||||||
segments: Vec<PacketSegment<T>>,
|
segments: Vec<PacketSegment<T>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -220,12 +214,9 @@ pub async fn parse_packet<T: IpcSegmentTrait>(
|
||||||
state.client_key.as_ref().map(|s: &[u8; 16]| s.as_slice()),
|
state.client_key.as_ref().map(|s: &[u8; 16]| s.as_slice()),
|
||||||
),
|
),
|
||||||
) {
|
) {
|
||||||
Ok(packet) => {
|
Ok(packet) => (packet.segments, packet.header.connection_type),
|
||||||
println!("{:#?}", packet);
|
|
||||||
(packet.segments, packet.header.connection_type)
|
|
||||||
}
|
|
||||||
Err(err) => {
|
Err(err) => {
|
||||||
println!("{err}");
|
tracing::error!("{err}");
|
||||||
dump("Failed to parse packet!", data);
|
dump("Failed to parse packet!", data);
|
||||||
|
|
||||||
(Vec::new(), ConnectionType::None)
|
(Vec::new(), ConnectionType::None)
|
||||||
|
|
|
@ -32,7 +32,7 @@ impl ChatHandler {
|
||||||
.await;
|
.await;
|
||||||
}
|
}
|
||||||
"!spawnactor" => {
|
"!spawnactor" => {
|
||||||
println!("Spawning actor...");
|
tracing::info!("Spawning actor...");
|
||||||
|
|
||||||
// send player spawn
|
// send player spawn
|
||||||
{
|
{
|
||||||
|
|
|
@ -300,7 +300,6 @@ pub enum ClientZoneIpcData {
|
||||||
#[br(pre_assert(*magic == ClientZoneIpcType::InitRequest))]
|
#[br(pre_assert(*magic == ClientZoneIpcType::InitRequest))]
|
||||||
InitRequest {
|
InitRequest {
|
||||||
// TODO: full of possibly interesting information
|
// TODO: full of possibly interesting information
|
||||||
#[br(dbg)]
|
|
||||||
unk: [u8; 105],
|
unk: [u8; 105],
|
||||||
},
|
},
|
||||||
#[br(pre_assert(*magic == ClientZoneIpcType::FinishLoading))]
|
#[br(pre_assert(*magic == ClientZoneIpcType::FinishLoading))]
|
||||||
|
@ -371,7 +370,6 @@ pub enum ClientZoneIpcData {
|
||||||
command: GameMasterCommandType,
|
command: GameMasterCommandType,
|
||||||
#[br(pad_before = 3)] // idk, not empty though
|
#[br(pad_before = 3)] // idk, not empty though
|
||||||
arg: u32,
|
arg: u32,
|
||||||
#[br(dbg)]
|
|
||||||
unk: [u8; 24],
|
unk: [u8; 24],
|
||||||
},
|
},
|
||||||
#[br(pre_assert(*magic == ClientZoneIpcType::Unk12))]
|
#[br(pre_assert(*magic == ClientZoneIpcType::Unk12))]
|
||||||
|
@ -387,12 +385,10 @@ pub enum ClientZoneIpcData {
|
||||||
},
|
},
|
||||||
#[br(pre_assert(*magic == ClientZoneIpcType::Unk13))]
|
#[br(pre_assert(*magic == ClientZoneIpcType::Unk13))]
|
||||||
Unk13 {
|
Unk13 {
|
||||||
#[br(dbg)]
|
|
||||||
unk: [u8; 16], // TODO: unknown
|
unk: [u8; 16], // TODO: unknown
|
||||||
},
|
},
|
||||||
#[br(pre_assert(*magic == ClientZoneIpcType::Unk14))]
|
#[br(pre_assert(*magic == ClientZoneIpcType::Unk14))]
|
||||||
Unk14 {
|
Unk14 {
|
||||||
#[br(dbg)]
|
|
||||||
unk: [u8; 8], // TODO: unknown
|
unk: [u8; 8], // TODO: unknown
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue