Jump to content

How to Use a Custom API URL to Send Race Times


DannyMackey

Recommended Posts

Recently, the community has started to make use of Rigs of Rods race scripts to allow tracks to record lap times.  This feature is useful since it will post your lap time to https://forum.rigsofrods.org/multiplayer/races.  However a more useful way to use this is for league events.  This tutorial will NOT explain how to set up a server to receive lap times, but I will explain how to send your times to a server that is already set up.

1. Go to the Rigs of Rods 0.4 folder in your Documents folder.  This is the same folder you go to when you add mods to the game.
NIeZUxD.png

2. Go to the config folder inside the Rigs of Rods 0.4 folder.
UWzUX0W.png

3. Open the file RoR.cfg with a text editor (Notepad, Notepad++, etc.), and find the line that says Online API URL=http://api.rigsofrods.org in the RoR.cfg file.
fTBjMJP.png

4. Replace http://api.rigsofrods.org with a provided ip address and port (something like http://12.34.56.78:1234) and save the file. 

***THIS IS AN EXAMPLE IP ADDRESS AND PORT! IT WILL NOT WORK IF YOU TRY IT!***

6YCtLbG.png

5. Open Rigs of Rods and go to Settings -> General -> Disable online api. 
rTaNf15.jpg

AkkbGCX.jpg

Be sure that this is NOT enabled, it should look just like it does in the image below.
84C9VZB.png

This setting, when set correctly, will send your race times to the website we changed in the RoR.cfg file.

6. To check that this is working, run a lap on a track with a race timer.  After you complete a lap open the Console by pressing the ~ key above the TAB key on your keyboard.  Check for a line that says 

[RoR|GameScript] Submitting race results to 'http://12.34.56.78:1234/races'.

vPdSR38.jpg

To go back to posting your times to the Rigs of Rods website, change what we did in the RoR.cfg to http://api.rigsofrods.org.

 

IMPORTANT NOTES!

1. Depending on the server you are told to use, it may only work for sending race times.  This means your multiplayer server list will not load.  If you have a custom API URL set up and cannot load the multiplayer server this, this is why.  You can still connect over Direct IP.  You will need to change the URL back to the default if you want to view the multiplayer server list.

2. Be sure that the API URL you place in your RoR.cfg file does not end in a backslash (/).  As you can see in the Console in the last image, whatever URL you provide will add "/races" to the end.  If you enter a URL as http://12.34.56.78:1234/ the races will not be reported as the link in the console will say http://12.34.56.78:1234//races. The double backslash (//) before races is not a valid address.

3. Do not directly send RoR.cfg files to others.  This will allow them to see your user token, which allows them to impersonate you on multiplayer servers.  This is very important, not only for normal players, but those with admin privileges on multiplayer servers.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...