T5 products placed in ordinary IMVU rooms, kept per room instance
(room_decoration, migration 0006). GET /api/v1/decorations/:instance (and
?instances= for up to 20) gives what the viewer may see, with a hash;
PUT is for the room owner's T5DE person only, checks the products exist,
and tells every realtime session with a chat in that room ({"type":
"decor"}). Hosted rooms' IDs are refused.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
2a1fc94df6
commit
f65f36c1ea
12 files changed
+2325
-6
No files matched your search
@@ -0,0 +1,8 @@
|
||||
CREATE TABLE "room_decoration" (
|
||||
"instance_id" text PRIMARY KEY NOT NULL,
|
||||
"owner_imvu_id" bigint NOT NULL,
|
||||
"contents" jsonb NOT NULL,
|
||||
"updated_at" timestamp with time zone DEFAULT now() NOT NULL
|
||||
);
|
||||
--> statement-breakpoint
|
||||
CREATE INDEX "room_decoration_owner" ON "room_decoration" USING btree ("owner_imvu_id");
|
||||
File diff suppressed because it is too large.
Load diff
@@ -43,6 +43,13 @@
|
||||
"when": 1793355138984,
|
||||
"tag": "0005_hosted_rooms",
|
||||
"breakpoints": true
|
||||
},
|
||||
{
|
||||
"idx": 6,
|
||||
"version": "7",
|
||||
"when": 1793357692630,
|
||||
"tag": "0006_decorations",
|
||||
"breakpoints": true
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -11,7 +11,7 @@ import { fileURLToPath } from "node:url";
|
||||
import * as schema from "./schema";
|
||||
|
||||
export { schema };
|
||||
export type { FileEntry, ParentInfo, SceneItem } from "./schema";
|
||||
export type { DecorationItem, FileEntry, ParentInfo, SceneItem } from "./schema";
|
||||
export * from "drizzle-orm";
|
||||
|
||||
const migrationsFolder = fileURLToPath(new URL("../drizzle", import.meta.url));
|
||||
|
||||
@@ -361,3 +361,22 @@ export const hostedRoom = pgTable(
|
||||
},
|
||||
(t) => [index("hosted_room_owner").on(t.ownerId), index("hosted_room_created").on(t.createdAt)],
|
||||
);
|
||||
|
||||
// ---- Decorations over IMVU rooms (docs/products.md, "Decorations") ----
|
||||
|
||||
/** A decoration: [furniture instance ID, hub product ID, placement], as the client's room_contents. */
|
||||
export type DecorationItem = [number, string, string];
|
||||
|
||||
// T5 products placed in an IMVU room by its owner. IMVU keeps the room without them (T5DE's proxy strips them from
|
||||
// what the client saves); the proxies of T5DE users in the room add them back. Hosted rooms keep theirs in
|
||||
// hosted_room.scene instead.
|
||||
export const roomDecoration = pgTable(
|
||||
"room_decoration",
|
||||
{
|
||||
instanceId: text("instance_id").primaryKey(), // IMVU's room instance, "<owner>-<n>"
|
||||
ownerImvuId: bigint("owner_imvu_id", { mode: "number" }).notNull(), // the number before the dash
|
||||
contents: jsonb("contents").$type<DecorationItem[]>().notNull(),
|
||||
updatedAt: updatedAt(),
|
||||
},
|
||||
(t) => [index("room_decoration_owner").on(t.ownerImvuId)],
|
||||
);
|
||||
Reference in new issue
Block a user