overextended / ox_inventory

Slot-based inventory with metadata.
https://overextended.dev/ox_inventory
GNU General Public License v3.0
419 stars 640 forks source link

ndcore - inventory money not syncing in inventory anymore unless someone relogs #1546

Open Legacy-TacticalGamingInteractive opened 7 months ago

Legacy-TacticalGamingInteractive commented 7 months ago

Using nd_core framework and ox_inventory v2.36.1.

When we withdraw/deposit money it updates in our hud (SimpleHUD) on the ND side, which is what we use in conjunction with Ox Inventory.

The only way that we can get the money in the inventory to sync is if the person leaves and rejoins the server. As if it cannot sync in real time.

This prevents people from buying or using the inventory really at all. As it keeps telling them that they dont have enough cash to buy a items.

This was working fine, yet seems to have stopped after the last couple of versions of ox_inventory (I think it was fine before v2.36.0 but I cannot recall) and we are trying to figure out what the issue is by looking at patch notes there. No updates/changes to ND core have occurred.

We've determined that the "nd:moneyChange" event is not being triggered at all (registerevent debuging outputed nothing).

Running latest server artifacts as well and game build.

I've seen more reports of this from other server owners, just can't understand why.

Any insight?

cc: @Andyyy7666

Andyyy7666 commented 7 months ago

I haven't seen this before, I'll look into it tomorrow.

thelindat commented 7 months ago

From Discord.

This is in the config.lua for ox_inventory which in the past (8 or 10 versions ago) this was working perfectly Set items to sync with framework accounts set inventory:accounts ["cash"]

I also use NDCore. Mine is set to: set inventory:accounts ["money"] No issues. My HUD syncs with my inventory. This works with both Andy's SimpleHUD and his ModernHUD and tested on both my v1 and v2 dev servers.

Legacy-TacticalGamingInteractive commented 7 months ago

Mine has been set to money the entire time.

This error is reproducible on both of my servers now.

Fresh database/clean characters table that is.

I get into the server and its working fine, syncs with SimpleHUD and takes the money out when I buy things in sync. I relog. I come back and its broken. Only taking from inventory.

I dont know what else to do here because its as simple as that. No errors on server side or client side console prints either.

Legacy-TacticalGamingInteractive commented 6 months ago

I haven't seen this before, I'll look into it tomorrow. @Andyyy7666

Any luck?

We've determined that the "nd:moneyChange" event is not being triggered at all (registerevent debuging outputed nothing when we added prints). like its just going around it and prefering to only use ox inventory money.

This may be specific to buying items?

I'm so confused about this. Keep getting daily complaints since nobody can buy anything properly without the real cash amount from their ND.

Its happening on both of my servers.

Just now I logged into my other server and it was working fine. I relogged and suddenly its broken. And broken every login thereafter.

Could it be some other issue with any of these that you can see?

nd framework characters table image

ox_inventory table image

or perhaps startup order? (i dont think thats it though because it hasnt changed... nothing has on my end besides the ox updates)

ensure ox_lib
ensure oxmysql
ensure ox_target
ensure ox_inventory
ensure ND_Core
ensure ND_NoCharacters
ensure ND_ATMs
ensure ND_Banks
ensure ND_Chat
ensure ND_Doorlocks
ensure ND_Fuel
ensure ND_Pay
ensure [ND_FrameworkAddons]
ensure SimpleHUD
Legacy-TacticalGamingInteractive commented 6 months ago

I can fully say after multiple rounds on testing on three servers now (one being someone else testing on their server)

The syncing between the SimpleHUD, ND, Inventory for buying items works fine only on the first login after a server restart. Soon as the person leaves the server and joins again later - the issue is now present. Buying items only taking from inventory money and not ND cash.

I am running ND core 1.0.3 with ox inventory version 2.36.1 game build 2944 and artifacts 7187 (and idk if it matters but NoCharacters as well)

Andyyy7666 commented 6 months ago

@Legacy-TacticalGamingInteractive can you update to v2 on your test server and let me know if you experience the same issue, ND_Characters is not required for v2 if you want to run single characters system ND_Core only should work.

Legacy-TacticalGamingInteractive commented 6 months ago

@Legacy-TacticalGamingInteractive can you update to v2 on your test server and let me know if you experience the same issue, ND_Characters is not required for v2 if you want to run single characters system ND_Core only should work.

Will check it out tonight/tomorrow and let you know any findings