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.
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.
(WARN: In the image join-game is used wich is imprecise, use join-game-instance instead)
This is the result:
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.
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:
PD: The error: Unable to join Game 312 means you have to wait some time before trying again.
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
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
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.
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 ), here it is: