koraktor / steam-condenser

A multi-language library for querying the Steam Community, Source, GoldSrc servers and Steam master servers
https://koraktor.de/steam-condenser
Other
358 stars 66 forks source link

TimeoutException on Querying master servers #218

Closed heisenbergman closed 11 years ago

heisenbergman commented 11 years ago

I just used the usage code from http://koraktor.de/steam-condenser/usage outright, and I'm getting a TimeoutException. Here's the code:

import java.net.InetSocketAddress;
import java.util.Random;
import java.util.Vector;
import java.util.concurrent.TimeoutException;
import com.github.koraktor.steamcondenser.exceptions.SteamCondenserException;
import com.github.koraktor.steamcondenser.steam.servers.GoldSrcServer;
import com.github.koraktor.steamcondenser.steam.servers.MasterServer;

public class SteamApp {

    public static void main(String args[]){
        try {
            Random randomizer = new Random();
            MasterServer master = new MasterServer(MasterServer.GOLDSRC_MASTER_SERVER);   
            Vector<InetSocketAddress> servers = master.getServers();
            InetSocketAddress randomServer = servers.elementAt(randomizer.nextInt(servers.size()));
            GoldSrcServer server = new GoldSrcServer(randomServer.getAddress(), randomServer.getPort());
        } catch (SteamCondenserException e) {
            e.printStackTrace();
        } catch (TimeoutException e) {
            e.printStackTrace();
        }
    }
}

And here's the output from the console:

Jul 17, 2013 9:46:24 AM com.github.koraktor.steamcondenser.steam.sockets.QuerySocket send
INFO: Sending data packet of type "A2M_GET_SERVERS_BATCH2_Paket"
Jul 17, 2013 9:46:25 AM com.github.koraktor.steamcondenser.steam.servers.MasterServer getServers
INFO: Request to master server hl1master.steampowered.com/208.64.200.117 timed out, retrying...
Jul 17, 2013 9:46:25 AM com.github.koraktor.steamcondenser.steam.sockets.QuerySocket send
INFO: Sending data packet of type "A2M_GET_SERVERS_BATCH2_Paket"
Jul 17, 2013 9:46:26 AM com.github.koraktor.steamcondenser.steam.servers.MasterServer getServers
INFO: Request to master server hl1master.steampowered.com/208.64.200.117 timed out, retrying...
Jul 17, 2013 9:46:26 AM com.github.koraktor.steamcondenser.steam.sockets.QuerySocket send
INFO: Sending data packet of type "A2M_GET_SERVERS_BATCH2_Paket"
Jul 17, 2013 9:46:27 AM com.github.koraktor.steamcondenser.steam.servers.MasterServer getServers
INFO: Request to master server failed, retrying hl1master.steampowered.com/208.64.200.118...
Jul 17, 2013 9:46:27 AM com.github.koraktor.steamcondenser.steam.sockets.QuerySocket send
INFO: Sending data packet of type "A2M_GET_SERVERS_BATCH2_Paket"
Jul 17, 2013 9:46:28 AM com.github.koraktor.steamcondenser.steam.servers.MasterServer getServers
INFO: Request to master server hl1master.steampowered.com/208.64.200.118 timed out, retrying...
Jul 17, 2013 9:46:28 AM com.github.koraktor.steamcondenser.steam.sockets.QuerySocket send
INFO: Sending data packet of type "A2M_GET_SERVERS_BATCH2_Paket"
Jul 17, 2013 9:46:29 AM com.github.koraktor.steamcondenser.steam.servers.MasterServer getServers
INFO: Request to master server hl1master.steampowered.com/208.64.200.118 timed out, retrying...
Jul 17, 2013 9:46:29 AM com.github.koraktor.steamcondenser.steam.sockets.QuerySocket send
INFO: Sending data packet of type "A2M_GET_SERVERS_BATCH2_Paket"
java.util.concurrent.TimeoutException
    at com.github.koraktor.steamcondenser.steam.sockets.SteamSocket.receivePacket(SteamSocket.java:112)
    at com.github.koraktor.steamcondenser.steam.sockets.MasterServerSocket.getReply(MasterServerSocket.java:49)
    at com.github.koraktor.steamcondenser.steam.servers.MasterServer.getServers(MasterServer.java:277)
    at com.github.koraktor.steamcondenser.steam.servers.MasterServer.getServers(MasterServer.java:197)
    at SteamApp.main(SteamApp.java:16)

Any idea what might be the problem? Should the code as posted above work?

koraktor commented 11 years ago

It seems like the old master servers at hl1master.steampowered.com have been shut down. Currently I have no idea if they'll ever come back as Steam itself and the old GoldSrc games use a different protocol and other servers for this.

I'll let you know once I have more information.

heisenbergman commented 11 years ago

Thanks for the reply!

Does this mean that Steam Condenser is of no use now that the servers are shut down? :(

EDIT: I guess what I'm asking is if there's other ways of using Steam Condenser with Java to get data from Steam other than through querying the servers :) Thanks!

koraktor commented 11 years ago

This problem only affects GoldSrc servers. You're still able to query them if you know the IP. Source servers can still be aquired from their master servers (SourceServer.getMaster()), too. Additionally there are lots of community features.

heisenbergman commented 11 years ago

^ Thanks! Will try to figure out how to do those :)

koraktor commented 11 years ago

Use the following until a fix arrives:

MasterServer master = new MasterServer("hl1master.steampowered.com:27011");