|
| 1 | +--- |
| 2 | +title: Download internals |
| 3 | +--- |
| 4 | + |
| 5 | +Drop uses a special method to download over HTTP to ensure fast and reliable downloads, while achieving the goals of the [Depot API](https://developer.droposs.org/web/depot#notes). Here's how they work |
| 6 | + |
| 7 | +## Game manifest |
| 8 | + |
| 9 | +On importing a version, Drop generates a "game manifest". You can read more about it on the [Depot API section](https://developer.droposs.org/web/depot#manifest-v2), but what it means for non-developer is that **downloads stay the same speed no matter how many files there are, or how big they are.** |
| 10 | + |
| 11 | +Typical file transfer protocols, like FTP or HTTP, make one request for each file. This is great if you have just one, large file, but if you have lots of little ones, you lose a lot of bandwidth to overhead. Drop minimises this by packing smaller files into larger chunks. |
| 12 | + |
| 13 | +Drop also splits larger files into several, smaller chunks. This is to ensure proper balancing of downloads, and make the chunks easier to manage (since they all are roughly the same size). |
| 14 | + |
| 15 | +:::note |
| 16 | +Due to limitations with 7zip, this is **not true for archive-backed versions.** Drop cannot read parts of files with 7zip, so large files must stay in their own, equally large chunk. |
| 17 | +::: |
| 18 | + |
| 19 | +:::tip |
| 20 | + |
| 21 | +### What's `torrential`? |
| 22 | + |
| 23 | +If you've built the Drop server from source, or checked out the logs in the container, you may have noticed an applcation called `torrential`. `torrential` is a download server that's embedded into Drop, and serves the chunks required for the Depot API, without actually assembling them ahead of time. |
| 24 | +::: |
| 25 | + |
| 26 | +## Delta versions or "Update mode" |
| 27 | + |
| 28 | +While called "update mode" in the UI, internally they are called "delta versions". In practice, they apply files on top of each other, essentially patching previous versions. |
| 29 | + |
| 30 | +However, if you've been paying attention, we don't actually need to do this physically on disk, we can just create a "pseudo-manifest" that pulls chunks from both versions. |
| 31 | + |
| 32 | +The catch is, we can't control what files are packed into each chunk (we can, but we won't know what files will be patched ahead of time, when we're importing). So while we can drop chunks here and there, _if and only if every file has been patched by another version_, we usually end up downloading the entirety of the base version + the patch. |
0 commit comments