Sending an Integer to a Reserved Server

So my game has a queue system whereas when at least a certain number of people join a countdown starts and at the end if the number of players remains over aforementioned certain number all players are teleported to a reserved server. I want to send over the exact number of people so when the reserved server starts it has an exact number of people (to be multiplied by .75) to go off of to wait on before starting.

My issue is actually getting that integer of the number of people to the reserved server. I’ve tried MemoryStoreService extensively and I’m refraining from using DataStores. Is there a way to start the server with some given data or any efficient way of sending it over? Thank you!

Data stores is probably your best bet, even though you said you don’t want them. I can’t really think of any other way of sending data from server to server.

Or as soon as the new server starts you can just count the players and do whatever you want next so you wouldn’t need to send any data over.

1 Like

You can send some data as a parameter from the source:

local TeleportData = {MyParam = MyParam}
TeleportService:TeleportAsync(MyPlaceId, {Player}, TeleportOptions)

and at the destination server you retrieve the data:

local JoinData = Player:GetJoinData()
print("SourceGameId, SourcePlaceId, TeleportData: ", JoinData.SourceGameId, JoinData.SourcePlaceId, JoinData.TeleportData and JoinData.TeleportData.MyParam)
1 Like

Hm noted, just have to find a way to clean that up ig, i’ll try it, thank you

The problem is im sending alot of players at once so i dont want the data being sent a bunch of times to the server, if it has no actual impact on performance than i might look at it, ty for the reply!

Another great option apart from datastores and the extra parameter is messaging service, allows you to communicate between servers. It can be tested by playing a game and receiving the message from studio.

You can send an id with an integer and when the reserved server gets that message, check for the id and use the integer with it.

Try out MemoryService. Its purpose to store temporary data.

You can always send the info, if the server did not already receive those data (so it’s probably the first player), it will store the info but if the server already got some data it will ignore them, and no this really doesn’t affect performance!