Philipp15b / go-steam

Steam's protocol in Go to allow automation of different actions on the Steam network without running an actual Steam client. Includes APIs for friends, chatting, trading, trade offers and TF2 crafting.
https://pkg.go.dev/github.com/Philipp15b/go-steam/v3
Other
387 stars 131 forks source link

client.Connect() timeout #131

Closed tangbo1430 closed 1 year ago

tangbo1430 commented 1 year ago

func main() { myLoginInfo := new(steam.LogOnDetails) myLoginInfo.Username = "Your username" myLoginInfo.Password = "Your password"

client := steam.NewClient()
client.Connect()
for event := range client.Events() {
    switch e := event.(type) {
    case *steam.ConnectedEvent:
        client.Auth.LogOn(myLoginInfo)
    case *steam.MachineAuthUpdateEvent:
        ioutil.WriteFile("sentry", e.Hash, 0666)
    case *steam.LoggedOnEvent:
        client.Social.SetPersonaState(steamlang.EPersonaState_Online)
    case steam.FatalErrorEvent:
        log.Print(e)
    case error:
        log.Print(e)
    }
}

}

image

tangbo1430 commented 1 year ago

func main() { myLoginInfo := new(steam.LogOnDetails) myLoginInfo.Username = "Your username" myLoginInfo.Password = "Your password"

client := steam.NewClient()
client.Connect()
for event := range client.Events() {
  switch e := event.(type) {
  case *steam.ConnectedEvent:
      client.Auth.LogOn(myLoginInfo)
  case *steam.MachineAuthUpdateEvent:
      ioutil.WriteFile("sentry", e.Hash, 0666)
  case *steam.LoggedOnEvent:
      client.Social.SetPersonaState(steamlang.EPersonaState_Online)
  case steam.FatalErrorEvent:
      log.Print(e)
  case error:
      log.Print(e)
  }
}

}

image

k0mar12 commented 1 year ago

@tangbo1430 How did u fix it? Thanks

Neels99 commented 1 year ago

@tangbo1430 How did u fix it? Thanks

client := steam.NewClient()
steam.InitializeSteamDirectory() //<----- add this
client.Connect()
k0mar12 commented 1 year ago

@tangbo1430 How did u fix it? Thanks

client := steam.NewClient()
steam.InitializeSteamDirectory() //<----- add this
client.Connect()

Yep, thanks, i have already found it :)