citizenfx / fivem

The source code for the Cfx.re modification frameworks, such as FiveM, RedM and LibertyM, as well as FXServer.
https://cfx.re/
3.56k stars 2.1k forks source link

FiveM server load resources incorrectly #1513

Open pp2amd6 opened 2 years ago

pp2amd6 commented 2 years ago

Hi all!

I have a problem with two resources and am stuck.

I have a lot of resources, but the problem is only with those that replace the standard resources.

The first problematic resource replaces the taxi car. The second problematic resource replaces the gun (weapon_pistol).

Taxi resource

Resource content:

.
│ fxmanifest.lua
│
└───stream
         taxi.yft
         taxi.ytd
         taxi_hi.yft

fxmanifest.lua:

fx_version 'cerulean'
game 'gta5'

On the local server, the resource loads and works without problems (the car with the replaced model will be spawned), but on production, the car with the standard model is loaded.

Resources with cars are in directories as categories:

.
├───[civil]
│   ├───[commercial]
│   │   ├───newsvan
│   │   │   └───stream
│   │   ├───newsvan2
│   │   │   └───stream
│   │   └───taxi
│   │       └───stream
│   ├───[helicopters]
│   │   └───newsmav
│   │       └───stream
│   ├───[muscle]
│   │   ├───idaho
│   │   │   └───stream
│   │   └───picadorl
│   │       └───stream
│   ├───[offroad]
│   │   ├───dloader2
│   │   │   └───stream
│   │   └───rsadlers
│   │       └───stream
│   ├───[sedans]
│   │   ├───admiral3
│   │   │   └───stream
│   │   ├───esperanto
│   │   │   └───stream
│   │   ├───greenwood
│   │   │   └───stream
│   │   ├───greenwoodc
│   │   │   └───stream
│   │   ├───merit2
│   │   │   └───stream
│   │   ├───regina4
│   │   │   └───stream
│   │   ├───tahoma
│   │   │   └───stream
│   │   ├───torrence
│   │   │   ├───audioconfig
│   │   │   └───stream
│   │   └───victor
│   │       └───stream
│   ├───[service]
│   ├───[sport]
│   │   └───feltzer9
│   │       └───stream
│   ├───[suv]
│   │   ├───granger2
│   │   │   └───stream
│   │   ├───hellion2
│   │   │   └───stream
│   │   └───scout
│   │       └───stream
│   ├───[utility]
│   │   └───sandkingut3
│   │       └───stream
│   └───[vans]
│       ├───journey2
│       │   └───stream
│       ├───nspeedo
│       │   └───stream
│       └───vapidrv
│           └───stream
├───[coroner]
│   └───dw_coroner
│       └───stream
├───[ems]
│   ├───aemsv450
│   │   └───stream
│   ├───ambuair
│   │   └───stream
│   ├───ambucara
│   │   ├───audioconfig
│   │   └───stream
│   ├───dw_ambulance2
│   │   └───stream
│   ├───dw_emscar
│   │   └───stream
│   ├───emsnspeedo
│   │   └───stream
│   └───iak_wheelchair
│       ├───data
│       └───stream
├───[goverment]
│   ├───dw_pressuv
│   │   └───stream
│   ├───halfback
│   │   └───stream
│   ├───idcar
│   │   └───stream
│   └───roadrunner
│       └───stream
├───[leo-common]
│   ├───mocpacker
│   │   └───stream
│   ├───pigeonp
│   │   ├───audioconfig
│   │   ├───sfx
│   │   │   └───dlc_pigeonp
│   │   └───stream
│   ├───policeair
│   │   └───stream
│   ├───policeRobot
│   │   └───stream
│   ├───polthrust
│   │   ├───audioconfig
│   │   └───stream
│   ├───sahp2stx
│   │   └───stream
│   ├───vvpi
│   │   └───stream
│   └───vvpi2
│       └───stream
├───[lsfd]
│   ├───ambulance2
│   │   ├───audioconfig
│   │   └───stream
│   ├───bcfdbat
│   │   ├───audioconfig
│   │   └───stream
│   ├───firetruk
│   │   └───stream
│   ├───lsfdcmd
│   │   ├───audioconfig
│   │   └───stream
│   ├───lsfdscout
│   │   ├───audioconfig
│   │   └───stream
│   ├───lsfdtruck3
│   │   └───stream
│   └───mtl_rescue
│       └───stream
├───[lspd]
│   ├───dw_polscoutk9
│   │   └───stream
│   ├───dw_pscout
│   │   ├───audioconfig
│   │   └───stream
│   ├───nscoutlspd
│   │   ├───audioconfig
│   │   └───stream
│   ├───pbus_lspd
│   │   └───stream
│   ├───police3a
│   │   └───stream
│   ├───polraiden
│   │   ├───audioconfig
│   │   └───stream
│   └───polspeedo
│       ├───audioconfig
│       └───stream
├───[lssd]
│   ├───dw_sheriffrumpo
│   │   └───stream
│   ├───lssdalamo
│   │   └───stream
│   ├───nscoutlssd
│   │   ├───audioconfig
│   │   └───stream
│   ├───pbus
│   │   └───stream
│   ├───sheriffenduro
│   │   └───stream
│   ├───sheriffscoutold
│   │   ├───audioconfig
│   │   └───stream
│   └───sheriffstalker
│       ├───audioconfig
│       └───stream
├───[swat]
│   └───centurion
│       ├───data
│       └───stream
└───[unmarked]
    ├───cbuffalo5
    │   ├───audioconfig
    │   └───stream
    ├───umkalamo
    │   └───stream
    └───umkscout
        ├───audioconfig
        └───stream

