package jLobbyClient; import java.net.*; import java.io.*; public class jLobbyClient { private final static char sep = (char)169; private final static String host = "rr.soldat.pl"; public static void main (String[] args) { loadServers(); } public static void loadServers () { Socket sock = null; BufferedReader in = null; DataOutputStream out = null; String line; String[] parts; try { sock = new Socket(host,13073); in = new BufferedReader(new InputStreamReader(sock.getInputStream(), "ISO-8859-1")); out = new DataOutputStream(sock.getOutputStream()); out.writeBytes( ""+(char)101+sep+ // init "0"+sep+ // version "0"+sep+ // ded "0"+sep+ // pass "0"+sep+ // bots "0"+sep+ // surv "0"+sep+ // real "0"+sep+ // bonus "0"+sep+ // adv "0"+sep+ // wm "0"+sep+ // full "0"+sep+ // empty "-1"+sep+ // gametype "0"+ // be "\n" ); while ((line = in.readLine()) != null) { if (line.charAt(0) != 103) continue; parts = line.split(""+sep); System.out.println( "1."+parts[1].charAt(0)+"."+parts[1].charAt(1) + "\t" + parts[19]+"\t"+ parts[2]+":"+parts[3]+"\t"+ parts[8]+"\t\t"+parts[7] ); } } catch (Exception e) { e.printStackTrace(); } finally { try { out.close(); in.close(); sock.close(); } catch (Exception e) {} } } }