RECENT NEWS
📢 𝟑𝟎% Discount for all ads only this month ❄️

JAGGRAB Protocol

Venom
power_settings_new
Seen 4 months ago
Rune Warrior (33/40)
Rune Warrior
0
0
0
33 Posts
Posts
0
Warning level
0
Likes
0
Dislikes
Joined: 2022-04-24

I haven't posted here in a long time. However, recently I was browsing Github and Rune-Server looking into the current frameworks and servers being developed. I noticed most of these servers don't make use of the JAGGRAB protocol. I also noticed that there are very few sources of documentation for the JAGGRAB protocol online. Simply googling the term JAGGRAB will only provide one or two viable results. I believe more people would make use of this service if they could see it in a simplified format.

Ive written a small implementation to help put this into perspective. This is written as an example and does not reflect my programming style.
https://github.com/dylanvicc/Jaggrab...on/net/jaggrab

I've also included a sample network infrastructure for all the necessary encoders & decoders to help demonstrate how all the client's protocol fits together.
https://github.com/dylanvicc/Aranea/...com/aranea/net

What is JAGGRAB?
JAGGRAB is the text based protocol that RuneScape clients use to request files from the server. This eliminates the need to have a user download a cache manually from an online source via the client. Every request is sent to the server in the form of a string and prefixed with the text JAGGRAB.

Code:
String request = StandardCharsets.UTF_8.decode(buffer).toString();

Once the server receives this request it then writes the appropriate data back to the client. The requests are broken up as follows.

Code:
"/crc" requests the cyclical redundancy checks for the files.
"/title" requests the tile screen components. 
"/config" requests the configuration files.
"/interface" requests the interface file.
"/media" requests the media files.
"/textures" request the textures.
"/wordenc" requests the chat filter.
"/sounds" requests the audio files.

Every-time the client makes a request, it does so on a new socket connection. This means you will either need to manually close the connected socket after a file request is served or implement a time-out procedure. These connections will generally be serviced on the port 43595. Unlike the Ondemand protocol which functions on the same server as the actual game service, the JAGGRAB protocol runs on it's own server.

CRC Checks
The CRC checks are generated on the server's end and written as the first request in the protocol. These are written first as their purpose is to help detect any illegal modifications or inconsistencies in data. These checks are relatively simple to generate and each attached to a file. Each individual checksum is written back as an integer. A final singular hash code of the checksums is then written as well.

File Data Structure
The protocol for reading from specific files.

Code:
length : tri-byte (3 bytes)
block : tri-byte (3 bytes)

next_file : unsigned short (2 bytes)
current_chunk : unsigned short (2 bytes)
next_block : tri-byte (3 bytes)
next_type : unsigned byte (1 byte)
00
  • Like
Reactions: