Skip to content

Add player outfit management RPCs with user-scoped storage#291

Draft
Copilot wants to merge 3 commits intomainfrom
copilot/implement-outfit-management-rpcs
Draft

Add player outfit management RPCs with user-scoped storage#291
Copilot wants to merge 3 commits intomainfrom
copilot/implement-outfit-management-rpcs

Conversation

Copy link
Contributor

Copilot AI commented Feb 2, 2026

Implements CRUD operations for player cosmetic outfits stored in Nakama storage.

Endpoints

Four RPCs registered in evr_runtime.go:

  • player/outfit/save - Creates outfit with generated UUID, enforces 10-outfit limit per user
  • player/outfit/list - Returns all outfits for authenticated user
  • player/outfit/load - Retrieves specific outfit by ID
  • player/outfit/delete - Deletes after ownership verification

Storage Schema

Collection: player_outfits (user-scoped)

type Outfit struct {
    ID      string      `json:"id"`       // UUID v4
    Name    string      `json:"name"`
    Chassis string      `json:"chassis"`
    Bracer  string      `json:"bracer"`
    Booster string      `json:"booster"`
    Decal   string      `json:"decal"`
    SavedAt TimeRFC3339 `json:"saved_at"`
}

Implementation Notes

  • Authentication required on all endpoints (extracts user ID from context)
  • Storage operations scoped to authenticated user ID - prevents cross-user access
  • Delete verifies outfit exists and belongs to user before removal
  • MaxOutfitsPerUser constant (10) configurable for environment-specific limits

Example Usage

POST /v2/rpc/player/outfit/save
{
  "name": "Competition Loadout",
  "chassis": "chassis_001",
  "bracer": "bracer_002",
  "booster": "booster_003",
  "decal": "decal_004"
}

Response: {
  "success": true,
  "outfit": { /* full outfit object */ },
  "id": "550e8400-e29b-41d4-a716-446655440000"
}
Original prompt

Implement outfit management RPCs in server/evr_runtime_rpc.go

Storage: Use Nakama storage with collection "player_outfits", user-scoped.

Outfit schema:

  • id: uuid
  • name: string
  • chassis, bracer, booster, decal: string IDs
  • saved_at: timestamp

Endpoints:

  1. player/outfit/save
    Request: {name, chassis, bracer, booster, decal}
    Response: {success, outfit, id}

    • Generate UUID for new outfits
    • Limit to 10 outfits per user (configurable)
  2. player/outfit/list
    Request: (none)
    Response: {outfits: [...]}

  3. player/outfit/load
    Request: {outfit_id}
    Response: {success, outfit}

  4. player/outfit/delete
    Request: {outfit_id}
    Response: {success}

    • Verify ownership before delete

Register all RPCs in runtime initialization.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits February 2, 2026 17:20
Co-authored-by: thesprockee <962164+thesprockee@users.noreply.github.com>
Co-authored-by: thesprockee <962164+thesprockee@users.noreply.github.com>
Copilot AI changed the title [WIP] Add outfit management RPCs in server/evr_runtime_rpc.go Add player outfit management RPCs with user-scoped storage Feb 2, 2026
Copilot AI requested a review from thesprockee February 2, 2026 17:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants