From c6be00777dfab989900f6f6049d45e6aad897e2e Mon Sep 17 00:00:00 2001 From: Jens van de Wiel Date: Fri, 27 Oct 2023 20:48:23 +0200 Subject: [PATCH] added 2fa support --- examples/install-rustserver-linux/main.go | 2 +- examples/install-rustserver/main.go | 4 ++-- prompt.go | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/examples/install-rustserver-linux/main.go b/examples/install-rustserver-linux/main.go index a07d468..601f054 100644 --- a/examples/install-rustserver-linux/main.go +++ b/examples/install-rustserver-linux/main.go @@ -11,7 +11,7 @@ func main() { prompts := []*gosteamcmd.Prompt{ gosteamcmd.ForceInstallDir("/home/jens/rustserver"), - gosteamcmd.Login("", ""), + gosteamcmd.Login("", "", ""), gosteamcmd.AppUpdate(258550, "", true), } diff --git a/examples/install-rustserver/main.go b/examples/install-rustserver/main.go index 2122217..7583dc3 100644 --- a/examples/install-rustserver/main.go +++ b/examples/install-rustserver/main.go @@ -11,8 +11,8 @@ func main() { prompts := []*gosteamcmd.Prompt{ gosteamcmd.ForceInstallDir("c:\\rustserver\\"), - gosteamcmd.Login("", ""), - gosteamcmd.AppUpdate(258550, "", true), + gosteamcmd.Login("", "", ""), + gosteamcmd.AppUpdate(2430930, "", true), } cmd := gosteamcmd.New(os.Stdout, prompts, "") diff --git a/prompt.go b/prompt.go index e760fc3..2d114ba 100644 --- a/prompt.go +++ b/prompt.go @@ -28,11 +28,11 @@ func AppUpdate(appID int, beta string, validate bool) *Prompt { return &Prompt{cmd, AppUpdatePrompt} } -// Login logs into SteamCMD with the given username and password. If the arguments are empty, it will login as anonymous. -func Login(username string, password string) *Prompt { +// Login logs into SteamCMD with the given username and password. If the arguments are empty strings, it will login as anonymous. +func Login(username string, password string, authcode string) *Prompt { cmd := "login " if username != "" { - cmd += username + " " + password + cmd += username + " " + password + " " + authcode } else { cmd += "anonymous" }