HOW TO: Hosting with SteamCMD and Paid Content

Wow.

Thanks a lot - mainly for doing the manual work I try to avoid ;-)

I have done an installed (more downloaded) content updater e.g. once, which will look into common\workshop\365960 and get the SteamIDs and check with SteamCMD if there are updates:
Code:
#
# Simple script to update already downloaded content
#
# Author: Stone, info AT simracingjustfair.org
#

#
# source variables
if (!(Test-Path "..\VARIABLES_SOURCE_FILE.ps1") -and !(Test-Path ".\VARIABLES_SOURCE_FILE.ps1")) {
  Write-Warning "Cannot source variables - exiting."
  exit 1
}
else {
  if(Test-Path "..\VARIABLES_SOURCE_FILE.ps1") { . "..\VARIABLES_SOURCE_FILE.ps1" }
  if(Test-Path ".\VARIABLES_SOURCE_FILE.ps1") { . ".\VARIABLES_SOURCE_FILE.ps1" }
}

# DEACTIVATED BECAUSE WE CAN REMOVE THE FILE AT THE END AND SO WE CAN USE THE UPDATER FOR ITEMS CHOSEN BY RF2SRV_DOWNLOAD_UI
# remove already existing command file
#if("$STEAMINSTALLDIR\workshop_items.cmd") { rm $STEAMINSTALLDIR"\workshop_items.cmd" }

#
# get SteamID of already downloaded items
write-host "Reading workshop directory and building command file"
foreach($ITEM in (gci -Directory $STEAMINSTALLDIR\steamapps\workshop\content\365960\ | select -Expand Name))
{
 "workshop_download_item 365960 "+$ITEM+" validate" | Out-File -Append $STEAMINSTALLDIR"\workshop_items.cmd" -Encoding ASCII
}

#
# download / update items by using command file
$ARGUMENTS=" +login anonymous +runscript $STEAMINSTALLDIR\workshop_items.cmd +quit"
start-process "$STEAMINSTALLDIR\steamcmd.exe" -ArgumentList $ARGUMENTS -NoNewWindow -Wait

#
# remove command file
if("$STEAMINSTALLDIR\workshop_items.cmd") { rm $STEAMINSTALLDIR"\workshop_items.cmd" }

What I am currently working on is a UI in Windows Forms (I am not a Powershell expert, I am more a novice) which lets you choose from the installed content in rf2\installed\vehicles and \locations in order to build a .dat file for mod generation.

I have already finished a script for downloading items which relays on Fidgroves CSV files (I have downloaded and stored them luckily) and which I want to change to an on demand web request for getting all available paid content.

That's why I am asking for.

One way, but not really useable is to read my own Steam inventory for such content, but then I need to own all that content - I have not managed to read Steam Shop for such information (is it available there) and it seems SteamAPI does not provide such a function.

So I ended up with my question ...
 
Got it ...

Code:
curl -s https://api.steampowered.com/IInventoryService/GetItemDefMeta/v1/?key=<webapi key from steam dev>&appid=365960

returns "$digest"

Code:
curl -s "https://api.steampowered.com/IGameInventory/GetItemDefArchive/v1/?key=<webapi key from steam dev>&appid=365960&digest=<digest>" | jq '.[] | {name,workshopid}'

returns name and steamid of object
 
Code:
curl -s "https://api.steampowered.com/IGameInventory/GetItemDefArchive/v1/?key=<webapi key from steam dev>&appid=365960&digest=<digest>" | jq '.[] | {name,workshopid}'

returns name and steamid of object

WOW! I really was searching this! I need talk to you to help me haha!

Can you help me with the documentation of the Steam?

Thanks in advance!
 
WOW! I really was searching this! [...]

Can you help me with the documentation of the Steam?
Thanks in advance!

First of all - I was searching for months how to query the Steam API to get the information I want from it and I asked a lot of people who helped me a lot, but it turned out that we all were looking for the same information ... and did not know how to ;-)

As I am familiar with shell scripting on UNiX I tried curl - for PWSH its equivalent is invoke-webrequest or invoke-restapi afaik. Syntax is pretty similar:

Code:
$url="https://api.steampowered.com/IGameInventory/GetItemDefArchive/v1/?key=<steam dev key>&appid=365960&digest=<digest>"
[Array]$test = Invoke-RestMethod $url

Unfortunately I have to say (and it will answer the 2nd question) I have major problems understanding the documentation of SteamAPI as I am not a programming guy nor I am a developer or C## programmer in general.
 
I want to give a HUGE shout out and thank you to redapg and Goanna for their help in cracking this nut. I've connected to a server both on the client PC and remotely via my laptop. It seems that every time you kick off your Steam client on one or the other the MAS2 manager resets your default directory back to your Steam client instead of your dedicated server. So I will check every time I start a session to make sure the MAS2 is pointing to C:\racing\rfactor2dedicated\packages

I can't tell you how awesome this community has been and especially my new mates! :)

I just need to find a detailed instruction on camera control while in spectate mode. Is there a link to such a document? I need to be able to adjust camera height, and forward and aft and then lock it there. I can't seem to find the keyboard controls for RFactor lol.

Thank you everyone! Woot!
I don't mean to dig up an old post, but I recently ran into the same issue so I thought it was worth the bump. The Packages directory in MAS2 on my dedi switched to C:\racing\rfactor2dedicated\ for an unknown reason. Setting it back to C:\racing\rfactor2dedicated\Packages fixed it.

I was getting so frustrated because my old mods were working just fine, but every new mod I created would fail with the "failed to download/install packages" error when I tried to join the server.
 
Back
Top