Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connection timeout #141

Open
RandomNick2 opened this issue Jun 6, 2024 · 1 comment
Open

Connection timeout #141

RandomNick2 opened this issue Jun 6, 2024 · 1 comment

Comments

@RandomNick2
Copy link

Connection timeout but i have good network

 package main

import (
	"fmt"
	"github.com/Philipp15b/go-steam"
	"github.com/Philipp15b/go-steam/protocol/steamlang"
	"log"
)

func main() {
	fmt.Println("started")
	loginInfo := new(steam.LogOnDetails)
	loginInfo.Username = "xozihox283"
	loginInfo.Password = "tj3JXH39"

	client := steam.NewClient()
	client.ConnectEurope()

	for event := range client.Events() {
		switch e := event.(type) {
		case *steam.ConnectedEvent:
			fmt.Println("connected")
			client.Auth.LogOn(loginInfo)
		case *steam.LoggedOnEvent:
			fmt.Println("LoggedOn")
			client.Social.SetPersonaState(steamlang.EPersonaState_Online)
		case steam.FatalErrorEvent:
			log.Print(e)
		case error:
			log.Print(e)
		}
	}
}

go run main.go
started
2024/06/06 18:04:47 Connect failed: dial tcp 146.66.152.14:27017: connect: operation timed out

@RandomNick2
Copy link
Author

RandomNick2 commented Jun 6, 2024

`
def bootstrap_from_webapi(self, cell_id=0):
"""
Fetches CM server list from WebAPI and replaces the current one

    :param cellid: cell id (0 = global)
    :type cellid: :class:`int`
    :return: booststrap success
    :rtype: :class:`bool`
    """
    self._LOG.debug("Attempting bootstrap via WebAPI")

    from steam import webapi
    try:
        resp = webapi.get('ISteamDirectory', 'GetCMList', 1, params={'cellid': cell_id,
                                                                     'http_timeout': 3})
    except Exception as exp:
        self._LOG.error("WebAPI boostrap failed: %s" % str(exp))
        return False

    result = EResult(resp['response']['result'])

    if result != EResult.OK:
        self._LOG.error("GetCMList failed with %s" % repr(result))
        return False

    serverlist = resp['response']['serverlist']
    self._LOG.debug("Received %d servers from WebAPI" % len(serverlist))

    def str_to_tuple(serveraddr):
        ip, port = serveraddr.split(':')
        return str(ip), int(port)

    self.clear()
    self.cell_id = cell_id
    self.merge_list(map(str_to_tuple, serverlist))

    return True`
    
   I think you need to add something like this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant