decentraland / decentraland/unity-explorer
Worlds: Explorer does not report position to Archipelago, causing inconsistent Places API user counts
- Dominant language
- C#
- Stars
- 23
- Forks
- 17
- Avg merge
- 2d 14h
- Merged PRs (30d)
- 94
Description
## Problem
When a user enters a DCL World, the Explorer does **not** send position heartbeats to Archipelago. This means World users never appear in `archipelago-ea-stats.decentraland.org/comms/peers`, which causes the Places API to return inconsistent `user_count` data.
**Two concrete symptoms:**
1. Users actively in a World are **not counted** in that World's Places API entry.
2. Users who were previously in Genesis City and then moved to a World may still appear in the Genesis City parcels endpoint with **stale/outdated position data** until their entry expires.
## Root cause
The Explorer forks on the realm's `comms.adapter` string in `ForkGlobalRealmRoom.cs`:
- `wss://` → instantiates `ArchipelagoIslandRoom` → sends position heartbeats every 1s via `LiveConnectionArchipelagoSignFlow.SendHeartbeatAsync()` → peers appear in `archipelago-ea-stats`
- `https://` → instantiates `FixedConnectiveRoom` → **no position heartbeat at all**, only reconnects on LiveKit drop
Worlds always advertise `fixed-adapter:signed-login:https://worlds.decentraland.org/worlds//comms`, so they always take the `FixedConnectiveRoom` path.
**Relevant files:**
- `Explorer/Assets/DCL/Multiplayer/Connections/Archipelago/Rooms/ForkGlobalRealmRoom.cs` — the fork logic
- `Explorer/Assets/DCL/Multiplayer/Connections/Rooms/Connective/ConnectiveRoom.cs` — `HEARTBEATS_INTERVAL = 1s` loop
- `Explorer/Assets/DCL/Multiplayer/Connections/Archipelago/Rooms/ArchipelagoIslandRoom.cs` — sends heartbeats (Genesis City only)
- `Explorer/Assets/DCL/Multiplayer/Connections/Archipelago/SignFlow/LiveConnectionArchipelagoSignFlow.cs` — `SendHeartbeatAsync()`
**Downstream data pipeline affected:**
```
archipelago-ea-stats /comms/peers & /parcels
→ realm-provider /hot-scenes
→ places API user_count per place (polled every 1 min)
```
## Expected behavior
Users in a World should have their position reported to Archipelago (or an equivalent stats endpoint), so that the Places API reflects accurate real-time user counts for Worlds.
## Notes
- This is not a regression in the Worlds comms path itself (LiveKit rooms work correctly for avatar sync). The gap is specifically in the position-reporting pipeline that feeds Places.
- A fix could live in the Explorer (send heartbeats for `FixedConnectiveRoom` too), in `worlds-content-server` (expose a `/stats/parcels` endpoint aggregated from LiveKit room metadata), or in `realm-provider` (query Worlds stats separately). The right approach needs coordination with the Archipelago/Places teams.
Contributor guide
Assessment
This issue has not been assessed yet.