From 20f95589db7be7b26fd838429b00c24acf4eb5ac Mon Sep 17 00:00:00 2001 From: Giovanni Harting <539@idlegandalf.com> Date: Wed, 27 Oct 2021 01:42:27 +0200 Subject: [PATCH] moved authcode from a flag to config --- config_example.yaml | 1 + main.go | 3 +-- utils/utils.go | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/config_example.yaml b/config_example.yaml index d300e45..569595c 100644 --- a/config_example.yaml +++ b/config_example.yaml @@ -12,6 +12,7 @@ steam: username: steamuser # Password needs to be provided only until a login_key is obtained, can be empty after password: steampassword + auth_code: api_key: apikey rate_per_sec: 1 sentry: ".sentry" diff --git a/main.go b/main.go index 74fdeae..ad0fd59 100644 --- a/main.go +++ b/main.go @@ -42,7 +42,6 @@ var ( firstHK = true rL ratelimit.Limiter configFlag = flag.String("config", "config.yaml", "Set config to use") - authCodeFlag = flag.String("authcode", "", "Provide Steam AuthCode to login") journalLogFlag = flag.Bool("journal", false, "Log to systemd journal instead of stdout") sqlDebugFlag = flag.Bool("sqldebug", false, "Debug SQL queries") ) @@ -825,7 +824,7 @@ func main() { err = demoLoader.Setup(&csgo.DemoMatchLoaderConfig{ Username: conf.Steam.Username, Password: conf.Steam.Password, - AuthCode: *authCodeFlag, + AuthCode: conf.Steam.AuthCode, Sentry: conf.Steam.Sentry, LoginKey: conf.Steam.LoginKey, ServerList: conf.Steam.ServerList, diff --git a/utils/utils.go b/utils/utils.go index e7a4f62..234f736 100644 --- a/utils/utils.go +++ b/utils/utils.go @@ -39,6 +39,7 @@ type Conf struct { Steam struct { Username string Password string + AuthCode string `yaml:"auth_code"` APIKey string `yaml:"api_key"` RatePerSecond int `yaml:"rate_per_sec"` Sentry string