Skip to content

Feat/streak#10

Open
TheBjoRedCraft wants to merge 4 commits into
version/26.1from
feat/streak
Open

Feat/streak#10
TheBjoRedCraft wants to merge 4 commits into
version/26.1from
feat/streak

Conversation

@TheBjoRedCraft
Copy link
Copy Markdown
Member

No description provided.

@TheBjoRedCraft TheBjoRedCraft self-assigned this May 21, 2026
Copilot AI review requested due to automatic review settings May 21, 2026 15:22
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 /playtime output 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.

Comment thread gradlew.bat
Comment thread gradlew.bat
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants