Feat: Add SessionDispatcher to send responses by username #272

Merged
jona.walpert merged 1 commits from feat/session-dispatcher into main 2026-04-12 11:23:08 +02:00
jona.walpert commented 2026-04-12 11:21:35 +02:00 (Migrated from git.scicore.unibas.ch)
  • Summary: Adds SessionDispatcher, a small helper used by the server to send SuccessResponse messages to a specific session identified by username and to broadcast responses to all players in a lobby.
  • What it does: Implements dispatchToUser(username, body) — resolves the User by username, extracts the SessionId, builds a SuccessResponse, and dispatches it via the existing response pipeline; implements broadcastToLobby(lobby, body) — iterates lobby player names and calls dispatchToUser.
  • Why: Centralizes and simplifies server-side response routing by username, avoiding duplicated lookup/response logic across handlers and making lobby broadcasts straightforward.
* **Summary:** Adds `SessionDispatcher`, a small helper used by the server to send `SuccessResponse` messages to a specific session identified by username and to broadcast responses to all players in a lobby. * **What it does:** Implements `dispatchToUser(username, body)` — resolves the `User` by username, extracts the `SessionId`, builds a `SuccessResponse`, and dispatches it via the existing response pipeline; implements `broadcastToLobby(lobby, body)` — iterates lobby player names and calls `dispatchToUser`. * **Why:** Centralizes and simplifies server-side response routing by username, avoiding duplicated lookup/response logic across handlers and making lobby broadcasts straightforward.
jona.walpert (Migrated from git.scicore.unibas.ch) scheduled this pull request to auto merge when all checks succeed 2026-04-12 11:22:20 +02:00
jona.walpert commented 2026-04-12 11:23:08 +02:00 (Migrated from git.scicore.unibas.ch)

mentioned in commit a7de101be2

mentioned in commit a7de101be2437dd85c7af9d94a6d29c887aa0ac8
jona.walpert (Migrated from git.scicore.unibas.ch) merged commit a7de101be2 into main 2026-04-12 11:23:08 +02:00
This repo is archived. You cannot comment on pull requests.
No Reviewers
1 Participants
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: University-of-Basel-Studentprojects/Programmierprojekt#272