feat: limit players to one active exploration at a time

Server-side: check if any area is already in_progress before allowing
a new exploration to start. Client-side: derive hasActiveExploration
from the full areas list and disable all Explore buttons (with a
tooltip) whilst another area is underway. Closes #9.
This commit is contained in:
2026-03-07 12:06:21 -08:00
committed by Naomi Carrigan
parent 01146a4999
commit 58e7000954
2 changed files with 8 additions and 3 deletions
+3 -2
View File
@@ -75,8 +75,9 @@ exploreRouter.post("/start", async (context) => {
return context.json({ error: "Exploration area not found in state" }, 404);
}
if (area.status === "in_progress") {
return context.json({ error: "Exploration already in progress" }, 400);
const anyInProgress = state.exploration.areas.some((a) => a.status === "in_progress");
if (anyInProgress) {
return context.json({ error: "An exploration is already in progress" }, 400);
}
if (area.status === "locked") {