-
-
Notifications
You must be signed in to change notification settings - Fork 733
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
!Refactor(core): Statebag removal and changes #1407
Conversation
Currently, everything flowing through xPlayer.set is being put into a statebag, aswell as all metadata , resulting in crashes. This change is a high priority.
please fix |
@Mycroft-Studios Hi! Thanks for reporting the problem we will fix it. However, I have two questions: Is the statebag crash because of the continuous data setup or because there is a lot of data? I couldn't find any information anywhere that the statebag is only designed for a few tables of data. I think that it crashes because it is setting the data continuously, so it's not the amount of statebag data but the frequency that is the problem. How do you see this? |
Statebags are not intended for large datasets. They should be kept as small as possible, with larger sets of data being broken up into multiple states if possible and absolutely required. Furthermore, statebags are synced to all clients - any private data being stored with xPlayer.set or xPlayer.setMeta is synced to everyone. This sync occurs when the data is set and when entering the player's scope. Random unstructured unknown infinitely growing data shouldn't be set into statebags. Period. Having xPlayer.set synced is bad enough, but all metadata being on a single statebag is horrendous. |
fix(esx_core): 🔨 send metadata to the client
Hi! I understand and accept that this was a bad implementation. Can you say the same about globalstate? Because as I looked at the implementation the statebag seems to me more stable than the GlobalState bag. What is your opinion about this? |
Large data is still not good for GlobalState, and statebags will just stop syncing once they hit a certain size. Granular updates are not possible with statebags either, so either splitting statebags up logically or using events for updating certain key-values is preferable. |
@Mycroft-Studios @Arctos2win Thanks for fixed this urgent problem. |
Currently, everything flowing through xPlayer.set is being put into a statebag, aswell as all metadata , resulting in crashes.
This change is a high priority.