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
388 stars 131 forks source link

Authorization does not work. #83

Open kagtaviy opened 7 years ago

kagtaviy commented 7 years ago

I use this example:

    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)
        }
    }

But it does not work. Can you help me please?