-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Garage vehicles spawn feat: statebag of keys #47
Conversation
…oors chore: restore qbx fxmanifest.lua style
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for taking on this resource. Mostly minor comments. Great job!
keysList[citizenid] = {} | ||
end | ||
|
||
keysList[citizenid][plate] = true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we even need this table now that the keys are stored on the player's state bag? This question boils down to do we need to access keys by citizenid, or would serverId suffice.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's quite problematic. if the player disconnects and reconnects, the statebag disappears. Maybe new item "vehicle keys" in inventory?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah. Maybe we should limit its use to saving/loading on player disconnect/reconnect then? Or maybe there is a broader solution that could be put in core of saving/loading statebags? No action required.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another point to consider is whether this data should be persisted between server restarts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if in hotwiring replace TriggerServerEvent('qb-vehiclekeys:server:AcquireVehicleKeys') with a statebag change?
Then only the keys assigned by the scripts would be in the server's memory.
Co-authored-by: Manason <clanerp@gmail.com>
Co-authored-by: Manason <clanerp@gmail.com>
…to separate variables on client, lockpicking semaphore to lock flag as a guard of a critical section, removed redundant isHotwiring setting and getHash function, moving onResourceStart over Backwards Compatibility section
Major changes
Change the data structure of vehicleKeys[plate][citizenid] to keysList[citizenid][plate]. This simplifies the logic of most functions.
Instead of synchronizing the variable on the client side, the player's statebag is modified.
Vehicle spawning works in shops, fixed GetKeys function
Other changes
fixed lint tests by rewriting imports
lockpicking for all vehicle doors
restored oryginal qbx fxmanifest.lua style
Need to think about how you can optimize the storage of keys in a variable on the server
Checklist