- Client (production/canary) and FXServer version
Client=Canary, FXServer= 3539 - What you expected to happen
Each registered asset gets cached based on the URL. - What actually happens
Only a single asset, ResourceCacheEntryList::Entry, can be cached, each consecutive RequestStreamingFileFromUrl request replaces the existing entry one with the new one.
When actually streaming, loading from a ymap or using RegisterArchetypes(…) followed by RequestModel(…), the previous asset entries will be using the latest entry. This causes issues when, for example, first requesting a .ydr file followed by a request for a .ytd because now the drawable will be using the texture dictionary data resulting in a crash.
- Category of bug (eg. client, server, weapons, peds, native)
native - Reproducible steps, preferably with example script(s)
For this code to work you would also need the backend providing the files, can also post this if needed (multiple different file names / urls were used to make sure that there wasn’t any accidental hash collisions)
RegisterCommand("downloadEmpty", function(source, args, rawCommand)
RegisterStreamingFileFromUrl("testobject02.ydr", "http://localhost:3000?hellomaybeornot=somerandomvalue");
while not IsStreamingFileReady("testobject02.ydr") do
Wait(100)
end
RegisterStreamingFileFromUrl("makingsurenameisnothashedandcollided.ytd", "http://localhost:3000/ytd?thisisatest6542");
while not IsStreamingFileReady("makingsurenameisnothashedandcollided.ytd") do
Wait(100)
end
end, false)
I assume this bug might be because of the referenceHash not being filled in by the ResourceCacheDevice. fivem/RuntimeAssetNatives.cpp at master · citizenfx/fivem · GitHub
Probably because of the change to ResourceCacheDeviceV2, the old version of ResourceCacheDevice did check when “referenceHash” was empty and used the “remoteUrl” instead.
Proof that V2 is being used:
Old version: fivem/ResourceCacheDevice.cpp at master · citizenfx/fivem · GitHub
New version V2: fivem/ResourceCacheDeviceV2.cpp at master · citizenfx/fivem · GitHub