I’d like to implement an trigger that will send data to all currently running server instances so every player get the content of the data at the same time.
My aim’s pretty simple: I want to make a closed beta system for my Experience. As it’s a closed one, the amount of players able to sign in my Experience is limited (1K). But when a player signs in, I need all the servers to know that there’s less slots available to sign in for other players.
For instance, if two players are currently running my Experience, that there’s only one slot remaining and that Player1 signs in, it means there’s no slot available anymore. As well, Player2 won’t be able to sign in anymore. (Consider those 2 players aren’t in the same server while running the Experience.) Then how would the Player1’s server know that it cannot give a slot to Player1? I need the servers to communicate with each others, or at least to get the data.
However, I cannot use DataStoreService as too many requests would be sent so it would drop them.
Moreover, I’ve read about MessagingService and so many topics. However, I’m not so sure if it’s the right thing to work with as I’ve never dealt with it before plus I don’t understand how it works.
Thanks a lot for your help even if it’s just a link or a suggestion.
Have a nice day, Devs.
Realistically, you should consider just using something like a Group role to gate beta access. There isn’t support on the platform for capping concurrent players, and letting people spin up new servers only to call Player:Kick() on them as soon as they load is a terrible user experience and a waste of Roblox’s datacenter resources (you’d be thrashing server startups and shutdowns as soon as you got near the cap). This would be a frustrating system to try and build using either DataStores or Messages, because of how datastore results are cached, and how slow it would be to try to sync tens of servers via messaging (awful).
Piggybacking off of Emily’s reply, definitely try and implement a form of permission based system to ease the access tons. If you still choose to go this route, MessagingService, or my personal favorite MemoryStoreService will be your best friend.
First and foremost, I’d like to thank both @EmilyBendsSpace and @corehimself for your answers. It really helps me.
However, I don’t wanna make an awful system as you described, I want it to be nice for players, even if they aren’t it the closed beta.
Here is a prototype I’ve already realized in Roblox yesterday, but if I opened this topic, it’s because I’m gonna rescript every single line of my code because I’ve done it really badly and my system is full of bugs (the main one being the lack of compatibility btw running servers).
I hope you’ll enjoy it.
In the video, you cannot see what happens to players who try to sign in when the system is out of slots for new users. Here is a picture of what players who aren’t signed in will see: