From d065eed63e387c19bc2bc5348bc18cffd56f826c Mon Sep 17 00:00:00 2001 From: heinezen Date: Tue, 10 Oct 2023 16:42:50 +0200 Subject: [PATCH 1/6] doc: Clarify version field usage in modpack info. --- doc/media/openage/modpack_definition_file.md | 29 +++++++++++--------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/doc/media/openage/modpack_definition_file.md b/doc/media/openage/modpack_definition_file.md index a9ff6d6a41..3403949dd6 100644 --- a/doc/media/openage/modpack_definition_file.md +++ b/doc/media/openage/modpack_definition_file.md @@ -31,19 +31,22 @@ The following parameters have to be specified. `[info]` contains general information about the modpack. -| Parameter | Data Type | Optional | Description | -| ------------------ | ------------- | -------- | ------------------------------------------------------------------------ | -| `packagename` | String | No | Name of the modpack. | -| `version` | String | No | Internal version number. Must have [semver](https://semver.org/) format. | -| `versionstr` | String | Yes | Human-readable version string. | -| `repo` | String | Yes | Name of the repo where the package is hosted. | -| `alias` | String | Yes | Alias of the modpack. Aliases can be used for replacing other modpacks. | -| `title` | String | Yes | Title used in UI. | -| `description` | String | Yes | Path to a file with a short description (max 500 chars). | -| `long_description` | String | Yes | Path to a file with a detailed description. | -| `url` | String | Yes | Link to the modpack's website. | -| `license` | Array[String] | Yes | License(s) of the modpack. | - +| Parameter | Data Type | Optional | Description | +| ------------------ | ------------- | -------- | ----------------------------------------------------------------------- | +| `packagename` | String | No | Name of the modpack. | +| `version`\* | String | No | The modpack's internal version number. Must use [semver] format. | +| `versionstr`\* | String | Yes | Human-readable version string. | +| `repo` | String | Yes | Name of the repo where the package is hosted. | +| `alias` | String | Yes | Alias of the modpack. Aliases can be used for replacing other modpacks. | +| `title` | String | Yes | Title used in UI. | +| `description` | String | Yes | Path to a file with a short description (max 500 chars). | +| `long_description` | String | Yes | Path to a file with a detailed description. | +| `url` | String | Yes | Link to the modpack's website. | +| `license` | Array[String] | Yes | License(s) of the modpack. | + +[semver]: https://semver.org/ + +\* `version` is used by the engine to determine the most recent version of a modpack. Therefore, it should be bumped when something in the modpack changes (e.g. whenever a new version gets published). `versionstr` is what is displayed to the user and can contain any string, so it can be used to represent any sensible version format. ## [assets] Section From 297500e8d172ac2370c34b25e1f1ce42ac32cfe1 Mon Sep 17 00:00:00 2001 From: heinezen Date: Tue, 10 Oct 2023 16:45:21 +0200 Subject: [PATCH 2/6] convert: Set engine modpack version to openage version. --- openage/convert/tool/api_export.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openage/convert/tool/api_export.py b/openage/convert/tool/api_export.py index 36f85abafd..adc7983cf5 100644 --- a/openage/convert/tool/api_export.py +++ b/openage/convert/tool/api_export.py @@ -76,7 +76,7 @@ def create_modpack() -> Modpack: mod_def = modpack.get_info() - mod_def.set_info("engine", "0.4.0", repo="openage") + mod_def.set_info("engine", "0.5.1", versionstr="0.4.0", repo="openage") mod_def.add_include("**") From f127bbb139f276429fb3fd06619bb87aec123ce5 Mon Sep 17 00:00:00 2001 From: heinezen Date: Tue, 10 Oct 2023 16:49:00 +0200 Subject: [PATCH 3/6] convert: Fix directory access in API export CLI. --- openage/convert/tool/api_export.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openage/convert/tool/api_export.py b/openage/convert/tool/api_export.py index adc7983cf5..cac8cebba5 100644 --- a/openage/convert/tool/api_export.py +++ b/openage/convert/tool/api_export.py @@ -33,7 +33,7 @@ def main(args, error): del error # unused path = Union().root - path.mount(Directory(args.dir)) + path.mount(Directory(args.dir).root) export_api(path) From 2493d187b31d84a67e77d911e931716cecb2a9e5 Mon Sep 17 00:00:00 2001 From: heinezen Date: Tue, 10 Oct 2023 16:55:21 +0200 Subject: [PATCH 4/6] convert: Bump engine modpack version requirement. --- openage/convert/service/init/api_export_required.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openage/convert/service/init/api_export_required.py b/openage/convert/service/init/api_export_required.py index 61b8f5ba4d..2cbbc607b4 100644 --- a/openage/convert/service/init/api_export_required.py +++ b/openage/convert/service/init/api_export_required.py @@ -16,7 +16,7 @@ from openage.util.fslike.union import UnionPath -CURRENT_API_VERSION = "0.4.0" +CURRENT_API_VERSION = "0.5.1" def api_export_required(asset_dir: UnionPath) -> bool: From fa596294cba7799144bac5b3d288442c9e5974ee Mon Sep 17 00:00:00 2001 From: heinezen Date: Tue, 10 Oct 2023 17:06:06 +0200 Subject: [PATCH 5/6] gamestate: Do not substr on double wildcard. --- libopenage/gamestate/game.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libopenage/gamestate/game.cpp b/libopenage/gamestate/game.cpp index 90dfe5ede3..d31310945d 100644 --- a/libopenage/gamestate/game.cpp +++ b/libopenage/gamestate/game.cpp @@ -67,11 +67,12 @@ void Game::load_data(const std::shared_ptr &mod_manager) { recursive = true; if (parts.size() == 1) { // include = "**" - search = include.substr(0, include.size() - 2); + // start in root directory + search = ""; } else { // include = "path/to/somewhere/**" - // remove the slash '/' too + // remove the wildcard '**' and the slash '/' search = include.substr(0, include.size() - 3); } } From f9abad3e14d158215238e629e5aa9e898b9ff992 Mon Sep 17 00:00:00 2001 From: heinezen Date: Tue, 10 Oct 2023 20:00:53 +0200 Subject: [PATCH 6/6] add log messages to find error --- libopenage/gamestate/game.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libopenage/gamestate/game.cpp b/libopenage/gamestate/game.cpp index d31310945d..1eeff5cbd8 100644 --- a/libopenage/gamestate/game.cpp +++ b/libopenage/gamestate/game.cpp @@ -60,20 +60,26 @@ void Game::load_data(const std::shared_ptr &mod_manager) { for (const auto &include : includes) { // handle wildcards auto parts = util::split(include, '/'); + log::log(INFO << "parts: " << parts.size()); auto last_part = parts.back(); + log::log(INFO << "last_part: " << last_part); bool recursive = false; auto search = include; + log::log(INFO << "search before: " << search); if (last_part == "**") { recursive = true; + log::log(INFO << "B0 parts size: " << parts.size()); if (parts.size() == 1) { // include = "**" // start in root directory search = ""; + log::log(INFO << "B1 search: " << search); } else { // include = "path/to/somewhere/**" // remove the wildcard '**' and the slash '/' search = include.substr(0, include.size() - 3); + log::log(INFO << "B2 search: " << search); } }