Jodian 10 Thg11, 2016 @ 3:50pm
SteamCMD and Steam Guard
Hey All!

Like most who opt to use SteamCMD, I'm in the business of using it to update gaming servers. As I like to update all of my servers (and their mods) with a single daily downtime (about 15 minutes) it's a huge benefit. The only issue I have is the protection on my Steam account, by the way of Steam Guard. More specifically, the mobile authenticator.

Every time my update process hits the next game (or mod) to be updated it logs in and has to reauthenticate the mobile authenticator. Since there are about 48 lines of SteamCMD entries in this update script you can imagine the hassle of having to type in an authenticator code 48 times.

While going over the script to see if there was ANY way I could compress it and bring that number down I realized every SteamCMD line ended with "+quit". I assume this tells Steam you're done after the job and to log you out. Is it possible to leave the "+quit" out of the first 47 SteamCMD lines and it will stay logged in until it gets the "+quit" on the last one? Somewhat like so;

steamcmd +login n p +force_install_dir "C:\somewhere" +workshop_download_item # #
steamcmd +force_install_dir "C:\wherever" +workshop_download_item # #
steamcmd +force_install_dir "C:\wherever" +workshop_download_item # #
steamcmd +force_install_dir "C:\wherever" +workshop_download_item # # +quit

In theory it would login, ask for the authenticator, and then do everything before logging out after the final job. It's logical, but would it actually work?
Lần sửa cuối bởi Jodian; 10 Thg11, 2016 @ 3:53pm
< >
Đang hiển thị 1-4 trong 4 bình luận
Jodian 10 Thg11, 2016 @ 4:15pm 
Figured it out! Instead of deleting this thread, however, I'll leave this information here in case anyone else is running into this issue.

What you have to do is write a Steam script and then execute it using SteamCMD. Here, I'll explain. So you start out with your many lines of code. In my case I was doing mod updates;

steamcmd +login n p +force_install_dir "C:\somewhere" +workshop_download_item # #
steamcmd +login n p +force_install_dir "C:\somewhere" +workshop_download_item # #
steamcmd +login n p +force_install_dir "C:\somewhere" +workshop_download_item # #
steamcmd +login n p +force_install_dir "C:\somewhere" +workshop_download_item # #
steamcmd +login n p +force_install_dir "C:\somewhere" +workshop_download_item # #

Doing it this way forces you to have to enter your authenticator for every single mod. It's quite a pain in the arse. Instead you simply put this in your bat file;

steamcmd +runscript "scriptname.txt"

You can name the text file whatever you want, I just use that as an example. Then you create a text file where SteamCMD is located on your computer called "scriptname.txt", again as an example. In that text file you put all the SteamCMD commands as if you were typing them into the console yourself. Only difference is, it won't have to login more than once. So your "scriptname.txt" file will look something like this;

@ShutdownOnFailedCommand 0 // stops it from exiting if an error happens
@NoPromptForPassword 1 // won't ask you for the password
login [username] [password]
force_install_dir "C:\somewhere"
workshop_download_item # #
workshop_download_item # #
workshop_download_item # #
workshop_download_item # #
workshop_download_item # #
workshop_download_item # #
workshop_download_item # #
workshop_download_item # #
quit

When doing workshop items it's important to know that the first # is normally the SteamID of the game, not the dedicated server. The second # is the Workshop ID of the specific mod you want to install. You also need the Force Install line to point to where the mods get installed for that specific game, since SteamCMD really doesn't know where to download them to on it's own.

Happy server managing!
Lần sửa cuối bởi Jodian; 10 Thg11, 2016 @ 4:19pm
Jodian 10 Thg11, 2016 @ 4:27pm 
Ok, I was slightly wrong. It appears for workshop items it completely ignores the "force_install_dir" location. Instead it seems to install it where your SteamCMD is located, in the subfolder "steamapps\workshop\content\[GameID]\[ModID]".

Easy fix though. You just have to edit your bat file to move the folders manually to the proper location after they finish downloading. Just add this to your batch file after the +runscript line;

xcopy "C:\TheGameIDPath\*.*" "C:\WhereTheModsGo\" /Y /E
Lần sửa cuối bởi Jodian; 10 Thg11, 2016 @ 5:07pm
aiusepsi 10 Thg11, 2016 @ 5:07pm 
Can you not use login anonymous?
Jodian 10 Thg11, 2016 @ 5:08pm 
Nguyên văn bởi aiusepsi:
Can you not use login anonymous?

Some games yes, but a lot of games actually require you to provide "proof" you own the game before you can download workshop content. In addition, even some dedicated server downloads require you to prove you own the game by logging in.
< >
Đang hiển thị 1-4 trong 4 bình luận
Mỗi trang: 1530 50

Ngày đăng: 10 Thg11, 2016 @ 3:50pm
Bài viết: 4