[Bug] io.readdir("@resource/subdirectory") no longer enumerates unreferenced resource files on Enhanced Cfx Server #277
Closed
xalva98
started this conversation in
[BUG] FiveM for GTAV Enhanced
Replies: 3 comments 5 replies
|
Same issue as bug 207 |
0 replies
|
Is this still a thing with build 98? I wanna make sure its setup depending, because I can not reproduce it locally. |
3 replies
|
A fix for this bug has been implemented and is available in the August 4 patch. Please try again and let us know if the issue persists. Thanks for your help! |
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Summary
io.readdir("@resource/subdirectory")no longer enumerates files inside a resource correctly on the Enhanced Cfx Server.This is a regression from legacy FXServer behavior.
A resource can contain a directory which is intentionally not declared in
files {}or another manifest entry. On legacy FXServer, that directory is still part of the resource's server-side VFS mount and can be enumerated usingio.readdir("@resource/...").On Enhanced, the same code returns no files, breaking resources which use the server-side resource VFS to discover files dynamically.
Issue type
Server
Repro rate
Always
Server build version
b96-ea
OS
No response
CPU
No response
GPU
No response
RAM
No response
Storage type
None
Connection type
None
ISP and bandwidth
No response
DxDiag
No response
Network graph
No response
Platform
None
OS version / distribution
No response
CPU
No response
RAM
No response
Using txAdmin?
None
Hosting provider
None
Machine type
None
/perf endpoint output
No response
DDoS protection
No response
ulimit -n value (Linux only)
No response
Docker Compose file (Docker only)
No response
Steps to Reproduce
Create the following minimal resource:
fxmanifest.lua:clientloader/test.lua:The
clientloaderdirectory is intentionally not declared in the resource manifest.server.lua:Start the resource:
Run the exact same resource once on legacy FXServer and once on Enhanced Cfx Server.
Expected Behavior
The server-side resource VFS should expose the contents of the physical resource directory.
io.readdir("@readdir_repro/clientloader")should enumerate:Expected output:
This is how the same code behaves on legacy FXServer.
Files should not need to be declared in
files {}merely for server-side filesystem enumeration of the resource's own directory.Actual Behavior
On Enhanced Cfx Server, the directory does not enumerate its contents.
The original affected resource consequently reports:
and later:
The relevant code is simply:
The same resource and directory layout works on legacy FXServer.
Evidence
This is a regression from the legacy server resource VFS behavior.
The public FXServer implementation mounts the complete physical resource directory under
@resource/, rather than only files referenced by the manifest:Source:
https://github.com/citizenfx/fivem/blob/ba45c32ba5782c784feb939fdf921961b00d9c3f/code/components/citizen-server-impl/src/ServerResources.cpp#L233-L240
The Lua implementation of
io.readdirthen resolves the VFS device and enumerates it usingFindFirst/FindNext.Source:
https://github.com/citizenfx/fivem/blob/ba45c32ba5782c784feb939fdf921961b00d9c3f/code/components/citizen-scripting-lua/src/LuaIO.cpp
Therefore, on legacy FXServer:
On Enhanced b96-ea, the same resource layout/code no longer produces the directory entries.
This matters specifically for server-side resources which dynamically discover files without declaring those files for client download in the manifest.
Additional Context
The original resource uses this behavior to discover Lua files dynamically:
The relevant original manifest is:
clientloader/is deliberately not part offiles {}because these files are discovered and handled server-side rather than being distributed as ordinary resource files.This worked with legacy FXServer and stopped working when moving the same resource to Enhanced Cfx Server.
All reactions