Thread: Cache downloader patch

Page 1 of 2 12 LastLast
Results 1 to 10 of 18
  1. #1 Cache downloader patch 
    Registered Member
    excl150's Avatar
    Join Date
    Jul 2014
    Posts
    122
    Thanks given
    44
    Thanks received
    29
    Rep Power
    97
    Hello,

    I tried to use a tool to download RuneScape's latest cache: revision 916. RuneScape made some small js5 protocol changes.
    Original tool can be found here: [Only registered and activated users can see links. ].
    Everything I fixed directly came from a C# cache tool made by [Only registered and activated users can see links. ] project: [Only registered and activated users can see links. ].

    Disclaimer: I am unsure if this was all that needed to change in the original RSCD because I have no way of validating the cache at the moment. I will update this post as soon as I find out if more needs fixing.

    1. Increase the loading requirements to 28. (Js5Worker.java)
    Code:
    public static final int LOADING_REQUIREMENTS = 28;
    2. Increase the output buffer capacity to 10 bytes from the previous 6 bytes. (Js5Worker.java - constructor)
    Code:
    public Js5Worker() {
    	requests = new LinkedList<FileRequest>();
    	waiting = new HashMap<Long, FileRequest>();
    	state = State.DISCONNECTED;
    	outputBuffer = ByteBuffer.allocate(10);
    	inputBuffer = ByteBuffer.allocate(5);
    }
    3. Change the client connection info. (Js5Worker.java - sendConnectionInfo())
    Code:
    private void sendConnectionInfo() {
    	try {
    		outputBuffer.put((byte) 6);
    		putMedInt(outputBuffer, 0x000005);
    		outputBuffer.putShort((short) 0);
    		outputBuffer.putShort((short) this.major);
    		outputBuffer.putShort((short) 0);
    		output.write(outputBuffer.array());
    		output.flush();
    		outputBuffer.clear();
    
    		outputBuffer.put((byte) 3);
    		putMedInt(outputBuffer, 0x000005);
    		outputBuffer.putShort((short) 0);
    		outputBuffer.putShort((short) this.major);
    		outputBuffer.putShort((short) 0);
    		output.write(outputBuffer.array());
    		output.flush();
    		outputBuffer.clear();
    	} catch (IOException ioex) {
    		ioex.printStackTrace();
    	}
    }
    4. Change the file request output buffer to match the protocol changes made in the connection info method. (Js5Worker process())
    You can find this code inside the final else block in the process() method, around line 172.
    Code:
    while (!requests.isEmpty() && waiting.size() < 20) {
    	FileRequest request = requests.poll();
    					
    	byte unknown = 0x01;
    	if (request.getIndex() == 255 && request.getFile() == 255) {
    		unknown = 0x21;
    	}
    					
    	outputBuffer.put(unknown);
    	outputBuffer.put((byte) request.getIndex());
    	outputBuffer.putInt(request.getFile());
    	outputBuffer.putShort((short) this.major);
    	outputBuffer.putShort((short) 0);
    	output.write(outputBuffer.array());
    	output.flush();
    	outputBuffer.clear();
    
    	waiting.put(request.hash(), request);
    }
    5. Change the URL where the key is extracted from. (CacheDownloader.java - connect())
    If you decide to change the URL you can remove the "WORLD" constant because it's not used anywhere else.
    Code:
    String key = Crawler.extractParameter(Crawler.downloadPage("https://world21.runescape.com/j0"), 32);
    This should fix the RSCD tool to support the more recent revisions of RuneScape.
    If anyone spots anything I've missed or did wrong, let me know and I'll try to fix it.

    Thanks to:
    - Melvin for telling me the protocol changed.
    - Villermen for making a really nice tool that is up to revision 915 (made my life really easy :])
    - Method for this really well made cache downloader
    Reply With Quote  
     

  2. Thankful users:


  3. #2  
    Cywir RS3 - Coming soon

    Scythe's Avatar
    Join Date
    Apr 2019
    Posts
    280
    Thanks given
    67
    Thanks received
    91
    Rep Power
    764
    Nice contribution

    The ultimate RuneScape 3 private server experience.
    View the Project thread
    [Only registered and activated users can see links. ]

    Disclaimer: account sometimes used by NoX
    Reply With Quote  
     

  4. #3  
    Registered Member
    Melvin's Avatar
    Join Date
    Aug 2011
    Posts
    951
    Thanks given
    461
    Thanks received
    272
    Rep Power
    831
    There ya go


    A creative man is motivated by the desire to achieve, not by the desire to beat others.


    ― Ayn Rand
    Reply With Quote  
     

  5. #4  
    Registered Member
    excl150's Avatar
    Join Date
    Jul 2014
    Posts
    122
    Thanks given
    44
    Thanks received
    29
    Rep Power
    97
    Quote Originally Posted by Scythe View Post
    Nice contribution
    Thanks

    Quote Originally Posted by Melvin View Post
    There ya go
    Reply With Quote  
     

  6. #5  
    Chemist

    Advocatus's Avatar
    Join Date
    Dec 2009
    Age
    28
    Posts
    2,526
    Thanks given
    192
    Thanks received
    746
    Rep Power
    1315
    I had to change the URL used in the connect method to
    Code:
    String key = Crawler.extractParameter(Crawler.downloadPage("https://world21.runescape.com/j0"), 32);
    as per [Only registered and activated users can see links. ]

    It wasn't extracting the key successfully.
    Previously the string was
    Code:
    "http://world" + WORLD + ".runescape.com/g=runescape/,j0"
    Quote Originally Posted by blakeman8192 View Post
    Quitting is the only true failure.
    Reply With Quote  
     

  7. Thankful users:


  8. #6  
    Registered Member
    excl150's Avatar
    Join Date
    Jul 2014
    Posts
    122
    Thanks given
    44
    Thanks received
    29
    Rep Power
    97
    Quote Originally Posted by Advocatus View Post
    I had to change the URL used in the connect method to
    Code:
    String key = Crawler.extractParameter(Crawler.downloadPage("https://world21.runescape.com/j0"), 32);
    as per [Only registered and activated users can see links. ]

    It wasn't extracting the key successfully.
    Previously the string was
    Code:
    "http://world" + WORLD + ".runescape.com/g=runescape/,j0"
    Oh weird, I didn't change mine but I did get the full cache downloaded.
    I'm adding this and changing this in my local version of the tool, thank you!
    Reply With Quote  
     

  9. #7  
    Registered Member
    Teemuzz's Avatar
    Join Date
    Oct 2009
    Posts
    2,710
    Thanks given
    1,131
    Thanks received
    400
    Rep Power
    701
    GJ upgrading the downloader
    I'm back.
    ScapeEmulator #592 Convert [Only registered and activated users can see links. ]/[Only registered and activated users can see links. ]
    [Only registered and activated users can see links. ]
    [Only registered and activated users can see links. ]
    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  10. #8  
    Registered Member
    Join Date
    Nov 2020
    Posts
    31
    Thanks given
    3
    Thanks received
    11
    Rep Power
    12
    13412: Connection reset

    Error downloading 40,13413: Connection reset
    Reply With Quote  
     

  11. #9  
    Registered Member
    excl150's Avatar
    Join Date
    Jul 2014
    Posts
    122
    Thanks given
    44
    Thanks received
    29
    Rep Power
    97
    Quote Originally Posted by Ampersand View Post
    13412: Connection reset

    Error downloading 40,13413: Connection reset
    I downloaded my cache without music, not sure why it can't download the music data.
    I'll try and see why this happens.
    Reply With Quote  
     

  12. #10  
    ᗪ乇尺乇乙乙乇ᗪ

    lumplum's Avatar
    Join Date
    Nov 2015
    Posts
    1,121
    Thanks given
    484
    Thanks received
    1,371
    Rep Power
    5000
    Thanks for this
    [Only registered and activated users can see links. ]
    Reply With Quote  
     

Page 1 of 2 12 LastLast

Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. Auto Cache Downloading
    By James in forum Tutorials
    Replies: 113
    Last Post: 09-27-2008, 04:25 PM
  2. Auto Cache Downloading (Here's how!)
    By Ninja Cat in forum Tutorials
    Replies: 22
    Last Post: 03-11-2008, 02:50 PM
  3. 417 cache download!
    By Mr.Andrew Gover in forum RS2 Client
    Replies: 14
    Last Post: 12-15-2007, 07:25 PM
  4. Auto Cache download?
    By Eportal in forum Tutorials
    Replies: 4
    Last Post: 10-07-2007, 06:34 PM
  5. Buying Auto cache downloading webclient
    By wildy in forum RS2 Client
    Replies: 2
    Last Post: 08-24-2007, 03:40 AM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •