mirror of
https://github.com/redstrate/Kawari.git
synced 2025-04-21 23:17:45 +00:00
Rename FFXIVOodle to OodleNetwork, move out of a folder
I was thinking I was going to add other modules but it wasn't needed, so it doesn't need to live in a folder.
This commit is contained in:
parent
c34f5d7ea8
commit
a7f56a62a1
5 changed files with 16 additions and 16 deletions
|
@ -4,7 +4,7 @@ use kawari::lobby::ipc::{
|
||||||
CharacterDetails, ClientLobbyIpcData, LobbyCharacterActionKind, ServerLobbyIpcData,
|
CharacterDetails, ClientLobbyIpcData, LobbyCharacterActionKind, ServerLobbyIpcData,
|
||||||
ServerLobbyIpcSegment, ServerLobbyIpcType,
|
ServerLobbyIpcSegment, ServerLobbyIpcType,
|
||||||
};
|
};
|
||||||
use kawari::oodle::FFXIVOodle;
|
use kawari::oodle::OodleNetwork;
|
||||||
use kawari::packet::{PacketSegment, PacketState, SegmentType, send_keep_alive};
|
use kawari::packet::{PacketSegment, PacketState, SegmentType, send_keep_alive};
|
||||||
use kawari::{CONTENT_ID, WORLD_NAME};
|
use kawari::{CONTENT_ID, WORLD_NAME};
|
||||||
use tokio::io::AsyncReadExt;
|
use tokio::io::AsyncReadExt;
|
||||||
|
@ -23,8 +23,8 @@ async fn main() {
|
||||||
|
|
||||||
let state = PacketState {
|
let state = PacketState {
|
||||||
client_key: None,
|
client_key: None,
|
||||||
clientbound_oodle: FFXIVOodle::new(),
|
clientbound_oodle: OodleNetwork::new(),
|
||||||
serverbound_oodle: FFXIVOodle::new(),
|
serverbound_oodle: OodleNetwork::new(),
|
||||||
};
|
};
|
||||||
|
|
||||||
let mut connection = LobbyConnection {
|
let mut connection = LobbyConnection {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
use std::time::{SystemTime, UNIX_EPOCH};
|
use std::time::{SystemTime, UNIX_EPOCH};
|
||||||
|
|
||||||
use kawari::oodle::FFXIVOodle;
|
use kawari::oodle::OodleNetwork;
|
||||||
use kawari::packet::{PacketSegment, PacketState, SegmentType, send_keep_alive};
|
use kawari::packet::{PacketSegment, PacketState, SegmentType, send_keep_alive};
|
||||||
use kawari::world::ipc::{
|
use kawari::world::ipc::{
|
||||||
ClientZoneIpcData, GameMasterCommandType, ServerZoneIpcData, ServerZoneIpcSegment,
|
ClientZoneIpcData, GameMasterCommandType, ServerZoneIpcData, ServerZoneIpcSegment,
|
||||||
|
@ -33,8 +33,8 @@ async fn main() {
|
||||||
|
|
||||||
let state = PacketState {
|
let state = PacketState {
|
||||||
client_key: None,
|
client_key: None,
|
||||||
clientbound_oodle: FFXIVOodle::new(),
|
clientbound_oodle: OodleNetwork::new(),
|
||||||
serverbound_oodle: FFXIVOodle::new(),
|
serverbound_oodle: OodleNetwork::new(),
|
||||||
};
|
};
|
||||||
|
|
||||||
let mut exit_position = None;
|
let mut exit_position = None;
|
||||||
|
|
|
@ -92,15 +92,15 @@ pub fn OodleNetwork1TCP_Encode(
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Default)]
|
#[derive(Debug, Default)]
|
||||||
pub struct FFXIVOodle {
|
pub struct OodleNetwork {
|
||||||
state: Vec<u8>,
|
state: Vec<u8>,
|
||||||
shared: Vec<u8>,
|
shared: Vec<u8>,
|
||||||
#[allow(dead_code)] // unused in rust but required to still be available for low-level oodle
|
#[allow(dead_code)] // unused in rust but required to still be available for low-level oodle
|
||||||
window: Vec<u8>,
|
window: Vec<u8>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl FFXIVOodle {
|
impl OodleNetwork {
|
||||||
pub fn new() -> FFXIVOodle {
|
pub fn new() -> OodleNetwork {
|
||||||
let htbits: i32 = 17;
|
let htbits: i32 = 17;
|
||||||
unsafe {
|
unsafe {
|
||||||
let oodle_state_size: usize = OodleNetwork1TCP_State_Size().try_into().unwrap();
|
let oodle_state_size: usize = OodleNetwork1TCP_State_Size().try_into().unwrap();
|
||||||
|
@ -123,7 +123,7 @@ impl FFXIVOodle {
|
||||||
0,
|
0,
|
||||||
);
|
);
|
||||||
|
|
||||||
FFXIVOodle {
|
OodleNetwork {
|
||||||
state: oodle_state,
|
state: oodle_state,
|
||||||
shared: oodle_shared,
|
shared: oodle_shared,
|
||||||
window: oodle_window,
|
window: oodle_window,
|
|
@ -4,7 +4,7 @@ use std::io::Cursor;
|
||||||
use binrw::{BinRead, BinResult};
|
use binrw::{BinRead, BinResult};
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
oodle::FFXIVOodle,
|
oodle::OodleNetwork,
|
||||||
packet::{PacketHeader, PacketSegment},
|
packet::{PacketHeader, PacketSegment},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@ pub enum CompressionType {
|
||||||
|
|
||||||
#[binrw::parser(reader, endian)]
|
#[binrw::parser(reader, endian)]
|
||||||
pub(crate) fn decompress<T: ReadWriteIpcSegment>(
|
pub(crate) fn decompress<T: ReadWriteIpcSegment>(
|
||||||
oodle: &mut FFXIVOodle,
|
oodle: &mut OodleNetwork,
|
||||||
header: &PacketHeader,
|
header: &PacketHeader,
|
||||||
encryption_key: Option<&[u8]>,
|
encryption_key: Option<&[u8]>,
|
||||||
) -> BinResult<Vec<PacketSegment<T>>> {
|
) -> BinResult<Vec<PacketSegment<T>>> {
|
||||||
|
|
|
@ -7,7 +7,7 @@ use std::{
|
||||||
use binrw::{BinRead, BinWrite, binrw};
|
use binrw::{BinRead, BinWrite, binrw};
|
||||||
use tokio::{io::AsyncWriteExt, net::TcpStream};
|
use tokio::{io::AsyncWriteExt, net::TcpStream};
|
||||||
|
|
||||||
use crate::{common::read_string, oodle::FFXIVOodle, packet::encryption::decrypt};
|
use crate::{common::read_string, oodle::OodleNetwork, packet::encryption::decrypt};
|
||||||
|
|
||||||
use super::{
|
use super::{
|
||||||
CompressionType, compression::decompress, encryption::encrypt, ipc::ReadWriteIpcSegment,
|
CompressionType, compression::decompress, encryption::encrypt, ipc::ReadWriteIpcSegment,
|
||||||
|
@ -117,7 +117,7 @@ impl<T: ReadWriteIpcSegment> PacketSegment<T> {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[binrw]
|
#[binrw]
|
||||||
#[brw(import(oodle: &mut FFXIVOodle, encryption_key: Option<&[u8]>))]
|
#[brw(import(oodle: &mut OodleNetwork, encryption_key: Option<&[u8]>))]
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
struct Packet<T: ReadWriteIpcSegment> {
|
struct Packet<T: ReadWriteIpcSegment> {
|
||||||
header: PacketHeader,
|
header: PacketHeader,
|
||||||
|
@ -199,8 +199,8 @@ pub async fn send_packet<T: ReadWriteIpcSegment>(
|
||||||
/// State needed for each connection between the client & server, containing various things like the compressor and encryption keys.
|
/// State needed for each connection between the client & server, containing various things like the compressor and encryption keys.
|
||||||
pub struct PacketState {
|
pub struct PacketState {
|
||||||
pub client_key: Option<[u8; 16]>,
|
pub client_key: Option<[u8; 16]>,
|
||||||
pub serverbound_oodle: FFXIVOodle,
|
pub serverbound_oodle: OodleNetwork,
|
||||||
pub clientbound_oodle: FFXIVOodle,
|
pub clientbound_oodle: OodleNetwork,
|
||||||
}
|
}
|
||||||
|
|
||||||
pub async fn parse_packet<T: ReadWriteIpcSegment>(
|
pub async fn parse_packet<T: ReadWriteIpcSegment>(
|
||||||
|
|
Loading…
Add table
Reference in a new issue