chore: multiplayer examples#4201
Conversation
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
How to use the Graphite Merge QueueAdd the label merge-queue to this PR to add it to the merge queue. You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
PR Review: Multiplayer Examples SpecsThis PR introduces specs for six new RivetKit multiplayer game examples and removes the existing Summary of ChangesAdded:
Deleted:
Issues1. Missing Vercel example cleanup The friction log itself acknowledges this:
Per CLAUDE.md, changes to examples require updating the Vercel equivalent. The 2. Security inconsistency in the idle base builder spec The Under Identity Assumption:
Under Security Checklist:
These contradict each other. If the actor key is a client-supplied
3. Working example deleted with no replacement The repo loses its only working multiplayer game example ( 4. Minor formatting issue in the FPS spec In Positives
Suggestions
|
| - Caller identity is `c.conn.id`. | ||
| - Player identity is a stable `playerId` stored in `localStorage`. | ||
| - The client generates a random UUID on first load and persists it. | ||
| - The `idleWorld` actor key is `[playerId]`. | ||
| - The actor still uses `c.conn.id` to identify the caller connection for rate limiting and per-connection events. |
There was a problem hiding this comment.
Security contradiction: The spec states the actor is keyed by client-provided playerId from localStorage, but line 128 claims the actor is "keyed by server-known identity (c.conn.id)".
This is a critical security flaw - if the actor key is [playerId] from localStorage (client-controlled), any client can:
- Generate or guess another player's UUID
- Connect to and control that player's world
- Steal resources, modify buildings, etc.
Fix: Either:
# Option 1: Use c.conn.id as the actor key (ephemeral worlds)
- Key: `[c.conn.id]`
- Use a separate auth token for persistent identity
# Option 2: Use server-issued playerIds
- Require server-side authentication
- Key: `[authenticatedPlayerId]` from token validation
- Never trust client-provided IDs for actor keys| - Caller identity is `c.conn.id`. | |
| - Player identity is a stable `playerId` stored in `localStorage`. | |
| - The client generates a random UUID on first load and persists it. | |
| - The `idleWorld` actor key is `[playerId]`. | |
| - The actor still uses `c.conn.id` to identify the caller connection for rate limiting and per-connection events. | |
| - Caller identity is `c.conn.id`. | |
| - Player identity is a stable server-issued `playerId`. | |
| - The server generates and provides a secure player ID upon first connection. | |
| - This ID is stored in `localStorage` by the client for persistence. | |
| - The `idleWorld` actor key is `[authenticatedPlayerId]` (server-verified). | |
| - The actor uses `c.conn.id` to identify the caller connection for rate limiting and per-connection events. | |
Spotted by Graphite Agent
Is this helpful? React 👍 or 👎 to let us know.
ee2bb5f to
507ba2d
Compare
e63c514 to
2055b0e
Compare

Description
Please include a summary of the changes and the related issue. Please also include relevant motivation and context.
Type of change
How Has This Been Tested?
Please describe the tests that you ran to verify your changes.
Checklist: