Actions

Old Engine/On Demand Protocol: Difference between revisions

From RuneWiki

No edit summary
No edit summary
Line 5: Line 5:


==Handshaking==
==Handshaking==
The client begins by sending a single byte, 15.
The server should respond with eight bytes. Their values are ignored, but send 0s here anyways.
After this point the client stream is dedicated to on demand requests and will begin requesting missing data from the server.
== Processing ==
Each request looks like this, and there may be multiple requests appended in a single read:
* First byte is the index
* Second word is the entry
* Third byte is the priority
The priority field has 3 possible values:
* 2: loading core files
* 1: preloading extra files
* 0: loading file in-game
== Responding ==
The client will read up to 506-bytes from the server at a time. 6 bytes are used for the file part header and up to 500 bytes are used for the file data. If a file is longer than 500 bytes (very likely) then the file must be sent in 500-byte increments.
File parts may be sent over time and do not need to be sent sequentially. This helps decrease the load on the server assuming it gets processed over time.
The response looks like this:
* First byte is the index
* Second and third byte is the entry
* Fourth and fifth byte is the total file size
* Sixth byte is the part number
* The remaining (up to) 500 bytes is the file part data

Revision as of 23:46, 6 September 2021

Resources

Data Types

Old Engine/File Store

Handshaking

The client begins by sending a single byte, 15.

The server should respond with eight bytes. Their values are ignored, but send 0s here anyways.

After this point the client stream is dedicated to on demand requests and will begin requesting missing data from the server.

Processing

Each request looks like this, and there may be multiple requests appended in a single read:

  • First byte is the index
  • Second word is the entry
  • Third byte is the priority

The priority field has 3 possible values:

  • 2: loading core files
  • 1: preloading extra files
  • 0: loading file in-game

Responding

The client will read up to 506-bytes from the server at a time. 6 bytes are used for the file part header and up to 500 bytes are used for the file data. If a file is longer than 500 bytes (very likely) then the file must be sent in 500-byte increments.

File parts may be sent over time and do not need to be sent sequentially. This helps decrease the load on the server assuming it gets processed over time.

The response looks like this:

  • First byte is the index
  • Second and third byte is the entry
  • Fourth and fifth byte is the total file size
  • Sixth byte is the part number
  • The remaining (up to) 500 bytes is the file part data