Skip to content

54 clean up architecture and fix bugs #55

Merged
merged 11 commits into from
Apr 20, 2026
Merged

Conversation

odaakj
Copy link
Collaborator

@odaakj odaakj commented Apr 20, 2026

What does this PR do?

Reorganizes the project architecture to better reflect the intended MVC + Client-Server + ECS separation, and fixes several bugs discovered during the cleanup.

Architecture changes:

  • Splits model package into domain/, dto/, score/, and services/ subpackages
  • Extracts QuestionBuilder, SessionSyncService, and RoundManager from LobbyController/RoundController to give each class a single clear responsibility

Bug fixes:

  • Music no longer continues playing when the host leaves a session mid-round
  • Music no longer continues playing when a regular player leaves mid-round
  • Music now stops correctly for all players on transition from game round to leaderboard
  • Fixed leaderboard showing the previous round's score delta (+X) for players who answered wrong — they now correctly show +0
  • Fixed leaderboard not showing the correct round score for the local player when answering correctly
  • Firebase listeners are now stopped in BeatBattle.dispose(), preventing a listener leak when the app exits mid-game
  • Player and host IDs now use UUID.randomUUID() instead of System.currentTimeMillis() to guarantee uniqueness

Related issue

Closes #54

Layer(s) affected

  • UI (screens / components)
  • Game Logic (session / round / scoring / state)
  • Domain (model)
  • Infrastructure (Firebase / audio / adapters)

Checklist

  • Code compiles without errors
  • Tested on emulator or device
  • No unrelated changes included
  • Updated README if needed

@odaakj odaakj added bug Something isn't working documentation Improvements or additions to documentation enhancement New feature or request lagring backend musikk game-logic domain infra labels Apr 20, 2026
@odaakj odaakj self-assigned this Apr 20, 2026
@odaakj odaakj linked an issue Apr 20, 2026 that may be closed by this pull request
@mostafas mostafas self-requested a review April 20, 2026 11:58
@odaakj odaakj merged commit 852edfb into main Apr 20, 2026
1 check failed
@odaakj odaakj deleted the 54-clean-up-architecture branch April 20, 2026 12:02
Sign in to join this conversation on GitHub.
Labels
backend bug Something isn't working documentation Improvements or additions to documentation domain enhancement New feature or request game-logic infra lagring musikk
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Clean up the project architecture
2 participants