mirror of
https://github.com/redstrate/Physis.git
synced 2025-04-21 20:27:46 +00:00
Remove Index Add/Delete commands, intentionally NOP some ops
This commit is contained in:
parent
c0ea846d6f
commit
263f18a544
1 changed files with 3 additions and 35 deletions
38
src/patch.rs
38
src/patch.rs
|
@ -137,41 +137,12 @@ enum SqpkOperation {
|
||||||
FileOperation(SqpkFileOperationData),
|
FileOperation(SqpkFileOperationData),
|
||||||
#[br(magic = b'H')]
|
#[br(magic = b'H')]
|
||||||
HeaderUpdate(SqpkHeaderUpdateData),
|
HeaderUpdate(SqpkHeaderUpdateData),
|
||||||
#[br(magic = b'I')]
|
|
||||||
IndexAddDelete(SqpkIndexData),
|
|
||||||
#[br(magic = b'X')]
|
#[br(magic = b'X')]
|
||||||
PatchInfo(SqpkPatchInfo),
|
PatchInfo(SqpkPatchInfo),
|
||||||
#[br(magic = b'T')]
|
#[br(magic = b'T')]
|
||||||
TargetInfo(SqpkTargetInfo),
|
TargetInfo(SqpkTargetInfo),
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(BinRead, PartialEq, Debug)]
|
|
||||||
enum SqpkIndexCommand {
|
|
||||||
#[br(magic = b'A')]
|
|
||||||
Add,
|
|
||||||
#[br(magic = b'D')]
|
|
||||||
Delete,
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(BinRead, PartialEq, Debug)]
|
|
||||||
#[br(big)]
|
|
||||||
struct SqpkIndexData {
|
|
||||||
command: SqpkIndexCommand,
|
|
||||||
|
|
||||||
#[br(map = | x: u8 | x != 0)]
|
|
||||||
#[br(pad_after = 1)]
|
|
||||||
is_synonym: bool,
|
|
||||||
|
|
||||||
main_id: u16,
|
|
||||||
sub_id: u16,
|
|
||||||
file_id: u32,
|
|
||||||
|
|
||||||
file_hash: u64,
|
|
||||||
|
|
||||||
block_offset: u32,
|
|
||||||
block_number: u32,
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(BinRead, PartialEq, Debug)]
|
#[derive(BinRead, PartialEq, Debug)]
|
||||||
struct SqpkPatchInfo {
|
struct SqpkPatchInfo {
|
||||||
status: u8,
|
status: u8,
|
||||||
|
@ -578,11 +549,8 @@ pub fn apply_patch(data_dir: &str, patch_path: &str) -> Result<(), PatchError> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
SqpkOperation::IndexAddDelete(_) => {
|
|
||||||
println!("PATCH: NOP IndexAddDelete");
|
|
||||||
},
|
|
||||||
SqpkOperation::PatchInfo(_) => {
|
SqpkOperation::PatchInfo(_) => {
|
||||||
println!("PATCH: NOP PatchInfo");
|
// Currently, there's nothing we need from PatchInfo. Intentional NOP.
|
||||||
}
|
}
|
||||||
SqpkOperation::TargetInfo(new_target_info) => {
|
SqpkOperation::TargetInfo(new_target_info) => {
|
||||||
target_info = Some(new_target_info);
|
target_info = Some(new_target_info);
|
||||||
|
@ -590,10 +558,10 @@ pub fn apply_patch(data_dir: &str, patch_path: &str) -> Result<(), PatchError> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ChunkType::FileHeader(_) => {
|
ChunkType::FileHeader(_) => {
|
||||||
println!("PATCH: NOP FileHeader");
|
// Currently there's nothing very useful in the FileHeader, so it's an intentional NOP.
|
||||||
}
|
}
|
||||||
ChunkType::ApplyOption(_) => {
|
ChunkType::ApplyOption(_) => {
|
||||||
println!("PATCH: NOP ApplyOption");
|
// Currently, IgnoreMissing and IgnoreOldMismatch is not used in XIVQuickLauncher either. This stays as an intentional NOP.
|
||||||
}
|
}
|
||||||
ChunkType::AddDirectory(_) => {
|
ChunkType::AddDirectory(_) => {
|
||||||
println!("PATCH: NOP AddDirectory");
|
println!("PATCH: NOP AddDirectory");
|
||||||
|
|
Loading…
Add table
Reference in a new issue