Class Patcher
- Namespace
- FishMMO.Patcher
- Assembly
- Updater.dll
Applies binary patch data generated by the PatchGenerator to a target file. It reads patch metadata from a BinaryReader and reconstructs the new file by combining parts of the original file with new data from the patch. This class focuses on creating the patched temporary file; file deletion and move operations are handled externally.
public class Patcher
- Inheritance
-
Patcher
- Inherited Members
Methods
Apply(BinaryReader, string, long, string)
Applies a binary patch from a BinaryReader to a target file, creating a new temporary file with the patched content. The responsibility for replacing the original file and cleanup of the temporary file (by moving it) is left to the caller.
public string Apply(BinaryReader reader, string targetFilePath, long finalFileSize, string tempPatchedFilePath)
Parameters
readerBinaryReaderBinaryReader positioned at the start of the patch data for this file. It is expected that the reader will be fully consumed by this method.
targetFilePathstringThe full path to the file to be patched (the "old" file). This file is only read from; it is not modified or deleted by this method.
finalFileSizelongThe expected final size of the file after patching, used for truncation.
tempPatchedFilePathstringThe pre-generated unique path for the temporary patched file.
Returns
- string
The full path to the newly created temporary patched file on success; otherwise, null.