import type { RoomClass } from './runtime'; /** * The locally-registered room classes, keyed by room name. This is the source * the CLIENT decoder is built from (brief decision: no Reflection handshake — * the client derives its `@colyseus/schema` state class from the same room * class the host holds). Both the loopback client path and the host runtime * register here, so a co-located client always resolves the decoder root. */ const rooms = new Map(); export function registerLoopbackRoom(roomName: string, roomClass: RoomClass): void { rooms.set(roomName, roomClass); } export function getRegisteredRoom(roomName: string): RoomClass | undefined { return rooms.get(roomName); } export function registeredRoomNames(): string[] { return [...rooms.keys()]; }