Closed StringNick closed 8 years ago
That likely means the steam endpoint your attempting to connect to isn't up, or you can't route to it. Try switching to another steam endpoint.
The current internal server list is pretty outdated, so you'll likely needs lots of tries before you can connect. After connecting, you can connect to one of the servers you get from the ClientCMListEvent
. Alternatively, you can use InitializeSteamDirectory
in the steam
package.
@Philipp15b Isn't the list of servers now gathered from Steam API before connection by default? c24ff67 I thought that solved the problem of outdated server list.
i think i try all servers from node.js servers.js
Okay, i try to connect like that, someone told use InitializeSteamDirectory, i try use Connect to specified server, dont help. Or can someone send example how connect<3, or worked ip
package main
import (
"io/ioutil"
"log"
"github.com/Philipp15b/go-steam"
"github.com/Philipp15b/go-steam/protocol/steamlang"
)
func main() {
myLoginInfo := new(steam.LogOnDetails)
myLoginInfo.Username = "sa"
myLoginInfo.Password = "sa"
// if sentry, err := ioutil.ReadFile("sentry"); err == nil {
// myLoginInfo.SentryFileHash = sentry
//}
client := steam.NewClient()
err := steam.InitializeSteamDirectory()
if err != nil {
log.Panic(err.Error())
}
client.ConnectEurope()
for event := range client.Events() {
switch e := event.(type) {
case *steam.ConnectedEvent:
log.Println("Connecting SteamBot")
client.Auth.LogOn(myLoginInfo)
case *steam.MachineAuthUpdateEvent:
log.Println("Wrote Sentry")
ioutil.WriteFile("sentry", e.Hash, 0666)
case *steam.LoggedOnEvent:
log.Println("SteamBot logged in")
client.Social.SetPersonaState(steamlang.EPersonaState_Online)
case steam.FatalErrorEvent:
log.Println(e)
case error:
log.Println(e)
}
}
}
oh no guys, my example worked, i forgot go build<3
If you take a look at the client.go
file, only Connect()
method uses Steam Directory to get list of currently available servers. Use Connect()
instead of ConnectEurope()
.
Also if the account uses the Steam Guard, you will need to provide auth code from email or auth code from steam authenticator app.
Slacki, i connected, but now dont work next state, he connect and thats all
Could you provide more details? What do you mean by "next state"?
Look at my main func
func main() {
myLoginInfo := new(steam.LogOnDetails)
myLoginInfo.Username = "st34nick"
myLoginInfo.Password = "434"
client := steam.NewClient()
steam.InitializeSteamDirectory()
client.Connect()
for event := range client.Events() {
switch e := event.(type) {
case *steam.ConnectedEvent:
log.Println("SteamBot connected to server")
client.Auth.LogOn(myLoginInfo)
log.Println("Trying to Auth")
case *steam.MachineAuthUpdateEvent:
log.Println("Use sentry")
ioutil.WriteFile("sentry", e.Hash, 0666)
case *steam.LoggedOnEvent:
log.Println("SteamBot succesfully auth")
client.Social.SetPersonaState(steamlang.EPersonaState_Online)
case steam.FatalErrorEvent:
log.Print(e)
case error:
log.Print(e)
}
}
}
In console
2016/01/18 18:06:43 SteamBot connected to server
2016/01/18 18:06:43 Trying to Auth
And thats all, then nothing help, i think i loose some event in auth
I suggest you to add case for steam.LogOnFailedEvent
case *steam.LogOnFailedEvent:
log.Println(e)
Then you will be able to see what exactly failed during the authentication process.
Ty man, i forgot about twoFactorAuth, okay now all good, thank you very, much, i will do example and post here for new ppl who use go-steam
That would be appriciated a lot, I'm sure of that. ;)
Slacki, okay, can u help, how can i send tradeoffer, i dont understand how i should create tradeoffer.Client
Sorry mate, haven't tried that yet, cannot help you there.
case *steam.WebSessionIdEvent:
client.Web.LogOn()
case *steam.WebLoggedOnEvent:
offerClient = tradeoffer.NewClient(tradeoffer.APIKey(botConfig.APIKey), client.Web.SessionId, client.Web.SteamLogin, client.Web.SteamLoginSecure)
This should be fixed by a995980. The server list has been updated and the API is a bit more clear what connects to what and how.
Connect failed: dial tcp 209.197.29.196:27017: getsockopt: connection timed out and thats all