Add ReserveServerCode to game

I am currently developing a matchmaking system for Phantom Forces, and one difficult part of it, is determining who should all be in the server. I have a external server that gets the reserve server ID, and teleports all the players to the server, however, I can’t find an easy enough way to determine if its a matchmaking server or not, and have a way to match the server ID to the list of players. Right when the server starts, I need to be able to ping my own server, get the list of players who are suppose to be in game, then delay the game until all users have joined, or a certain amount of time.

I am storing the users who should be there, but i need a way on the server itself to basically ping the external server to get the list of players to wait for. The easiest solution would be to have the ReserveServerCode created by the TeleportService:ReserveServer(placeid) function to be a part of DataModel.

This way, when the server is created, and sent back to my ext. server, it keeps a list of RSC to players, and when the new server starts up, it will see game.ReserveServerCode is not nil, ping the web server, get a list of users, and then wait a certain amount of time for each of them.

That is all.

15 Likes

I saw some code somewhere in Cool Creations that you can use in the meanwhile for checking if its a reserved server or not, but I’m unsure if it’ll be effective.

game.VIPServerId ~= "" and game.VIPServerOwnerId == 0

Otherwise yeah, I support.

Yeah, thats a way to tell if it is one, but the problem is to correlate between the server and the player list.

This is hopefully a good image explaining my problem

And I need it when the server starts, because i can’t wait a minute for some players to join, then check that list of players to matches started, it needs to be instantaneous-ish, plus the server will act differently accordingly.

VIPServerID and JobId both don’t help in this situation either.

5 Likes

From my experience, the only way to get the ReserveServerCode is to get it from clients as they teleport into the server and have the Code as teleport data that the client sends to the server as soon as they load in. The first person to load in would send the code so there would be no need to wait for everyone.

This is a bad solution in my opinion though, especially relying on the client to do it.

2 Likes

Only way to do it. Spent 2 weeks straight trying to get around it, no other way.

3 Likes

Hence this suggestion

3 Likes

Issa blind, can confirm

Feature Requests Client Features

Support!

Yes, would be convenient to have the reserved server code available under the datamodel.

What I do right now is that I have a datastore that maps player id → reserved server code, I set it before I teleport players there, and the reserved server will find out the code through these datastore entries. More secure than passing it through teleport data, since that is client-side. It’s still a roundabout way of getting the reserved server code where I need it to be though.

1 Like

What happens if the player leaves mid-teleport, and rejoins an empty, normal server from the site? Do you do anything to prevent it from being incorrectly flagged as a reserved server? I’m thinking you could just check VipServerId and VipServerOwnerId == 0 to verify that they teleported to a reserved server, but I’m unsure if you use different verification.

In my use case this is not possible, because there are no “normal servers”. All servers on that specific place run as reserved servers. There’s a lobby and players get teleported to reserved servers from there (either one of their choice or through matchmaking)

You can use that check to verify it as being a reserved server or not, yeah.

1 Like

We want to find a way to support this in the future. We just don’t have a solution at the moment.

5 Likes

I hate to revive an old thread, but are there any updates on this feature? It would be very useful to me for my current development project.

4 Likes

No updates.

3 Likes

We need this!!! It would open up so much potential and make the universe feature so much more useful!

See also:
https://devforum.roblox.com/t/games-with-multiple-places-really-need-work/135439

1 Like