Repository navigation
[Bug] Client-side AddConvarChangeListener only fires for convars previously read with GetConvar #587
lilabyte
started this conversation in
[BUG] FiveM for GTAV Enhanced
Replies: 2 comments
|
Hello, |
0 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.
Summary
AddConvarChangeListener is a shared native, but on the client side it only fires for convars the client script has previously read with GetConvar while the convar already existed. The read appears to materialize the convar in the client's local table, and only materialized convars dispatch change events. A replicated update alone never fires the client listener (wildcard included), even though the updated value IS visible to GetConvar. Reading a name that doesn't exist yet materializes nothing, so a script cannot subscribe ahead of time. Resource restarts and reconnects do not help by themselves. Server-side listeners do not have this limitation: a server wildcard listener fires for any convar change without any prior GetConvar read, no matter when the convar was created.
Issue type
Client
Repro rate
Always
Server build version
FXServer-early-access b168 linux
OS
Windows 11 Pro 10.0.26200
CPU
13th Gen Intel(R) Core(TM) i5-13600KF
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
Linux
OS version / distribution
Debian 13
CPU
No response
RAM
No response
Using txAdmin?
Yes
Hosting provider
Self-hosted
Machine type
VPS
/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
Repro resource (JS, no dependencies):
fxmanifest.lua
server.js
client.js
Steps (fresh server, player connected, resource ensured):
setr repro_fresh a- silence everywhere (listeners never fire on convar creation, separate known behaviour, not this report).setr repro_fresh b- server logs the change; client logs NOTHING.repro_touch repro_fresh- printstouched repro_fresh = "b", so the replicated value was on the client all along.setr repro_fresh c- client NOW logs the change, the GetConvar read in step 3 is what made the listener work.setr repro_other a, thensetr repro_other b) stays silent on the client indefinitely.repro_touch repro_futurebefore anysetr repro_future) does NOT help - later changes still don't fire, the read must happen while the convar exists.Expected Behavior
Step 2 should fire the client listener the same way it fires the server one - a listener registered with a wildcard filter should not depend on the script having called GetConvar for that name first.
Actual Behavior
The client listener stays silent for any convar the client script has not previously read with GetConvar while it existed. The replicated value still reaches the client (GetConvar returns it), only the change event is missing.
Evidence
No response
Additional Context
No response
All reactions