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
356 stars 67 forks source link

Extract a single information from object of class GoldSrcServer or ServerInfo (Java) #242

Closed ghost closed 10 years ago

ghost commented 10 years ago

Thank you very much for the library, and thank you that you keep it up to date. I have questions (Java): Can I extract a single information from object of class GoldSrcServer or ServerInfo?: (gameId, dedicated, networkVersion, maxPlayers, serverName, secure, serverPort, gameDir, operatingSystem, serverId, numberOfPlayers, appId, numberOfBots, passwordProtected, gameVersion, gameDescription, mapName)

Like this: GoldSrcServer temp_server = new GoldSrcServer("127.0.0.1", 27011); temp_server.initialize(); System.out.println(temp_server.getserverName().toString); // For extract a serverName OR AS: System.out.println(temp_server.getServerInfo().getmapName().toString()); // For extract a mapName

ghost commented 10 years ago

Sorry to trouble. Solution: System.out.println(temp_server.getServerInfo().get("serverName")); // For extract a serverName