Weapon resource

There is also a weapon resource. I am replacing the w_pi_pistol model and weaponcomponents.meta which changes ammo count from 12 to 17. On the local server, I have a model and a modified file loaded, there are 17 rounds in the gun. On the local server, I have a model loaded, but the modified file does not work, there are 12 rounds in the gun.

Resource content:

.
│   fxmanifest.lua
│   weaponcomponents.meta
│
└───stream
        w_pi_pistol+hi.ytd
        w_pi_pistol.ydr
        w_pi_pistol.ytd
        w_pi_pistol_hi.ydr
        w_pi_pistol_mag1.ydr
        w_pi_pistol_mag1.ytd
        w_pi_pistol_mag2.ydr
        w_pi_pistol_mag2.ytd

fxmanifest.lua content:

fx_version 'cerulean'
game 'gta5'

files {
    'weaponcomponents.meta'
}

data_file 'WEAPONCOMPONENTSINFO_FILE' 'weaponcomponents.meta'

Resources with weapons are in directories as categories:

.
├───weapon_batteringram
│   └───stream
├───weapon_combatpistol
│   └───stream
├───weapon_heavypistol
│   ├───metas
│   └───stream
├───weapon_lesslethal
│   └───stream
├───weapon_nightstick
│   └───stream
├───weapon_pistol
│   └───stream
├───weapon_pumpshotgun
│   └───stream
└───weapon_stungun
    └───stream

What I did?

I cleared the client’s cache, the cache on both servers, but the problem remained. I changed the game version to 2545, but it had no effect. I changed the server versions to earlier ones, but this had no effect.

The weapon and car resource worked on the production server before the transition to build 2612 and the server FX build update, but I can’t confirm that.

Servers

Production server:

Local server:

How to reproduce?

I don't know how to reproduce this behavior. The local server and the production server differ in the number of resources included and the included Onesync infinity.

I turned off a large number of resources - interiors, clothes, framework, weapons and other cars, so that the number was about the same as on the local server, but this did not help.

Temporary solution to the problem

Resources start to work correctly if placed in the root of the resource directory - the car will be replaced, and the weapon will have 17 rounds.

weapon_pistol.zip taxi.zip

gottfriedleibniz commented 8 months ago

Weapon resource

Unfortunately the game does not allow overriding/replacing existing CWeaponComponent* entries using this method. Internally the game will store both the old and new entries and the component referenced by the game will be inconsistent and dependent upon other factors (e.g., how many components are loaded).

A long-term solution here could be to research whether it is possible to create a pseudo WEAPONCOMPONENTSINFO_FILE_PATCH manifest entry to allow overriding components of the same name and type. In the meantime it may be possible to use WEAPONINFO_FILE_PATCH to override the AttachPoints to have them reference custom components. Others tend to just re-stream everything.

Taxi resource

Is this still an issue you are experiencing?

pp2amd6 commented 8 months ago

Is this still an issue you are experiencing?

Unfortunately I cannot say whether the problem remains in the current stable version. I'll check it later and let you know.

Regarding the version that I wrote about earlier: I solved the problem, but in a not entirely obvious way. The new taxi model was loaded on the production server only when I placed the resource in the root of the "resources" directory.

BugCode1 commented 5 months ago

Is there no plan to solve this issue?