Closed Hexer10 closed 5 years ago
I tought I've solved this but I'm getting again the errors
Hey I am also getting an error like this. How can we fix this?
Connecting to random server.
Error: Connect failed: dial tcp 208.78.164.11:27019: connect: connection timed out
EDIT: I guess the IP list is out of date and this has not been ported to the go codebase https://github.com/SteamRE/SteamKit/pull/293 ?
EDIT2:
Turns out the issue is indeed, that pretty much the whole IP list in servers.go
is outdated. Normally after the first connection a serverlist.json
with up-to-date IPs is being generated and used thereafter, but that does not help on the initial login.
So what I did was copy the IPs from https://api.steampowered.com/ISteamDirectory/GetCMList/v1/?cellid=0 into servers.go
and delete the old ones.
Then when the iniital login succeeds, you also get a fresh serverlist.json
each time.
Yeah, the IP list needs to be updated periodically. I am happy to accept pull requests for this.
I don't know if it would cause any issues, but could we just request a new list of IPs every time we try connecting to the steam servers?
Yeah not sure either, I mean the server list is publicly accessable over the api I linked above.
Actually, I think we already have an implementation for fetching the server list: InitializeSteamDirectory. So a call to this function for the first Connect()
is also possible.
A simple change around here to something like
if !steamDirectoryCache.IsInitialized() {
InitializeSteamDirectory()
}
if steamDirectoryCache.IsInitialized() {
server = steamDirectoryCache.GetRandomCM()
} else {
server = GetRandomCM()
}
should fix the problem.
I've both updated the IP list and added automatic Steam Directory fetching, which should solve the problem. Thanks for the reports!
When I call
Sometimes it works but then I get this error:
or sometimes is throws an error on
client.Connect()
:How can I solve this?