Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.io.IOException;
- import java.net.Socket;
- import java.nio.ByteBuffer;
- public class RSRevisionChecker {
- private static int findRS2Revision() throws IOException {
- int clientNo = 599;
- boolean success = false;
- ByteBuffer out = ByteBuffer.allocate(5);
- while (!success) {
- Socket socket = new Socket("world119.runescape.com", 43594);
- out.put((byte) 15);
- out.putInt(clientNo);
- socket.getOutputStream().write(out.array(), 0, 5);
- int rsp = socket.getInputStream().read();
- if (rsp == 0) {
- success = true;
- } else {
- socket.close();
- clientNo++;
- }
- out.clear();
- }
- return clientNo;
- }
- public static void main(String[] args) {
- try {
- System.out.println("Current RS Revision: "+findRS2Revision());
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement