2018-07-03 08:59:44 -04:00
|
|
|
# Ondemand protocol
|
2018-07-03 00:31:18 -04:00
|
|
|
|
2018-07-03 08:59:44 -04:00
|
|
|
The Ondemand protocol is used to stream updates to the cache.
|
|
|
|
The client knows which files to update from the CRC file downloaded
|
|
|
|
using the [JAGGRAB Protocol](./JAGGRAB-Protocol.html).
|
2018-07-03 00:31:18 -04:00
|
|
|
|
2018-07-03 08:59:44 -04:00
|
|
|
## Request format
|
2018-07-03 00:31:18 -04:00
|
|
|
|
|
|
|
The client first authenticates as an ondemand client by using the opcode
|
|
|
|
'15' (as opposed to the game, which uses the type '14').
|
|
|
|
|
|
|
|
The format of the request is:
|
|
|
|
|
2018-07-03 08:59:44 -04:00
|
|
|
```
|
|
|
|
unsigned byte cacheId;
|
|
|
|
unsigned short fileId;
|
|
|
|
unsigned byte priority;
|
|
|
|
```
|
2018-07-03 00:31:18 -04:00
|
|
|
|
2018-07-03 08:59:44 -04:00
|
|
|
Furthermore, there can be multiple requests per session.
|
2018-07-03 00:31:18 -04:00
|
|
|
|
2018-07-03 08:59:44 -04:00
|
|
|
## Response format
|
2018-07-03 00:31:18 -04:00
|
|
|
|
|
|
|
The response is sent in blocks. The maximum size of a block is 500
|
2018-07-03 08:59:44 -04:00
|
|
|
bytes. Smaller blocks (e.g. towards the end of a file) are permitted.
|
|
|
|
|
|
|
|
The format of a block is:
|
|
|
|
```
|
|
|
|
unsigned byte cacheId;
|
|
|
|
unsigned short fileId;
|
|
|
|
unsigned short fileSize;
|
|
|
|
unsigned byte blockNumber;
|
|
|
|
unsigned byte[] blockData;
|
|
|
|
```
|