Skip to content
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

Use other Keys than player #155

Closed
cosmicpsx opened this issue Feb 7, 2022 · 6 comments
Closed

Use other Keys than player #155

cosmicpsx opened this issue Feb 7, 2022 · 6 comments

Comments

@cosmicpsx
Copy link

I know it sounds dumb, but why can we only use the Player for Datastore2()? Why can't we use like tags, or UserIds? Would be nice if we would get it! :D

@Kampfkarren
Copy link
Owner

There's an open issue for user IDs, but read only. The problem is it's not safe. DataStore2 caches, and so multiple separate instances can end up clashing different data against each other.

@cosmicpsx
Copy link
Author

Where tho

@cosmicpsx
Copy link
Author

And how should it not be safe? Normal Data Stores use it like that too, and some public games too. How should that be unsafe?

@Kampfkarren
Copy link
Owner

Multiple servers can edit the data at the same time, overwriting each other, and not producing a consistent output, especially considering DataStore2 works on a cache. It's a data race.

@cosmicpsx
Copy link
Author

But that would just be dependant on the use, errors are not your problem if they happen. I mean, you can just support players as safe and other keys as "unsafe" too

@Kampfkarren
Copy link
Owner

I'm not personally interested in adding footguns to DataStore2 given its popularity, though I would encourage you to fork if you need this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants