new TrappedRoomManager()

Default implementation of a TrappedRoomManager.


Default implementation of a TrappedRoomManager.

A TrappedRoomManager manages access to properties of proxied rooms. It acts as a combined proxy for any number of proxied rooms.

Properties are divided into two categories by the RoomTrapper:

  • event handlers (all properties starting with "on"), must be functions
  • all other properties

This default implementation keeps a list of event handlers for each trapped room and forwards any access to other properties straight to the proxied room.

Trapped room managers must implement the following methods:

  • onEventHandlerGet(room, handler, identifier)
  • onEventHandlerHas(room, handler, identifier)
  • onEventHandlerSet(room, handler, callback, identifier)
  • onEventHandlerUnset(room, handler, identifier)
  • onOwnHandlerDescriptorGet(room, handler, identifier)
  • onExecuteEventHandlers(room, handler, ...args)
  • onPropertyGet(room, property, identifier)
  • onPropertyHas(room, property, identifier)
  • onPropertySet(room, property, value, identifier)
  • onPropertyUnset(room, property, identifier)
  • onOwnPropertyDescriptorGet(room, prop, identifier)
  • onOwnPropertyNamesGet(room, identifier)