Hey, i want to make a game with private servers included.
I’ve read a lot about sending data from the public game to the private servers ( player:GetJoinData() ) but couldn’t find any information about sending back information / data to the public game.
A lot of games have this feature of sending you to a private server through a lobby with information and you will still keep your data even if you leave the private server.
For example: if there was currency in my game and the public game would have it stored there as a leaderstats value, if i would send that information when teleporting to a private server and i collect more coins in that private server, how would i send back the information to the public game to use it there or to send that value to another private server if they were to teleport back to one?
It is possible to teleport them back to the private game when they for example die or lose the game and give the information to the public game through previously mentioned player:GetJoinData(), but if the player were to leave the private server, there would be no way of sending it back to the public game.
Any help will be appreciated.
Don’t private servers use the same data store? You can access all of the characters data straight from the data store. GetJoinData isn’t often used for large amounts of data, usually just for spawn locations and such. I also don’t think that GetJoinData is safe, so you probably don’t want to send their currency values in it.
Not sure about that one, i think as it is a different game it uses a different datastore as the datastore is made inside a different place.
I could be wrong though, but if it doesn’t use the same datastore then what would be a good solution for sending data / receiving data from public to private places?
I have figured out that MessagingService exists, this can work for sending a message to the main place and having it save there with the values that are given from the message service.
By publishing a message from the private server and subscribing to it from the main server will work, it is probably safer if you encode and decode the values that are given. Only problem i see with this is it overloading quickly by having each private server publishing something to their own server code.
Perhaps it is a temporary solution for the problem i have.
MessagingService is a terrible way to do it. This service used to have a warning about its instability on the documentation page. Well, the warning is gone now but I can tell you from my experience its stability didn’t significantly improve.
Data stores are accessible across all the places in a game universe so you can save the data to the same store easily.
You mentioned GetJoinData but I’m not sure why don’t you use it to send the data from the private server to the public one?
It works fine this way too.
TPService.TeleportAsync accepts teleport options instance as a parameter, you can call SetTeleportData on this instance to insert custom data into it.
This is a good response and a possible solution on my question, though i have one question about something you mentioned. You mentioned sending data from the private server to the public one with GetJoinData, but how would that work?
if it is within the same universe then it’ll have the same data no matter what, if not then you can use GetJoinData on both ends, i don’t understand why it would only be one way in your case. i did a lot of extensive research and the literal only ways to do this are:
create an API online yourself to store data instead of using ROBLOX’es data. or, make a system to transfer data through teleporting.
Thank you for all the help, i’ll see what i can do with the information.
I will mark imNiceBox’s answer as a solution as he was the first to tell me about it.
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.