How to find the server region from the website

Hello guys, so long ago i was making an extension for the roblox website but then i got bored so i decided to post some info here to help others who wanna make their own extension.

You guys know the Ro-Pro extension?, well theres a feature where you can join servers of different world regions from the website, today we are gonna do that!

1.- Get server UUID
The first thing we need to get is the place’s server UUID (This can be done multiple ways), for that we are gonna make a GET request to: https://games.roblox.com/v1/games/PLACEID/servers/Public
that will give us a list of the place public servers UUIDs along with more info.

Captura

2.- Get the joinScript and server Address
To get the joinScript, from a server, we are gonna make a POST request to https://gamejoin.roblox.com/v1/join-game-instance
In this case i already had a python script for doing this so im gonna use it.

image
(WARN: In the image join-game is used wich is imprecise, use join-game-instance instead)

This is the result:

image

image

3.- Get the location of the server
This is one of the easiest parts, you just have to call an API wich gives u the location of the IP.

image

4.- Join the server

To do this you just gotta execute the following command in the roblox website console:
Roblox.GameLauncher.joinGameInstance(${placeId}, "${serverId}")

Here it is in my JavaScript source file:

image

PD: The error: Unable to join Game 312 means you have to wait some time before trying again.

13 Likes

Hey, I just found this post after retrying to do this in powershell script. This might be a big ask but can you send the full python code (or just a python script that can do these steps)? I’m having trouble sending the POST request and would like to try and replicate the script in python before trying to re-create it in powershell.

Edit: Nvm. I’ve managed to replicate the part I want. I think ill stick with python though since it has more use than powershell script which is a bit too niche and has some lacking features. I’ve got a smaller issue now. This is my awesome python code:

import requests

# Enter your roblox cookie here
robloxCookie = "1234"

placeId = int(input("PlaceID: "))
uri = f"https://games.roblox.com/v1/games/{str(placeId)}/servers/0?excludeFullGames=true&limit=100"
response = requests.get(url=uri)
servers = response.json()["data"]
authCookies = {
    ".ROBLOSECURITY" : robloxCookie,
    "path" : "/",
    "domain" : ".roblox.com"
    }
authHeaders = {
    "Referer" : f"https://www.roblox.com/games/{placeId}/",
    "Origin" : "https://roblox.com",
    "User-Agent" : "Roblox/WinInet"
}

for server in servers:
    serverId = server["id"]
    session = requests.Session()
    print(serverId)
    print("----------------------------------------------------------------------------------------------------------------------------")
    res = session.post("https://gamejoin.roblox.com/v1/join-game",
                 cookies = authCookies,
                 json={
                 "placeId" : placeId,
                 "isTeleport" : False,
                 "gameId" : serverId,
                 "gameJoinAttemptId" : serverId
                 },
                 headers=authHeaders)
    ip = res.json()["joinScript"]["UdmuxEndpoints"][0]["Address"]
    # geolocation = requests.get(f"http://ip-api.com/json/{ip}").json()
    print("----------------------------------------------------------------------------------------------------------------------------")
    print(res.json()["joinScript"])
    print("----------------------------------------------------------------------------------------------------------------------------")

But when I run it, I seem to be getting the exact same IP from every result. For instance, plugging in this gameId: 9391468976

yields this result:

6fc44840-6e3d-4180-ace7-c89a9fb30786
----------------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------------------
128.116.55.33
----------------------------------------------------------------------------------------------------------------------------
4355f93a-552c-48fb-a837-3eb23fff6dd9
----------------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------------------
128.116.55.33
----------------------------------------------------------------------------------------------------------------------------
c62d9124-768f-4bd4-82db-20c49341db28
----------------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------------------
128.116.55.33
----------------------------------------------------------------------------------------------------------------------------
02e8a00c-d431-4c89-bfad-4754a654617b
----------------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------------------
128.116.55.33
----------------------------------------------------------------------------------------------------------------------------
5aece663-f884-4bb6-8e5d-b71bdd286c33
----------------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------------------
128.116.55.33
----------------------------------------------------------------------------------------------------------------------------
0610e6fa-ef14-46b3-8cbd-ad4c4f4fcffb
----------------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------------------
128.116.55.33
----------------------------------------------------------------------------------------------------------------------------
85aa3cd6-9f72-49ca-a0c8-f28eb70ec1a2
----------------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------------------
128.116.55.33
----------------------------------------------------------------------------------------------------------------------------
d06a5cec-cc90-456c-8aa9-76a033daffe7
----------------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------------------
128.116.55.33
----------------------------------------------------------------------------------------------------------------------------

Its entirely possible that multiple servers could be run on the same machine but letting this run to its 100 server limit yields the same IP address every time. I have no clue why :frowning:

UPDATE: use the https://gamejoin.roblox.com/v1/join-game-instance endpoint instead.

This is one hell of a way to retrieve the location, maybe this is one of the external ways to access it via in-game from another server or something of that nature.

You can simply run a GetAsync call to the site http://ip-api.com/json/
It’ll provide you with all of the location data you need. Country, region, city, etc.

1 Like

As far as i know this is the only way to get a server IP before joining any game, the post is meant to be for website plugin development.

Not entirely sure how roblox API works, but my theory is that join-game-instance serves for communicating more directly with the server than join-game-instance although in both cases the countries were the same.

But anyways i will change my original post to use join-game-instance instead since might be more useful (or maybe even faster) so TY.

No problem. I’ve written up a sort of ‘example project’ on my github that contains full working code for a use case of something like this. If you think you can learn anything from it (or have anything you could teach me :wink: ), here it is:

2 Likes