fix(mod-loader): support subdir streaming entries (ped head_ ydd/ytd) in mods/ - #4193
Open
chocomintw wants to merge 2 commits into
Open
chocomintw wants to merge 2 commits into
chocomintw wants to merge 2 commits into
Conversation
Local mod and faux_pack assets were being treated as flat paths during startup because the server policy was not available yet. This patch adds a mod-tag helper and passes it through streaming file registration/removal so '^' paths are converted for local mod content even without [subdir_file_mapping]. Debug builds also keep subdir mapping enabled to preserve the expected behavior. Signed-off-by: chocomintw <97966408+chocomintw@users.noreply.github.com>
Add StreamName helper to convert streaming paths (e.g. mp_m_freemode_01/head_000_r.ydd -> mp_m_freemode_01^head_000_r.ydd). Expose subdir streaming entries under "stream/<dir^file>" in ModVFSDevice and register those entries in MountModStream using a modVfs_<guid>:/stream/<dir^file> path so the streaming slot preserves its directory. Also refactor MountModStream logic to always fetch page flags before registering the streaming entry. Signed-off-by: chocomintw <97966408+chocomintw@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Goal of this PR
Make OpenIV-style mod packages in
mods/able to replace ped component files that live in a subdirectory of a streaming rpf — most notablyhead_*.ydd/head_diff_*.ytdinx64v.rpf/models/cdimages/streamedpeds_mp.rpf/mp_m_freemode_01/(andstreamedpeds_players.rpf/player_zero/). Today such entries are silently dropped.How is this PR achieving the goal
The game registers these assets under a directory-prefixed slot name (
mp_m_freemode_01/head_000_r), which is why resourcestream/uses thedir^fileconvention. The mod loader lost that directory at three points:ModVFSDeviceonly mapped entries whose last archive isupdate.rpf, a top-levelx64N.rpf, orcommon.rpf; nested archives fell through.MountModStreamrequiredslashCount == 0, somp_m_freemode_01/head_000_r.yddwas never registered as a streaming file.^→/subdir mapping inLoadStreamingFile.cppis gated on the server policy[subdir_file_mapping], which doesn't exist atOnInitialMount(no server yet).Changes:
GetBaseName()takes anisModflag;mod_/faux_packtags get subdir mapping without the server policy. Resource behaviour is unchanged. SmallIsModTag()helper replaces the inline check.ModVFSDeviceasstream/<dir>^<file>and registered fromMountModStreamasmodVfs_<guid>:/stream/<dir>^<file>, so the streaming slot keeps its directory. Flat entries andtextures/overrides register exactly as before.Not covered: a whole
streamedpeds_*.rpfdropped in as an.rpftarget (MountFauxStreamingRpfis non-recursive, and a packfile can't serve a^name).This PR applies to the following area(s)
FiveM
Successfully tested on
Compiles (Release x64, no new warnings). Not yet tested in-game — will update once verified.
Game builds: ..
Platforms: Windows
Checklist
Fixes issues
None.