Skip to content

Commit 82bb84a

Browse files
committed
feat: add download reference and importing update
1 parent 72be4f3 commit 82bb84a

3 files changed

Lines changed: 85 additions & 1 deletion

File tree

astro.config.mjs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export default defineConfig({
1515
starlightImageZoom(),
1616
],
1717
title: "Drop OSS",
18-
logo: { src: "./src/assets/wordmark.png", replacesTitle: true},
18+
logo: { src: "./src/assets/wordmark.png", replacesTitle: true },
1919
social: [
2020
{
2121
icon: "github",
@@ -47,6 +47,10 @@ export default defineConfig({
4747
{ slug: "admin/guides/import-version" },
4848
],
4949
},
50+
{
51+
label: "Going further",
52+
items: [{ slug: "admin/going-further/importing-update" }],
53+
},
5054
{
5155
label: "Metadata",
5256
autogenerate: { directory: "admin/metadata" },
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
---
2+
title: Importing an update
3+
---
4+
5+
import { Steps } from "@astrojs/starlight/components";
6+
7+
If you're using a library source that supports versioning, you can add and import an update for your game! There are two ways to do it:
8+
9+
- Overwrite: completely overwrites the previous version. Simpliest to understand and use.
10+
- Update-mode: patches the previous version's files, while providing new configuration.
11+
12+
## Overwrite
13+
14+
<Steps>
15+
1. ### Add your new files
16+
17+
Add your new files, making note of the folder structure of your library source.
18+
19+
2. ### Follow the import guide again
20+
21+
Follow the [import guide again](/admin/guides/import-version/), but this time for your new version folder.
22+
23+
</Steps>
24+
25+
## Update mode
26+
27+
You may noticed a toggle in the version import UI called "update mode". This enables update mode, which:
28+
29+
- takes the files from your new version
30+
- takes the files from your old version
31+
- pastes the new files over the old files, overwriting where they conflict
32+
33+
You can stack many "update mode" versions on top of each other, and they will pick up files from all of them.
34+
35+
<Steps>
36+
1. ### Add your new files
37+
38+
Add your new files, making note of the folder structure of your library source.
39+
40+
2. ### Follow the import guide again
41+
42+
Follow the [import guide again](/admin/guides/import-version/), but this time for your new version folder.
43+
44+
3. ### Before import, enable update mode
45+
46+
Click the toggle for "Update mode"
47+
48+
</Steps>
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
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

Comments
 (0)