@Polakrity asked on D2400 if the timer interval could be made configurable for Trickle as well, this patch does that
Details
- Reviewers
Freagarach - Group Reviewers
Restricted Owners Package (Owns No Changed Paths) - Commits
- rP23879: Allow the interval to be changed in the templates for the Resource Trickle…
- Trac Tickets
- #5632
Add a modifier for interval, check everything works correctly and that update is more or less frequent.
Diff Detail
- Repository
- rP 0 A.D. Public Repository
- Branch
- /ps/trunk
- Lint
Lint OK - Unit
No Unit Test Coverage - Build Status
Buildable 12336 Build 23484: Vulcan Build Jenkins Build 23483: Vulcan Build (macOS) Jenkins Build 23482: Vulcan Build (Windows) Jenkins Build 23481: arc lint + arc unit
Event Timeline
Build failure - The Moirai have given mortals hearts that can endure.
Link to build: https://jenkins.wildfiregames.com/job/docker-differential/2349/display/redirect
Build failure - The Moirai have given mortals hearts that can endure.
Link to build: https://jenkins.wildfiregames.com/job/docker-differential/2350/display/redirect
Build failure - The Moirai have given mortals hearts that can endure.
Link to build: https://jenkins.wildfiregames.com/job/vs2015-differential/1818/display/redirect
Build failure - The Moirai have given mortals hearts that can endure.
Link to build: https://jenkins.wildfiregames.com/job/vs2015-differential/1819/display/redirect
binaries/data/mods/public/simulation/components/ResourceTrickle.js | ||
---|---|---|
14 | This is not needed since it is computed in the check timer. | |
18 | The name of the function is not what it does ^^ | |
80 | One could cache the old value and do this.trickeInterval = Apply,,, directly? | |
81 | Also check whether the interval is positive (and non-zero). | |
82 | Comment not needed? | |
85 | Move to the declaration. |
binaries/data/mods/public/simulation/components/ResourceTrickle.js | ||
---|---|---|
83 | Early return? |
Inlines.
binaries/data/mods/public/simulation/components/ResourceTrickle.js | ||
---|---|---|
85 | No, else we compute it in some cases for nothing :) |
Build failure - The Moirai have given mortals hearts that can endure.
Link to build: https://jenkins.wildfiregames.com/job/vs2015-differential/2067/display/redirect
Build failure - The Moirai have given mortals hearts that can endure.
Link to build: https://jenkins.wildfiregames.com/job/docker-differential/2600/display/redirect
Build failure - The Moirai have given mortals hearts that can endure.
Link to build: https://jenkins.wildfiregames.com/job/macos-differential/968/display/redirect
Build failure - The Moirai have given mortals hearts that can endure.
Link to build: https://jenkins.wildfiregames.com/job/vs2015-differential/2068/display/redirect
Build failure - The Moirai have given mortals hearts that can endure.
Link to build: https://jenkins.wildfiregames.com/job/docker-differential/2601/display/redirect
Build failure - The Moirai have given mortals hearts that can endure.
Link to build: https://jenkins.wildfiregames.com/job/vs2015-differential/2069/display/redirect
Build failure - The Moirai have given mortals hearts that can endure.
Link to build: https://jenkins.wildfiregames.com/job/docker-differential/2602/display/redirect
Build failure - The Moirai have given mortals hearts that can endure.
Link to build: https://jenkins.wildfiregames.com/job/macos-differential/969/display/redirect
Build failure - The Moirai have given mortals hearts that can endure.
Link to build: https://jenkins.wildfiregames.com/job/macos-differential/970/display/redirect
Build failure - The Moirai have given mortals hearts that can endure.
Link to build: https://jenkins.wildfiregames.com/job/vs2015-differential/2070/display/redirect
Build failure - The Moirai have given mortals hearts that can endure.
Link to build: https://jenkins.wildfiregames.com/job/docker-differential/2603/display/redirect
Build failure - The Moirai have given mortals hearts that can endure.
Link to build: https://jenkins.wildfiregames.com/job/vs2015-differential/2071/display/redirect
Build failure - The Moirai have given mortals hearts that can endure.
Link to build: https://jenkins.wildfiregames.com/job/docker-differential/2604/display/redirect
Build failure - The Moirai have given mortals hearts that can endure.
Link to build: https://jenkins.wildfiregames.com/job/vs2015-differential/2072/display/redirect
Build failure - The Moirai have given mortals hearts that can endure.
Link to build: https://jenkins.wildfiregames.com/job/docker-differential/2605/display/redirect
Build failure - The Moirai have given mortals hearts that can endure.
Link to build: https://jenkins.wildfiregames.com/job/macos-differential/971/display/redirect
Build failure - The Moirai have given mortals hearts that can endure.
Link to build: https://jenkins.wildfiregames.com/job/macos-differential/972/display/redirect
Build failure - The Moirai have given mortals hearts that can endure.
Link to build: https://jenkins.wildfiregames.com/job/macos-differential/973/display/redirect
Successful build - Chance fights ever on the side of the prudent.
Link to build: https://jenkins.wildfiregames.com/job/docker-differential/2606/display/redirect
Add comment inline cmpTimer, apparently JavaScript allows this, and EsLint does not complain
Successful build - Chance fights ever on the side of the prudent.
Link to build: https://jenkins.wildfiregames.com/job/docker-differential/2607/display/redirect
binaries/data/mods/public/simulation/components/ResourceTrickle.js | ||
---|---|---|
80–86 | || 0 not needed anymore (since you've set it on init now). | |
82 | What happens when the oldTrickeInterval was 0 and we try here to cancel the invalidated timer? | |
95 | invalidated before (or earlier) to note it did not become invalidated on this turn. |
Fix inlines
binaries/data/mods/public/simulation/components/ResourceTrickle.js | ||
---|---|---|
82 | [11:20:17] Stan: Freagarach, when you cancel a cancelled timer delete returns false instead of true [11:20:48] Freagarach: So we're okay :) |
Successful build - Chance fights ever on the side of the prudent.
Link to build: https://jenkins.wildfiregames.com/job/docker-differential/2608/display/redirect
- Tested in game, interval applied appropriately.
- Code looks good.
- Common use cases tested.