new connectionRoomObj()
This is a gateway object connecting connections to the rooms they are in.
Members
-
<static> connectionRoomObj.events
-
Expose all event functions
-
<static> connectionRoomObj.util
-
Expose all utility functions
Methods
-
<static> connectionRoomObj.emitRoomDataDelta(isLeavingRoom, callback)
-
Emits the roomData message with a clientListDelta for the current connection to other connections in the same room.
Parameters:
Name Type Description isLeavingRoom
boolean Is connection leaving the room? callback
function Callback with error and room data delta object. -
<static> connectionRoomObj.generateRoomDataDelta(isLeavingRoom, callback)
-
Generated the roomData[room] message with a clientListDelta for the current connection to other connections in the same room.
Parameters:
Name Type Description isLeavingRoom
boolean Is connection leaving the room? callback
function Callback with error and room data delta object. -
<static> connectionRoomObj.getApp() → {Object}
-
Returns the application object to which the connection belongs. Note that unlike most EasyRTC functions, this returns a value and does not use a callback.
Returns:
The application object- Type
- Object
-
<static> connectionRoomObj.getAppName() → {string}
-
Returns the application name for the application to which the connection belongs. Note that unlike most EasyRTC functions, this returns a value and does not use a callback.
Returns:
The application name- Type
- string
-
<static> connectionRoomObj.getConnection() → {Object}
-
Returns the connection object to which the connection belongs. Note that unlike most EasyRTC functions, this returns a value and does not use a callback.
Returns:
The application object- Type
- Object
-
<static> connectionRoomObj.getRoom() → {Object}
-
Returns the room object to which the connection belongs. Note that unlike most EasyRTC functions, this returns a value and does not use a callback.
Returns:
The room object- Type
- Object
-
<static> connectionRoomObj.getRoomName() → {string}
-
Returns the room name to which the connection belongs. Note that unlike most EasyRTC functions, this returns a value and does not use a callback.
Returns:
The room name- Type
- string
-
<static> connectionRoomObj.leaveRoom(next)
-
Leaves the current room. Any room variables will be lost.
Parameters:
Name Type Argument Description next
nextCallback <optional>
A success callback of form next(err). -
<static> connectionRoomObj.setApiField(apiFieldObj, next)
-
Sets the API field for the current connection in a room.
Parameters:
Name Type Description apiFieldObj
object A API field object, including the field name and field value. next
nextCallback A success callback of form next(err).