feat(natives): Runtime map load / unload#3939
Open
gizzdev wants to merge 1 commit into
Open
Conversation
767788b to
a9c70d1
Compare
|
Yo thats a lot of stuffs |
Author
Yeah 😄 I had same thoughts before posting but it is the very minimal changes needed to achieve the map replacement goal while keeping FiveM streaming mechanics intact. |
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
To introduce the ability to dynamically unload/reload the base GTA map and manage custom streaming sets at runtime. This allows creators to completely clear the default world map (
UNLOAD_MAP) and conditionally load custom, isolated assets or map sets (REQUEST_STREAM_SET) on the fly without requiring a server restart or mandatory global loading.How is this PR achieving the goal
This PR achieves dynamic map and stream set management through several key additions and internal enhancements:
Map Natives (
UNLOAD_MAP,RELOAD_MAP): Introduces anemptymap/dlc.rpfand hooks into the game'sExecuteContentChangeSet/RevertContentChangeSetfunctions.UNLOAD_MAPforces the game to mount the empty map Content Change Set (CCS), effectively removing the base map, whileRELOAD_MAPrestores the defaultGROUP_MAP/GROUP_MAP_SP.Stream Set Natives (
REQUEST_STREAM_SET,RELEASE_STREAM_SET): Allows dynamically mounting and unmounting streamed overlays packaged within resources (defined via thestream_setmetadata).Resource Mounter Upgrades: Adds
UnmountOverlaytoCachedResourceMounterto support safely detaching file sets. Additionally,MountOverlaynow mounts tooverlay:/[overlayName]/[resourceName]/instead of the rootresources:/to prevent VFS conflicts.VFS Enhancements: Adds a recursive
ForEachEntrymethod toVFSRagePackfileto allow iterating over files and directories inside the.rpfarchives.Event & Streaming Exports: Exposes required functions and events (e.g.,
GetCurrentMapGroup,CleanupStreaming,OnLoadContentXML,OnReloadMapStore)EventCore Addition: Adds a
ConnectOncetemplate toEventCore.hfor event listeners that automatically disconnect after their first execution.This PR applies to the following area(s)
FiveM, Client, Natives, GTA5
Successfully tested on
Game builds: 3258, 3570
Platforms: Windows
Checklist
Fixes issues
fxmanifest sample
client sample