I’m currently developing a server browser system for roblox, It uses ReserveServer to create servers, Iit currentl’y works fine apart from one thing. Of course since roblox servers close with noone in them, It sets the private server id / access code back to blank when the server closes, It’s regenerated when someone tries to join it.
This presents an issue; If me and my friend both click to join an ungenerated server at the same time, It creates two servers, One for his request, and one for my request; Since datastore isn’t instant.
Example of roblox server generation on my discord webhook, id is the server id, priv_id is the private server id, and access code is the access code, as you can see, it generates two, one for each of us.:
ID : 7 PRIV_ID : b5b9f9fe-c22d-4258-9b95-abb5d3a3f1be ACCESS_CODE : V1FK__3HBzFTNny0S2WPyf75ubUtwlhCm5WrtdOj8b49S8dvAQAAAA2
*[* 3:25 AM *]*
ID : 7 PRIV_ID : eafb5177-cc03-42d9-981f-d05cae3eb8a2 ACCESS_CODE : 48XeWbOv8kW_zeyia77UcXdR--oDzNlCmB_QXK4-uKI9S8dvAQAAAA2
How can i fix this?
I’ve seen some people talk about messagingservice, Which I know how to use, just not how to put it into use in this kind of situation.
Server datastore generation:
for x=0, 100 do
list[x] = {
id = "",
access_code = "",
}
end
game:GetService("DataStoreService"):GetGlobalDataStore("Servers"):SetAsync("Servers", game:GetService("HttpService"):JSONEncode(list))