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