rex_firebase_rooms
Plugin, ACE table, Discussion thread
Dependence: rex_firebase_apiV3
Dependence: rex_firebase_apiV3
Introduction
Rooms on firebase.
Rooms on firebase.
Concept
This plugin maintains many "rooms" on firebase, each user could be belong a room.
This plugin maintains many "rooms" on firebase, each user could be belong a room.
Setup
Call "Action:Set my info" to set user name and user ID of current user before create or join a room.
Read current user name and user ID back by "Expression:UserName", "Expression:UserID" under "My" category.
Call "Action:Set my info" to set user name and user ID of current user before create or join a room.
Read current user name and user ID back by "Expression:UserName", "Expression:UserID" under "My" category.
Create a room
Call "Action:Create" to
Get room ID and room name of triggered room by "Expression:TriggeredRoomName", "Expression:TriggeredRoomID"
"Condition:On join" or "Condition:On join error" will also be fired while join the created room.
Call "Action:Create" to
- Create a room, or
- Leave current room, then create or join a room
Get room ID and room name of triggered room by "Expression:TriggeredRoomName", "Expression:TriggeredRoomID"
"Condition:On join" or "Condition:On join error" will also be fired while join the created room.
Room name
Parameter "Name" is a display name of this room.
Parameter "Name" is a display name of this room.
Room type
Parameter "Type" is a tag of this room, which is used in "Action:Update", see the "Rooms list" section.
Parameter "Type" is a tag of this room, which is used in "Action:Update", see the "Rooms list" section.
Maximum peers
Parameter "Max peers" is the maximum amount of users in this room. Set it to 0 for unlimited.
Parameter "Max peers" is the maximum amount of users in this room. Set it to 0 for unlimited.
Life period
Set parameter "Life period" to "Temporary" to create a temporary room, which will be destroy when creator left.
Set it to "Persisted" to create a persisted room.
Set parameter "Life period" to "Temporary" to create a temporary room, which will be destroy when creator left.
Set it to "Persisted" to create a persisted room.
Door state
Parameter "Door state" is used to set the initial room state to open or closed.
A possible use case of closed room is
Parameter "Door state" is used to set the initial room state to open or closed.
A possible use case of closed room is
- Create a closed room.
- Initial data of this room.
- Open this room by "Action:Open", see the "Door state" section.
Room ID
Room ID is an unique ID of a room for joining, or assign a roomID for a specific room.
Room ID is an unique ID of a room for joining, or assign a roomID for a specific room.
Join a room
Call "Action:Join" to
"Condition:On join" will be triggered while joining a room success, otherwise "Condition:On join error" will be triggered. Get room ID and room name of triggered room by "Expression:TriggeredRoomName", "Expression:TriggeredRoomID".
Call "Action:Join" to
- Join a room, or
- Leave current room then join a room
"Condition:On join" will be triggered while joining a room success, otherwise "Condition:On join error" will be triggered. Get room ID and room name of triggered room by "Expression:TriggeredRoomName", "Expression:TriggeredRoomID".
Join random room
Sample capx
Call "Action:Join random" to pick a random room from current rooms list (see next section), then join into this room.
Sample capx
Call "Action:Join random" to pick a random room from current rooms list (see next section), then join into this room.
Rooms list
Call "Action:Update" under "Rooms list" category will start listen rooms list changing automatically. "Condition:On update" under "Rooms list" will be triggered when a room created or removed.
Stop updating by "Action:Stop updating" under "Rooms list" category.
Call "Action:Update" under "Rooms list" category will start listen rooms list changing automatically. "Condition:On update" under "Rooms list" will be triggered when a room created or removed.
Stop updating by "Action:Stop updating" under "Rooms list" category.
Retrieve rooms
Uses "Condition:For each room" to travel all monitored rooms, get each room name and room ID by "Expression:CurRoomName", "Expression:CurRoomID".
Or get room name, room ID from index by "Expression:RoomIndex2Name", "Expression:RoomIndex2ID". Amount of opened rooms by "Expression:RoomsCount".
Uses "Condition:For each room" to travel all monitored rooms, get each room name and room ID by "Expression:CurRoomName", "Expression:CurRoomID".
Or get room name, room ID from index by "Expression:RoomIndex2Name", "Expression:RoomIndex2ID". Amount of opened rooms by "Expression:RoomsCount".
Users list
"Condition:On user joined", "Condition:On user left" will be triggered when a user has joined or left current room, get that joined or left user by "Expression:TriggeredUserName", "Expression:TriggeredUserID".
And "Condition:On update" under "Users list" category will also be triggered,
"Condition:On user joined", "Condition:On user left" will be triggered when a user has joined or left current room, get that joined or left user by "Expression:TriggeredUserName", "Expression:TriggeredUserID".
And "Condition:On update" under "Users list" category will also be triggered,
Retrieve users
Uses "Condition:For each user" and "Expression:CurUserName", "Expression:CurUserID" to get each user name, user ID of users in current room.
Also, get user name, user ID from index by "Expression:Index2UserName", "Expression:Index2UserID". Amount of users in current rooms by "Expression:UsersCount".
Uses "Condition:For each user" and "Expression:CurUserName", "Expression:CurUserID" to get each user name, user ID of users in current room.
Also, get user name, user ID from index by "Expression:Index2UserName", "Expression:Index2UserID". Amount of users in current rooms by "Expression:UsersCount".
First user
"Condition:On become first user" will be triggered while user became the first one in users list of current room, or ""Condition:I am first user" returns true in the same condition.
There is only one "first user" of a room, like rex_firebase_token plugin does.
"Condition:On become first user" will be triggered while user became the first one in users list of current room, or ""Condition:I am first user" returns true in the same condition.
There is only one "first user" of a room, like rex_firebase_token plugin does.
Kick user
Call "Action:Kick user" to kick user by userID.
Call "Action:Kick user" to kick user by userID.
Door state - open or close room
Set property "Door control" to "Auto" to close the room when room is full. Open the door when user left.
Set it to "Manual" will keep the door opened, However, user still could not join the room if room is full.
User also could open or close the room by "Action:Open".
Set property "Door control" to "Auto" to close the room when room is full. Open the door when user left.
Set it to "Manual" will keep the door opened, However, user still could not join the room if room is full.
User also could open or close the room by "Action:Open".
Permission lists
There are two possible permission lists, black-list and white-list -
There are two possible permission lists, black-list and white-list -
- UserID in black-list will be banned.
- UserID in white-list will be allowed to join.
Add or remove user
Add or user into black-list or white-list by "Action:Add". Remove from list by "Action:Remove".
Add or user into black-list or white-list by "Action:Add". Remove from list by "Action:Remove".
Get permission list
Call "Action:Get metadata" to get permission lists. "Condition:On receive metadata" will be trigger when get the list.
Call "Action:Get metadata" to get permission lists. "Condition:On receive metadata" will be trigger when get the list.
Retrieve permission list
Uses "Condition:For each user" in category "Permission list" and "Expression:CurUserName", "Expression:CurUserID" to retrieve each user in the white or black list.
Or dump the list by "Expression:WhiteListToJSON" or"Expression:BlackListToJSON".
Uses "Condition:For each user" in category "Permission list" and "Expression:CurUserName", "Expression:CurUserID" to retrieve each user in the white or black list.
Or dump the list by "Expression:WhiteListToJSON" or"Expression:BlackListToJSON".
Reference path
Get reference path for other rex_firebase_xxx plugins by "Expression:ChannelRef"
Get reference path for other rex_firebase_xxx plugins by "Expression:ChannelRef"
- Expression:ChannelRef : get reference path of room.
- Expression:ChannelRef ( channel_name ) : get reference path of a channel in current room. it is equal to
reference_path_of_room + "\channel-" + channel_name + "\"
Chat message
Use rex_firebase_simplemessage plugin to build a broadcast message channel. The reference path of message in current room is got by "Expression:ChannelRef".
Use rex_firebase_simplemessage plugin to build a broadcast message channel. The reference path of message in current room is got by "Expression:ChannelRef".