feature/rest-to-signalr-transition #10

Merged
njooris merged 13 commits from feature/rest-to-signalr-transition into master 2026-11-04 16:02:56 +00:00
Owner
No description provided.
Authentication refuses every POST without it, the login answered 403.
- useGameRoom (games/gameRoom.ts) replaces the REST calls: solo goes through
  CreateRoom then JoinRoom, multiplayer through Matchmaking -> Lobby -> Game
- the Lobby connection is opened after MatchFound and kept until GameOver
- scoreboard in the top right corner with every player's score, the time left
  and the quit button under it
- multiplayer: retry countdown after a wrong guess, "X found it" / "Time's up"
  results, conquered countries green for us and red for the others
- the new game menu goes step by step: solo or multiplayer, then mode, then
  zone; one start button, the zone is locked on the world in multiplayer
- clickguess renamed conquest
- every call goes through the api gateway (config.ts, VITE_GATEWAY_URL)
- api.ts and Score.tsx removed

AUTH-DISABLED: each tab plays with a random test user id sent as ?userId=,
the /auth/me call is commented until the hubs require the cookie again.
- AuthCard, ProfileCard and GameHubTestCard removed from the free mode screen
  again, the game room rewrite had brought them back
- the test user id is drawn on each page load instead of sessionStorage:
  a duplicated tab copied it, both tabs were the same player and the second
  one was refused by Matchmaking ("Already in queue")
The browser called http://localhost:5166, which is the player's own machine
when the site is opened from another computer, and the gateway CORS only
allowed http://localhost:5173.

- Vite passes /auth, /user-profile, /game, /lobby, /matchmaking and
  /map-store to the gateway, websockets included; the target comes from
  GATEWAY_PROXY_TARGET (default http://localhost:5166)
- GATEWAY_URL is empty by default: same address as the site, no CORS
- the auth and profile cards use GATEWAY_URL instead of localhost:5166
- the zone step is open in multiplayer, the chosen zones are the accepted
  ones and are sent to Matchmaking with JoinQueue(mode, maps, zones)
- the lobby snapshot gives the mode and zone Matchmaking picked (onMatch):
  the map moves to that zone, only its countries can be played, and the
  front switches to the picked mode when two players of different modes
  were paired after a while
- the waiting card and the scoreboard show the mode and zone of the match
- findZoneByName in zones.ts
In findcountryname and conquest every key goes to the search bar:
- Tab no longer moves the focus to the menu buttons (Tab then Enter left
  the game), it brings it back to the bar
- a letter, a digit or Backspace typed while the focus is elsewhere
  (globe, clicked button) focuses the bar and lands in it
- Enter outside the bar sends the guess instead of clicking the focused
  button
- the suggestion button is no longer reachable with Tab
- each zone has a temporary map id (1 World ... 7 Oceania), same ids as
  Game, until the zones are linked to MapStore
- JoinQueue(mode, maps) with the ids of the accepted zones, Matchmaking
  picks one common to both players
- LeaveQueue before closing the matchmaking connection
- the zone shown in multiplayer comes from the map of the lobby snapshot
- no more fake ?userId= test user, the hubs use the cookie
- fetchMe (/auth/me) gives our id, solo and multiplayer show notLogged
  when we aren't logged in: the Game hub requires the auth for solo too
- AuthCard back next to the language switcher to log in
The comments stay until the review is done.
njooris approved these changes 2026-11-04 16:02:14 +00:00
njooris left a comment

lgtm

lgtm
njooris merged commit 46c3f96a1b into master 2026-11-04 16:02:56 +00:00
njooris deleted branch feature/rest-to-signalr-transition 2026-11-04 16:02:56 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
Terranaut/frontend!10
No description provided.