I think it's good that we are in agreement here and therefore everything is good. That's always my speech - the forums would be much less full if there were proper documentation - my recommendation is a well-maintained wiki. Regarding routers (with me FritzBox 7590) to reconnect via batch, I have a solution that works: curl -k -m 5 --anyauth --user USERASSWORD "http://ROUTER_IP:49000/igdupnp/control/WANIPConn1" -H "Content-Type: text/xml; charset="utf-8"" -H "SoapAction:urn:schemas-upnp-org:service:WANIPConnection:1#ForceTermination" -d "<?xml version='1.0' encoding='utf-8'?> <s:Envelope s:encodingStyle='http://schemas.xmlsoap.org/soap/encoding/' xmlns:s='http://schemas.xmlsoap.org/soap/envelope/'> <s:Body> <u:ForceTermination xmlns:u='urn:schemas-upnp-org:service:WANIPConnection:1' /> </s:Body> </s:Envelope>" -s (Only change USER, PASSWORD and ROUTER_IP) ROUTER_IP ist the internal not the external WAN-IP! ...is here in the forum no possibility to mark <code>?
Cool, thanks for sharing! I'll add it to the wiki Yes, there is -- click on the + sign in the formatting menu.
Great, you're getting started that fast! I'll also make my other scripts available to you as soon as I get around to it. Why did I not find the marking for codes myself!?!?!? Beautiful evening
Haha, yes, I told you I was an eager type of person Now, although Notion.so is a great tool to document stuff, it's only open to three editors in the free plan. It's good for the time being, but I'd like to set up a "real" wiki (with history & discussion) to make sure everyone can contribute and that we can see what changes over the course of time. I'll have a look around if there's anything suitable.
Yes you really are! Sounds like a lot will improve in the future, I think it's great. So that you have good content, here are the PowerShell scripts as promised: RaceRoomDedicatedServer_DelAllSessions.ps1 Code: CLS # nice to have, to clear screen if you use it in the PowerShell ISE "Löschen aller Server-Sessions..." $GameSettingsIDs = @() # User and Password only needed, if you use the file "access" in the folder... # C:\Program Files (x86)\Steam\steamapps\common\RaceRoom Dedicated Server # ...for protecting Dedicated Server Website $user = 'YOUR_USERNAME_IN_FILE_ACCESS' $pass = 'YOUR_USERNAME_IN_FILE_ACCESS' $pair = "$($user):$($pass)" $encodedCreds = [System.Convert]::ToBase64String([System.Text.Encoding]::ASCII.GetBytes($pair)) $basicAuthValue = "Basic $encodedCreds" # header only needed if you use upper Authentication $Headers = @{ Authorization = $basicAuthValue } # it think (not tested), the header below is not needed if you do not use Authentication (filde "access" - see above) $GameSettingsIDs = (Invoke-RestMethod -Uri 'http://localhost:8088/dedi' -Headers $Headers).GameSetting.Id if($GameSettingsIDs.Count -lt 1) { "Es bestehen keine Server-Sessions!" exit } for($i=0; $i -lt $GameSettingsIDs.Count; $i++) { # If you do not use upper Authentication, you can delete Authorisation Part in the header... $Headers = @{ Authorization = $basicAuthValue 'Content-Type' = 'application/json; charset=utf-8' } [System.Environment]::NewLine + "Lösche Session " + $GameSettingsIDs[$i] + "... " +` (Invoke-WebRequest -Method 'DELETE' -Uri "http://localhost:8088/dedi/$($GameSettingsIDs[$i])" -Headers $Headers).StatusDescription } [System.Environment]::NewLine #pause RaceRoomDedicatedServer_StartSessions.ps1 Code: CLS "Starten der Server-Sessions..." $GameSettingsIDs = @() # User and Password only needed, if you use the file "access" in the folder... # C:\Program Files (x86)\Steam\steamapps\common\RaceRoom Dedicated Server # ...for protecting Dedicated Server Website $user = 'YOUR_USERNAME_IN_FILE_ACCESS' $pass = 'YOUR_PASSWORD_IN_FILE_ACCESS' $pair = "$($user):$($pass)" $encodedCreds = [System.Convert]::ToBase64String([System.Text.Encoding]::ASCII.GetBytes($pair)) $basicAuthValue = "Basic $encodedCreds" # header only needed if you use upper Authentication $Headers = @{ Authorization = $basicAuthValue } # it think (not tested), the header below is not needed if you do not use Authentication (filde "access" - see above) $GameSettingsIDs = (Invoke-RestMethod -Uri 'http://localhost:8088/dedi' -Headers $Headers).GameSetting.Id for($i=0; $i -lt $GameSettingsIDs.Count; $i++) { $Headers = @{ Authorization = $basicAuthValue 'Content-Type' = 'application/json; charset=utf-8' } #if($GameSettingsIDs[$i] -ne 152272) # lässt diese Session aus #if($i -lt 5) # nur die ersten 5 starten, da nicht mehr erlaubt sind if($i -ne 2) # lässt diese Session aus { [System.Environment]::NewLine + "Starte Session " + $GameSettingsIDs[$i] + "... " + ` (Invoke-WebRequest -Method 'POST' -Uri 'http://localhost:8088/dedi/start' -Headers $Headers -Body "{""ProcessId"":$($GameSettingsIDs[$i])}").StatusDescription } else { [System.Environment]::NewLine + "Session " + $GameSettingsIDs[$i] + " wird nicht gestartet!" } } [System.Environment]::NewLine + [System.Environment]::NewLine #pause RaceRoomDedicatedServer_RestoreSettings.ps1 Code: CLS # nice to have, to clear screen if you use it in the PowerShell ISE $Body = '{ "BackupTime": 161...CONTENT_OF_YOUR_BACKUP_FILE... }' "Restore Server-Sessions..." # User and Password only needed, if you use the file "access" in the folder... # C:\Program Files (x86)\Steam\steamapps\common\RaceRoom Dedicated Server # ...for protecting Dedicated Server Website $user = 'YOUR_USERNAME_IN_FILE_ACCESS' $pass = 'YOUR_PASSWORD_IN_FILE_ACCESS' $pair = "$($user):$($pass)" $encodedCreds = [System.Convert]::ToBase64String([System.Text.Encoding]::ASCII.GetBytes($pair)) $basicAuthValue = "Basic $encodedCreds" # If you do not use upper Authentication, you can delete Authorisation Part in the header... $Headers = @{ Authorization = $basicAuthValue 'Content-Type' = 'application/json; charset=utf-8' } (Invoke-WebRequest -Method 'POST' -Uri 'http://localhost:8088/dedi' -Headers $Headers -Body $($Body)).Content [System.Environment]::NewLine + [System.Environment]::NewLine #pause # unkomment for controlling
Cool I've added them to the code snippets section: https://www.notion.so/Code-snippets-27fa58acb7704a54adb6dc89fb08a326
Excuse my ignorance, but where does the processId parameter come from in these api calls? Edit: Nevermind, I've found it (a session must be created via the API to obtain the processId)
Missing data from the API: - What car/class does the driver have? - Live timings of the users Preferably, that data would be available from a public, read only API instead of the API where you can control the dedi. This way, it can be used to read data from other servers without having to ask for access. The timings are missing in the dedi API which would be useful, because right now the only workaround is through the spectator overlay which requires a windows computer to run 24/7 instead of a linux based server
New member here. Love RaceRoom. Have my own dedicated server. Is it possible to use the api to send post request when someone joins my server (in JSON format or other) So that I can build a simple app that can print: "User John Doe joined Server 1 at 14.34 The server currently has 5 users"
Thanks. Can you give an example on how to pull current users from my dedicated server? PHP or js. Pseudo code is enough
Thanks, but that's not exactly what I mean. I would like to do a get request to for example: Https://xxxxxxx.xx/swagger-ui/[server-instance]/users And get a JSON respons containing users currently online on that server Thanks for any help!
Yes, that call can be found as dedi/{processId}, which returns a JSON object that also contains the players. It's not as straight forward as you think, hence I gave you the code for RR Commander as an example. (E.g. you need to set the right header for the request, plus you need to first get the right processId, and then get the user info based on the ID).
Thanks a alot! The variable however only contains the id of the user. How can this be converted into the players name?
Just look at the source code I sent earlier, it contains a function get_name_by_id. Or look at the code the Raceroom dedicated server web interface uses.
Thanks, youve been very helpfull. Ive been looking for the code the Raceroom dedicated server web interface uses but I cant find the source code. I just have the RRRE_Dedicated.exe
Can someone help me to connect with the API in php? I can't get it to work. The code i now have: PHP: // SERVER = actual url to server, same goes for PROCESSID //$url = 'SERVER:8088/chat/PROCESSID';$username = 'user';$password = 'pass';$headers = array( 'Method: GET', 'Authorization: Basic '. base64_encode($username.':'.$password), 'X-Requested-With: XMLHttpRequest', 'Content-Type: application/json; charset=utf-8'); $ch = curl_init();curl_setopt($ch, CURLOPT_URL, $url);curl_setopt($ch, CURLOPT_HEADER, 1);curl_setopt($ch, CURLOPT_PORT, 8088);curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);$output = curl_exec($ch);$info = curl_getinfo($ch);curl_close($ch);var_dump($output);var_dump($info);