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
@@ -38,6 +38,9 @@ export const ExplorationPanel = (): React.JSX.Element => {
const zoneAreas = EXPLORATION_AREAS.filter((a) => a.zoneId === activeZoneId);
const hasActiveExploration =
explorationState?.areas.some((a) => a.status === "in_progress") ?? false;
const handleStart = async (areaId: string): Promise<void> => {
setPendingAreaId(areaId);
try {
@@ -137,8 +140,9 @@ export const ExplorationPanel = (): React.JSX.Element => {
{status === "available" && (
<button
className="start-quest-button"
disabled={isPending}
disabled={isPending || hasActiveExploration}
onClick={() => { void handleStart(area.id); }}
title={hasActiveExploration ? "An exploration is already in progress" : undefined}
type="button"
>
{isPending ? "Departing..." : `Explore (${formatDuration(area.durationSeconds)})`}