# PCA V49.5 — Play With Friends

## What's new in the Netlify game

Tap **PLAY PCA** on the four-storefront homepage. Choose **PLAY SOLO** or **PLAY WITH FRIENDS**.

- **PLAY SOLO:** opens Garage and lets you launch the game as usual.
- **PLAY WITH FRIENDS:** enter a nickname. One person selects **CREATE PRIVATE ROOM**; friends open the invitation link or enter the six-character code and select **JOIN ROOM**.
- After the server confirms a room, the lobby displays a code, copyable invitation link, connected players, and **START DRIVING**.
- Sharing a link includes the room and room-server location (not an API key); recipients do not need to type the room-server address. Rooms are for up to 8 players, ephemeral, and **private by invite code rather than password-protected**.

## Important one-time online-server setup

Netlify ZIP deploys host a static website. **They cannot run PCA's persistent WebSocket room server.** To actually play with friends on different devices, a separately hosted Node service is required. The game does not claim success or generate a room code until it receives a successful connection response from that service.

This download includes the UI and game; a second package `PCA_V49_5_Private_Room_Server.zip` contains the tiny companion server and a Render/GitHub setup guide.

1. Deploy the companion server using its README. Verify `https://YOUR-SERVICE.onrender.com/api/health` returns `"ok":true`.
2. In the game, open **PLAY WITH FRIENDS > Room server setup** and enter `wss://YOUR-SERVICE.onrender.com/socket`.
3. Create a room, share the link, and start driving. Friends opening the link see the room code ready to join.
4. The server address is remembered on the host's browser. Invitees get the server address in their invite URL. Keep invite links private.

For **local-only testing**, run the bundled Node multiplayer server and open PCA on the local network; production website play requires a WSS host.

## What we did not change

The V49.4 driving controls, Google 3D Flight, destinations, family characters, Garage, four storefronts, and the ISN partner studio are preserved. This build changes the multiplayer entry/lobby UI and its invite flow.

## Testing limitation

Server-side room creation, joining, state syncing, and leaving can be tested locally. Deploying a public secure WebSocket server and verifying two real iPads on different networks requires a live hosted environment and user-owned host configuration. A room code by itself is not proof multiplayer works until the green connected state appears.

## Update for V49.6

For the permanent Family Clubhouse with a PIN, see **PCA_FAMILY_CLUBHOUSE_SETUP.md**. The older temporary-room directions above still apply to temporary rooms. Set `PCA_FAMILY_PIN` only in Render's Environment settings, never in a GitHub file.
