Closed
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR adds a new Kotlin duration setting along with related API changes and refactoring. Key changes include:
- Introducing duration-based settings and type conversion in NumericSetting.
- Refactoring time-based functionality in LimitedDecayQueue and related modules to use Kotlin’s Duration and monotonic time marks.
- Updating tests and various modules to work with the new duration APIs.
Reviewed Changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| common/src/test/kotlin/LimitedDecayQueueTest.kt | Updated tests to use Kotlin Duration literals. |
| common/src/main/kotlin/com/lambda/util/extension/Time.kt | Added extensions for tick conversion and duration unit helpers. |
| common/src/main/kotlin/com/lambda/util/collections/LimitedDecayQueue.kt | Refactored to utilize Kotlin’s Duration and monotonic timestamps. |
| common/src/main/kotlin/com/lambda/util/ServerTPS.kt | Updated server TPS logic to use Duration for timing. |
| common/src/main/kotlin/com/lambda/task/tasks/BuildTask.kt | Changed legacy time conversion to the new ticks extension. |
| common/src/main/kotlin/com/lambda/module/modules/network/PacketLimiter.kt | Converted static millisecond values to Duration. |
| common/src/main/kotlin/com/lambda/module/modules/network/PacketDelay.kt | Replaced time polling with a Timer and Duration-based delays. |
| common/src/main/kotlin/com/lambda/module/modules/combat/CrystalAura.kt | Updated delay settings to use Kotlin Duration types. |
| common/src/main/kotlin/com/lambda/module/modules/client/Discord.kt | Updated delay configuration to use Duration. |
| common/src/main/kotlin/com/lambda/config/settings/NumericSetting.kt | Changed to allow any Comparable types instead of just Numbers. |
| common/src/main/kotlin/com/lambda/config/settings/DurationSetting.kt | Introduced a new DurationSetting with automatic unit inference. |
| common/src/kotlin/com/lambda/config/Configurable.kt | Added DurationSetting registration overload. |
common/src/main/kotlin/com/lambda/config/settings/DurationSetting.kt
Outdated
Show resolved
Hide resolved
Avanatiker
requested changes
May 31, 2025
Member
Avanatiker
left a comment
There was a problem hiding this comment.
Good start but delay setting is not yet shown in the ClickGUI and also we need some kind of option that allows to render the duration as time or tick based depending on the usecase ticks are more relevant. maybe a wrapper function that also automatically has 50ms as step idk
Collaborator
Author
|
This pull request is outdated and needs to be updated for ImGui, do not delete this branch |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
LimitedDecayQueueto use monotonic time marksNumericSettingsclass to allow any comparable typesThese changes are recommended because comparing longs and ints for duration checks are prone to errors and using durations and monotonic time marks makes it easier to compare durations