4
0
mirror of https://github.com/cwinfo/matterbridge.git synced 2025-06-27 08:49:24 +00:00

Use viper (github.com/spf13/viper) for configuration

This commit is contained in:
Wim
2018-03-04 23:52:14 +01:00
parent 25a72113b1
commit f2f1d874e1
15 changed files with 364 additions and 336 deletions

View File

@ -18,11 +18,11 @@ type Bsteam struct {
connected chan struct{}
userMap map[steamid.SteamId]string
sync.RWMutex
*config.BridgeConfig
*bridge.Config
}
func New(cfg *config.BridgeConfig) bridge.Bridger {
b := &Bsteam{BridgeConfig: cfg}
func New(cfg *bridge.Config) bridge.Bridger {
b := &Bsteam{Config: cfg}
b.userMap = make(map[steamid.SteamId]string)
b.connected = make(chan struct{})
return b
@ -81,9 +81,9 @@ func (b *Bsteam) getNick(id steamid.SteamId) string {
func (b *Bsteam) handleEvents() {
myLoginInfo := new(steam.LogOnDetails)
myLoginInfo.Username = b.Config.Login
myLoginInfo.Password = b.Config.Password
myLoginInfo.AuthCode = b.Config.AuthCode
myLoginInfo.Username = b.GetString("Login")
myLoginInfo.Password = b.GetString("Password")
myLoginInfo.AuthCode = b.GetString("AuthCode")
// Attempt to read existing auth hash to avoid steam guard.
// Maybe works
//myLoginInfo.SentryFileHash, _ = ioutil.ReadFile("sentry")