From fb3b0be50e3e91efe5ca3abffba1dc3e0208426a Mon Sep 17 00:00:00 2001 From: rubenwardy Date: Wed, 3 Feb 2021 18:30:21 +0000 Subject: [PATCH] Update minetest_client.md docs --- app/flatpages/help/api.md | 2 +- docs/minetest_client.md | 41 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+), 1 deletion(-) diff --git a/app/flatpages/help/api.md b/app/flatpages/help/api.md index c1eaff9..6805ef6 100644 --- a/app/flatpages/help/api.md +++ b/app/flatpages/help/api.md @@ -47,7 +47,7 @@ Tokens can be attained by visiting [Settings > API Tokens](/user/tokens/). * `name`: Technical name (needs permission if already approved). * `short_description` * `tags`: List of tag names, see [misc](#misc). - * `content_Warnings`: List of content warning names, see [misc](#misc). + * `content_warnings`: List of content warning names, see [misc](#misc). * `license`: A license name. * `media_license`: A license name. * `long_description`: Long markdown description. diff --git a/docs/minetest_client.md b/docs/minetest_client.md index ec1f42c..80373d3 100644 --- a/docs/minetest_client.md +++ b/docs/minetest_client.md @@ -58,6 +58,47 @@ This supports redirects. The client will edit the .conf of the installed content to add `author`, `name`, and `release` to track the installed release to detect updates in the future. +## Resolving Dependencies + +### Short version + +Minetest uses `/api/packages///dependencies/?only_hard=1` to find out the hard +dependencies for a package. + +Then, it resolves each dependency recursively. + +Say you're resolving for `basic_materials`, then it will attempt to find the mod in this order: + +1. It first checks installed mods in the game and mods folder (ie: `mods/basic_materials/`) +2. Then it looks on ContentDB for exact name matches (ie: `VanessaE/basic_materials`) +3. Then it looks on ContentDB for modpacks which contain (=provides) the modname + (ie: `VanessaE/dreambuilder`) + +### Long version + +When installing a package, an API request is made to ContentDB to find out the dependencies. +If there are no dependencies, then the mod is installed straight away. + +If there are dependencies, it will resolve them and show a dialog with a list of mods to install. + +Resolving works like this: + +1. Fetch dependencies for the package from ContentDB's API +2. For each hard dependency: + 1. Check current game, exit if dep found + 2. Check installed mods, exit if found + 3. Check available mods from ContentDB: + 1. Choose a package to install. Prefer higher scores and exact base name matches + (rather than modpacks). + 2. Resolve dependencies for this package - ie, goto 1. + +The ContentDB API is a dictionary of packages to dependencies. +The dictionary will allow ContentDB to prefetch dependencies without any client changes. +For example, say you request the dependencies for Mobs Monster. +It's pretty likely that the next request you'll make is for Mobs Redo, and so ContentDB can prevent +the need for another request by including the dependency information for Mobs Redo in the +response for Mobs Monster. + ## View in browser The client will open the package in a browser by constructing the following URL