Feat/streak#10
Open
TheBjoRedCraft wants to merge 4 commits into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
This PR introduces a “login streak” feature to the Surf Playtime system by persisting streak state in the playtime microservice (via RabbitMQ request/response packets), updating the Paper plugin to calculate/update/cache streaks on join/quit, and displaying the streak in /playtime. It also updates the Gradle wrapper/version metadata.
Changes:
- Add login-streak persistence in the microservice (new table + repository + RabbitMQ handler) and corresponding core/common API packets & service abstraction.
- Update Paper join/quit listeners to load/update/save streaks and manage a local cache; extend
/playtimeoutput to show current/best streak. - Update Gradle wrapper scripts/properties and bump project version.
Reviewed changes
Copilot reviewed 19 out of 20 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| surf-playtime-paper/src/main/kotlin/dev/slne/surf/playtime/paper/listener/PlayerQuitListener.kt | Invalidates streak cache on quit alongside other cached state. |
| surf-playtime-paper/src/main/kotlin/dev/slne/surf/playtime/paper/listener/PlayerJoinListener.kt | Loads/creates/updates login streak on join; caches and persists it; sends a one-time message when created. |
| surf-playtime-paper/src/main/kotlin/dev/slne/surf/playtime/paper/command/PlaytimeCommand.kt | Adds login-streak output to the /playtime command (reads from cache). |
| surf-playtime-microservice/src/main/kotlin/dev/slne/surf/playtime/microservice/table/PlaytimeStreaksTable.kt | New database table for streak state (current/highest/last login date). |
| surf-playtime-microservice/src/main/kotlin/dev/slne/surf/playtime/microservice/repository/PlaytimeStreakRepository.kt | Microservice persistence + streak calculation from historical sessions. |
| surf-playtime-microservice/src/main/kotlin/dev/slne/surf/playtime/microservice/handler/PlaytimeStreakHandler.kt | RabbitMQ request handlers for load/save/calculate streak operations. |
| surf-playtime-microservice/src/main/kotlin/dev/slne/surf/playtime/microservice/PlaytimeMicroservice.kt | Registers the new table and RabbitMQ handler at bootstrap. |
| surf-playtime-core/surf-playtime-core-paper/src/main/kotlin/dev/slne/surf/playtime/core/paper/service/PlaytimeStreakServiceImpl.kt | Paper-side implementation of streak service backed by Rabbit requests + Caffeine cache. |
| surf-playtime-core/surf-playtime-core-common/src/main/kotlin/dev/slne/surf/playtime/core/common/service/PlaytimeStreakService.kt | New cross-module service interface (load/save/calc + cache API). |
| surf-playtime-core/surf-playtime-core-common/src/main/kotlin/dev/slne/surf/playtime/core/common/rabbit/packet/response/PlaytimeStreakResponsePacket.kt | New Rabbit response packet returning an optional streak record. |
| surf-playtime-core/surf-playtime-core-common/src/main/kotlin/dev/slne/surf/playtime/core/common/rabbit/packet/response/IntResponsePacket.kt | New Rabbit response packet for integer values (streak calculation result). |
| surf-playtime-core/surf-playtime-core-common/src/main/kotlin/dev/slne/surf/playtime/core/common/rabbit/packet/request/SavePlaytimeStreakRequestPacket.kt | New Rabbit request to save streak state for a player/date. |
| surf-playtime-core/surf-playtime-core-common/src/main/kotlin/dev/slne/surf/playtime/core/common/rabbit/packet/request/LoadPlaytimeStreakRequestPacket.kt | New Rabbit request to load streak state for a player. |
| surf-playtime-core/surf-playtime-core-common/src/main/kotlin/dev/slne/surf/playtime/core/common/rabbit/packet/request/CalculatePlaytimeStreakRequestPacket.kt | New Rabbit request to calculate streak from session history. |
| surf-playtime-api/surf-playtime-api-common/src/main/kotlin/dev/slne/surf/playtime/api/common/session/PlaytimeStreak.kt | New API model representing persisted streak state (plus cached “SimpleStreak”). |
| gradlew.bat | Updates Windows wrapper script behavior (currently introduces broken error-flow). |
| gradlew | Updates embedded template reference URL/hash. |
| gradle/wrapper/gradle-wrapper.properties | Bumps Gradle distribution URL and adds retry-related properties. |
| gradle.properties | Bumps project version to 1.2.2-SNAPSHOT. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…ing in PlaytimeStreakService
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.