fix(admin): RRO blob switch works for rooms with no RoomScenes row

The seeded Rec Royale rows carry no RoomScenes at all ("Scenes 0"), so the
Sub-rooms tab listed nothing and blob/enable would have 404'd. The admin
list now synthesises the same virtual "Home" entry scene the game-client
details builder does (isVirtual: true, max players = room capacity),
blob/enable creates the real row with the game-side defaults
(RoomsController.GetOrCreateSceneForMutationAsync), and blob/reset copes
with a missing row. Max-players save is disabled on the virtual row.
Test: Room_without_scene_rows_gets_a_virtual_entry_scene_and_enable_creates_it.
This commit is contained in:
Alexa
2026-09-27 23:02:40 +03:00
parent 258183fb94
commit 36c5dd5ca9
4 changed files with 127 additions and 14 deletions
+5 -1
View File
@@ -568,6 +568,9 @@ interface SubRoom {
* with no blob enabled (scene geometry only, no Maker Pen / chips). */
effectiveBlobName: string;
isBakedOriginal: boolean;
/** No RoomScenes row exists yet (seeded baked originals); the entry
* scene is synthesised on read and created by "Enable Maker Pen blob". */
isVirtual?: boolean;
}
// Per-sub-room player caps. Distinct from the room's own MaxCapacity, which is
@@ -718,8 +721,9 @@ function SubRoomsTab({ roomId, roomCapacity }: { roomId: number; roomCapacity: n
/>
<button
onClick={() => save(sub)}
disabled={!dirty || saving === sub.subRoomId}
disabled={!dirty || saving === sub.subRoomId || sub.isVirtual}
className="btn-primary text-xs"
title={sub.isVirtual ? 'This room has no sub-room row yet — enable the blob first' : undefined}
>
{saving === sub.subRoomId ? 'Saving…' : 'Save'}
</button>