-
Notifications
You must be signed in to change notification settings - Fork 178
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
Refactored autoAwards Kill Handling for Improved Reliability #4539
Refactored autoAwards Kill Handling for Improved Reliability #4539
Conversation
…ds_formationReading
Replaced LogManager with MMLogger across AutoAwardsController for consistency and better logging abstraction. Introduced pre-processed kill data map in KillAwards to improve kill awards processing efficiency.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #4539 +/- ##
=========================================
Coverage 10.32% 10.32%
Complexity 5816 5816
=========================================
Files 935 935
Lines 128792 128780 -12
Branches 18951 18943 -8
=========================================
Hits 13296 13296
+ Misses 114220 114208 -12
Partials 1276 1276 ☔ View full report in Codecov by Sentry. |
# Conflicts: # MekHQ/src/mekhq/campaign/personnel/autoAwards/AutoAwardsController.java
New campaign. I forgot to actually turn on auto-awards until part way through the first mission. All the kills were cheesed by using GM mode to change the weather to an F4 tornado and manually assigning them after the scenario. Everything looks fine to me, but I've attached the logs/save in case you want to look them over. |
Ok, that's a good sign. Fingers crossed this should be good to go. I'm going to hold off marking this as live until I've got a couple more confirmations, but it passing the 'not immediately breaking' test fills me with some confidence. |
Different new campaign. I used command line nukes this time instead of tornadoes. before-early-completion-TOE-AWARD-TEST30350410.cpnx.gz When I try to complete the mission early, MHQ freezes. Running in debug mode and setting a breakpoint shows that line 156 of person = 0d49973a-2611-454a-ad9c-9329786c6603 Hitting resume program switches between the company and the Battalion, but the person never changes. If I mute the breakpoint, MHQ freezes, and none of the other breakpoints I set get hit. If I turn the breakpoint back on, it goes right back to the same person, switching between company and battalion. The person in question is Colonel Gobnat Bagss. MHQ commanding officer, as well as the commander of A Companies A Lance. Read top to bottom, she is the first person, in the first lance, in the first company, in the first battalion, in the first (and only) regiment, in the campaign. |
Added a missing recursion element to ensure the TO&E is read correctly.
Streamlined the kill processing logic in AutoAwardsController using Java Streams to reduce redundancy. Improved the handling of force traversal in KillAwards to avoid re-evaluation of previously visited nodes, enhancing both performance and readability.
Flipping this to live. It is no longer in draft. |
Requires #4573, merge order unaffected
Rewrote how autoAwards handles lifetime and mission-based kills to more reliably read the TO&E and with a mind to reducing the amount of parses made across both the TO&E and when retrieving kills from a force.
This takes advantage of our new TO&E reading functionality, which allows users to better handle non-traditional TO&E layouts - for example, TO&Es in which the deepest formation is not a lance, but is actually a company.
Closes #4514