Add /tigl games command for ongoing TIGL games by rank#4481
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds a new /tigl games command that displays ongoing TIGL (Twilight Imperium Global League) games grouped by rank tier. The command helps moderators and players quickly see how many active league games exist at each progression level without manually scanning channels.
Changes:
- Added a new
Gamessubcommand class implementing/tigl gameswith an optionalshow_game_idsboolean parameter - Introduced
SHOW_GAME_IDSconstant in Constants.java for the new option - Registered the new subcommand in TiglCommand
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/main/java/ti4/helpers/Constants.java | Added SHOW_GAME_IDS constant for the new command option |
| src/main/java/ti4/commands/tigl/TiglCommand.java | Registered the new Games subcommand in the command stream |
| src/main/java/ti4/commands/tigl/Games.java | Implemented the complete /tigl games command logic, filtering ongoing TIGL games and grouping them by rank |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Replace wildcard static import with specific StringUtils methods, tidy up StringBuilder append formatting, and simplify conditional logic. UnfiledButtonHandlers: replace wildcard import with capitalize/countMatches/isNotBlank and remove the redundant netGain == properGain check so PromissoryNoteHelper.resolvePNPlay runs when netGain > 2 && cyber. Games: reformat chained sb.append calls for readability. ListTitlesGivenService: collapse multi-line sb.append chains into single-line appends and remove an extra blank line. Primarily cleanup and readability changes, with a deliberate behavioral change in the PN resolution condition.
Introduce TIGLHelper.getSortedRanks() to centralize rank filtering and ordering, using Stream API. Update Games to use ManagedGame::getGame, call the new getSortedRanks() helper, remove an unused Comparator import, and make the Games constructor package-private. These changes simplify rank handling and tidy up imports/constructors.
Introduce TiglGamesInfoService to build the ongoing TIGL games-by-rank message from the database and replace in-memory aggregation in the Games command. Persist a new twilightImperiumGlobalLeagueRank field on GameEntity (and set it in PersistAllEntitiesService) and add a repository method to fetch active TIGL games. Update Games command to call the service. This moves TIGL game listing logic to a transactional Spring service and removes direct dependency on in-memory GameManager for that view.
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 10 out of 10 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Games: when the showGameIds option is true, post the detailed message into a thread titled "Ongoing TIGL games" instead of the main channel; otherwise keep existing channel behavior. TIGLHelper: add null/blank guard in fromString to avoid NPEs, add Lombok @Getter for the name field and remove the manual getter, and include a static import for isBlank. These changes improve UI noise control for game IDs and add minor cleanup and null safety.
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.
No description provided.