GantryMods
The pure steps of mod mounting, separated so they can be tested without mounting anything.
Members
MountOrderBase
int32
Pak order of the shallowest mod unit.
Above the base game's and its patches' paks.
GameProvider
const TCHAR*
The provider name collisions use for the game's own content and config.
ArchiveExtension
const TCHAR*
File extension of a single-file mod: an uncompressed zip of a mod unit's folder.
ArchiveStampName
const TCHAR*
The file in a folder unpacked from a .gantry that records which archive it came from.
EffectivePakOrder
int32
The order the pak layer really mounts a pak at: the order asked for, plus 100 x (n + 1) for a patch-named pak ("_P", or "_n_P"), as the engine does.
PakPath:The pak's path or file name.
Order:The order asked for.
Returns: The order it mounts at.
IsBetweenMods
bool
Whether a collision is between mods: two or more mod units among its providers, whether or not the game is one too.
One mod against the game (replacing the game's own) is not.
Collision:A collision.
Returns: True when mods disagree.
JudgeUnit
FString
Why a found unit must not be mounted, before anything of it is: not Explicitly Loaded, code this game cannot load, or a name another plugin or content root already has.
Unit:A unit DiscoverUnits returned.
bCanLoadCode:Whether this game can load code modules from a plugin (not monolithic).
ClashingPath:Where a plugin or content root of the same name lives; empty when none.
Returns: The reason, for the unit's Error; empty when it may be mounted.
ReadIni
void
Reads an ini file's text the way a conflict check needs it: the keys it sets, and the old names of the redirects it adds ([CoreRedirects] entries' OldName).
Text:The file's contents.
Branch:The file's branch, copied into each set.
OutSets:Appended with the keys set.
OutRedirects:Appended with each redirect's old name.
DiscoverUnits
TArray< FGantryModUnit >
Finds mod units: each immediate subfolder of a directory that holds exactly one .uplugin.
Directories:Absolute folders to search.
OutProblems:Appended with a line per folder that could not be read as a unit, and per name used twice (a name a Known unit has stays with it; otherwise the first by path order is kept).
Known:Units an earlier pass found, which keep their names.
Returns: The units, in path order, with Name, DescriptorPath, CodeModules, bExplicitlyLoaded and ModDependencies filled in. ModDependencies holds every plugin dependency; OrderUnits narrows it to mod units.
UnpackArchives
int32
Unpacks every .gantry file directly inside Directories into a folder of the same name beside it, so it is found and mounted like any mod folder; and removes folders that came from an archive no longer there (unless named in Skip).
Beside the archive is where the unit's paks expect to be: they are cooked against the folder <mod directory>/<name>/. A folder already unpacked from the same archive (stamped with its size and time) is left alone; Skip names archives (by file name, which is the unit's name) not to touch at all, such as units already mounted. Folders that did not come from an archive are never touched.
A .gantry file is a zip whose entries are stored, not compressed (the paks inside are compressed already): the unit's .uplugin, Config/ and Content/Paks/(platform)/.
Directories:Absolute folders to search.
Skip:Unit names to leave alone.
OutProblems:Appended with a line per archive that could not be unpacked.
Returns: How many archives were unpacked this call.
ExtractStoredZip
bool
Extracts a zip of stored (uncompressed) entries into Destination.
Refuses compressed entries, streamed entries (sizes after the data), ZIP64, and any path that is absolute or climbs out of Destination.
Archive:Absolute path of the zip.
Destination:Absolute folder to extract into; created as needed.
OutError:Why it failed; empty on success.
Returns: True when every entry was written.
DirectorySignature
FString
A summary of what the mod directories hold: each unit folder and each .gantry file, with its size and time.
Cheap, for noticing that something was added or replaced.
Directories:Absolute folders to look at.
Returns: A string that changes whenever their contents do.
FolderStamp
FString
A summary of one unit folder's files (each with its size and time; Saved/ left out), for noticing that a unit that failed has been changed since.
Folder:The unit's folder.
Returns: A string that changes whenever its files do.
HashConfig
FString
Hashes a unit's config files (Config/, every .ini, by relative path; line endings ignored, so a checkout on Windows hashes as one on Linux does).
Folder:The unit's folder.
Returns: 16 hex digits; the hash of nothing when it has no config.
CombineContentId
FString
A unit's content id: its content hash and config hash, combined.
ContentHash:What its game feature data records (or the editor computes); may be empty.
ConfigHash:HashConfig of its folder.
Returns: 16 hex digits.
OrderUnits
void
Computes each unit's depth from its dependencies on other units, then orders the units shallow to deep (name breaks ties) and assigns mount orders from MountOrderBase up.
Dependencies that are not units (engine or game plugins) are dropped from ModDependencies. Units in a dependency cycle are removed, with a problem line naming the cycle's members.
Units:Units to order, in place.
OutProblems:Appended with a line per cycle.
FindCollisions
TArray< FGantryModCollision >
Every asset provided by more than one unit, or by a unit and the game, and which one wins: the highest pak order (the game's content is below every mod).
Packages compare by id, loose container files by path. Ties go to the later unit, as the package store resolves them.
Units:Units with ProvidedFiles, ProvidedPackages, GameOverrides, PakOrders and MountOrder filled in, in mount order.
Returns: The collisions (Kind Asset), sorted by path.