Skip to content

feat(maps): implement isolated user map space with ownership and quotas (closes #24) - #369

Open
dev-vishalmaurya wants to merge 2 commits into
Bitcoindefi:mainfrom
dev-vishalmaurya:feature/user-map-isolation-and-quotas
Open

dev-vishalmaurya wants to merge 2 commits into
Bitcoindefi:mainfrom
dev-vishalmaurya:feature/user-map-isolation-and-quotas

Conversation

@dev-vishalmaurya

Copy link
Copy Markdown

Summary

Resolves #24: Implements an isolated, persistent user map space with account ownership, configurable quotas, and economy/world isolation in Argentum Online Web (Modo Construcción).

What is implemented

  1. Reserved & Isolated Map ID Range:

    • Reserved numeric range [100,000 - 999,999] documented and implemented in both frontend/utils/gameLoader.ts and api/src/repositories/userMaps.ts.
    • Structural isolation: Never collides with or modifies official maps (1–500), static local maps (500–599), challenges (2,000–29,999), or dynamic instances (30,000–99,999).
    • Added isUserMap(mapNumber) and isOfficialWorldMap(mapNumber) utilities.
    • Client loadMap(mapNumber) seamlessly fetches and constructs user maps by number.
  2. Account Ownership & Access Control:

    • Each user map is bound to its creator (owner_account_id).
    • Only the owner (or admin/moderator) can edit, propose, or delete the map.
    • Unauthorized attempts by other players return a clear forbidden/unauthorized error.
    • Draft maps remain private and inaccessible to non-owners.
  3. Configurable Account Quotas:

    • Configurable quotas in user_map_quotas:
      • max_maps (default 5 active maps per account)
      • max_npcs_per_map (default 20 NPCs per map)
      • max_objs_per_map (default 50 objects per map)
      • max_storage_bytes (default 5 MB per map)
    • Exceeding any quota returns an explicit error message.
  4. Economy Isolation:

    • Strict validation preventing user maps from placing currency (gold coin item 12, direct gold piles) or prohibited official keys/high-tier assets.
    • NPCs placed in user maps cannot grant gold or official economy drops.
    • Default allowCombat: false and allowExp: false prevents user maps from functioning as private XP/gold farming exploits.
  5. World Isolation:

    • Portals / tile exits in user maps are strictly forbidden from targeting official world maps (1–500), preventing unauthorized backdoors into official towns or dungeons.
  6. Automated Tests:

    • Comprehensive test suite in api/src/tests/userMaps.test.ts verifying:
      • Automatic map_num allocation in reserved range
      • Official map protection (tampering rejection)
      • Portal world isolation
      • Economy isolation (currency and drop exploit rejection)
      • Ownership authorization and edit prevention
      • Quota enforcement (max maps, NPCs, objects, storage)
      • Complete moderation and reporting lifecycle

All unit tests passing (11/11).

Vishal Maurya added 2 commits September 10, 2026 00:59
…itcoindefi#25)

- Implemented state lifecycle: draft -> proposed -> in_review -> published | rejected
- Added automated pre-moderation filter (banned words, reachability BFS, entity quotas)
- Added moderation queue with map preview data for reviewers without playing
- Added mandatory rejection reasons delivered to map owners
- Added report mechanism moving published maps back to in_review
- Added unpublish capability for active maps
- Added comprehensive unit and integration test suite
…as (closes Bitcoindefi#24)

- Defined reserved user map ID range [100,000 - 999,999] in frontend/utils/gameLoader.ts and API without colliding with official maps (1-500), static maps (500-599), challenges (2,000-29,999), or dynamic instances (30,000-99,999)
- Enforced strict account ownership (only owner can modify/delete; unauthorized edits blocked)
- Implemented configurable quotas: max maps per account, max NPCs/objects per map, and storage byte limits
- Enforced economy isolation preventing placement of currency (gold coins), high-tier keys, unauthorized loot items, or XP/gold drops
- Enforced world isolation preventing exits/portals from breaching official world maps
- Added client user map loader and routing by map number
- Added comprehensive unit and integration test suite covering ownership protection, quota limits, and economic isolation
@gitar-bot

gitar-bot Bot commented Sep 9, 2026

Copy link
Copy Markdown

Important

You are using the Gitar free plan. Upgrade to unlock code review, CI analysis, auto-apply, custom automations, and more.

Gitar

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.

Etapa 5: espacio aislado de mapas de usuario con propiedad y cuotas

1 participant