Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a new option in game.project: liveupdate.mount_on_start, which disables auto-mounts at the start of the game. #8857

Merged
merged 3 commits into from
Apr 29, 2024

Conversation

AGulev
Copy link
Contributor

@AGulev AGulev commented Apr 26, 2024

In some cases, it might be useful to fully control from the code what exactly needs to be mounted instead of using auto-mount at the start of the application. Now, this is possible to do using the liveupdate.mount_on_start checkbox in game.project.

Fix #8847

PR checklist

  • Code
    • Add engine and/or editor unit tests.
    • New and changed code follows the overall code style of existing code
    • Add comments where needed
  • Documentation
    • Make sure that API documentation is updated in code comments
    • Make sure that manuals are updated (in github.com/defold/doc)
  • Prepare pull request and affected issue for automatic release notes generator
    • Pull request - Write a message that explains what this pull request does. What was the problem? How was it solved? What are the changes to APIs or the new APIs introduced? This message will be used in the generated release notes. Make sure it is well written and understandable for a user of Defold.
    • Pull request - Write a pull request title that in a sentence summarises what the pull request does. Do not include "Issue-1234 ..." in the title. This text will be used in the generated release notes.
    • Pull request - Link the pull request to the issue(s) it is closing. Use on of the approved closing keywords.
    • Affected issue - Assign the issue to a project. Do not assign the pull request to a project if there is an issue which the pull request closes.
    • Affected issue - Assign the "breaking change" label to the issue if introducing a breaking change.
    • Affected issue - Assign the "skip release notes" is the issue should not be included in the generated release notes.

Example of a well written PR description:

  1. Start with the user facing changes. This will end up in the release notes.
  2. Add one of the GitHub approved closing keywords
  3. Optionally also add the technical changes made. This is information that might help the reviewer. It will not show up in the release notes. Technical changes are identified by a line starting with one of these:
    1. ### Technical changes
    2. Technical changes:
    3. Technical notes:
There was a anomaly in the carbon chroniton propeller, introduced in version 8.10.2. This fix will make sure to reset the phaser collector on application startup.

Fixes #1234

### Technical changes
* Pay special attention to line 23 of phaser_collector.clj as it contains some interesting optimizations
* The propeller code was not taking into account a negative phase.

@AGulev AGulev requested a review from JCash April 26, 2024 15:32
@@ -32,7 +32,7 @@
(def ^:private docs
["base" "bit" "buffer" "b2d" "b2d.body" "builtins" "camera" "collectionfactory"
"collectionproxy" "coroutine" "crash" "debug" "factory" "go" "gui"
"html5" "http" "image" "io" "json" "label" "math" "model" "msg"
"html5" "http" "image" "io" "json" "label" "liveupdate" "math" "model" "msg"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missed liveupdate in the editors autocomplete

@@ -943,7 +943,8 @@ namespace dmEngine
}

int32_t liveupdate_enable = dmConfigFile::GetInt(engine->m_Config, "liveupdate.enabled", 1);
if (liveupdate_enable)
int32_t liveupdate_mount_on_start = dmConfigFile::GetInt(engine->m_Config, "liveupdate.mount_on_start", 1);
if (liveupdate_enable && liveupdate_mount_on_start)
Copy link
Contributor Author

@AGulev AGulev Apr 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we already have enabled flag in resource system, but liveupdate.enabled used in another place as well, so we need new flag for resource system only to prevent ONLY mounting

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this flag now explicitly takes on a different meaning, I suggest renaming it as well.

E.g. RESOURCE_FACTORY_FLAGS_NO_LIVE_UPDATE_MOUNT_ON_START
or something of the sorts.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I should be "positive" because it's on by default - means we will mount archive if it's on
So I pick RESOURCE_FACTORY_FLAGS_LIVE_UPDATE_MOUNTS_ON_START to make it clear

JCash
JCash previously approved these changes Apr 29, 2024
@@ -943,7 +943,8 @@ namespace dmEngine
}

int32_t liveupdate_enable = dmConfigFile::GetInt(engine->m_Config, "liveupdate.enabled", 1);
if (liveupdate_enable)
int32_t liveupdate_mount_on_start = dmConfigFile::GetInt(engine->m_Config, "liveupdate.mount_on_start", 1);
if (liveupdate_enable && liveupdate_mount_on_start)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this flag now explicitly takes on a different meaning, I suggest renaming it as well.

E.g. RESOURCE_FACTORY_FLAGS_NO_LIVE_UPDATE_MOUNT_ON_START
or something of the sorts.

@AGulev AGulev requested a review from JCash April 29, 2024 09:52
@AGulev AGulev merged commit b91fcfb into dev Apr 29, 2024
15 checks passed
@AGulev AGulev deleted the issue-8847 branch April 29, 2024 09:55
AGulev added a commit that referenced this pull request Apr 29, 2024
…h disables auto-mounts at the start of the game. (#8857)

* add new option that turns off auto mounts on start of the game

* fix liveupdate tests

* rename flag
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow mounting resource archives manually
2 participants