Add a client to a room.
516932
def enter_room(self, sid, namespace, room):
        """"""
        if namespace not in self.rooms:
            self.rooms[namespace] = {}
        if room not in self.rooms[namespace]:
            self.rooms[namespace][room] = {}
        self.rooms[namespace][room][sid] = True
665017
function createCmdButton(cmd, label, forceCheckbox, className) {
        var button;
        button = document.createElement('button');
        button.className = className || 'btn';
        button.innerHTML = label;
        button.onclick = function() {
            var cl;
            var clients, doLogic;
            cl = node.game.clientList;
            // Get selected clients.
            clients = cl.getSelectedClients();
            if (!clients || clients.length === 0) return;
            // If the room's logic client is selected, handle it specially.
            if (node.game.roomLogicId) {
                doLogic = J.removeElement(cl.roomLogicId, clients);
            }

            node.socket.send(node.msg.create({
                target: 'SERVERCOMMAND',
                text:   'ROOMCOMMAND',
                data: {
                    type:    cmd,
                    roomId:  cl.roomId,
                    doLogic: !!doLogic,
                    clients: clients,
                    force:   forceCheckbox.checked
                }
            }));
        };

        return button;
    }
1007850
def update_room(self, stream_id, room_definition):
        '''  '''
        req_hook = 'pod/v2/room/' + str(stream_id) + '/update'
        req_args = json.dumps(room_definition)
        status_code, response = self.__rest__.POST_query(req_hook, req_args)
        self.logger.debug('%s: %s' % (status_code, response))
        return status_code, response
972923
def publishToMyself(self, roomId, name, data):
        
        self.publishToRoom(roomId, name, data, [self])
327565
def send(self, data, room=None, include_self=True, namespace=None,
             callback=None):
        """"""
        return self.socketio.send(data, room=room, include_self=include_self,
                                  namespace=namespace or self.namespace,
                                  callback=callback)
1160509
def rooms_upload(self, rid, file, **kwargs):
        """"""
        files = {
            'file': (os.path.basename(file), open(file, 'rb'), mimetypes.guess_type(file)[0]),
        }
        return self.__call_api_post('rooms.upload/' + rid, kwargs=kwargs, use_json=False, files=files)
639260
def welcome(self, user):
        
        self.send_message(create_message('RoomServer', 'Please welcome {name} to the server!\nThere are currently {i} users online -\n {r}\n'.format(name=user.id, 
                          i=self.amount_of_users_connected, 
                          r=' '.join(self.user_names))))
        logging.debug('Welcoming user {user} to {room}'.format(user=user.id.name, room=self.name))
25551
def room(id, &callback)
      http(:get, "/room/#{id}.json") do |data, http|
        Firering::Room.instantiate(self, data, :room, &callback)
      end
    end
1084658
def update_room_from_obj(settings, vc_room, room_obj):
    """"""
    vc_room.name = room_obj.name
    if room_obj.ownerName != vc_room.data['owner_identity']:
        owner = get_user_from_identifier(settings, room_obj.ownerName) or User.get_system_user()
        vc_room.vidyo_extension.owned_by_user = owner

    vc_room.data.update({
        'description': room_obj.description,
        'vidyo_id': unicode(room_obj.roomID),
        'url': room_obj.RoomMode.roomURL,
        'owner_identity': room_obj.ownerName,
        'room_pin': room_obj.RoomMode.roomPIN if room_obj.RoomMode.hasPIN else "",
        'moderation_pin': room_obj.RoomMode.moderatorPIN if room_obj.RoomMode.hasModeratorPIN else "",
    })
    vc_room.vidyo_extension.extension = int(room_obj.extension)
333396
def send(self, data, room=None, skip_sid=None, namespace=None,
             callback=None):
        
        return self.server.send(data, room=room, skip_sid=skip_sid,
                                namespace=namespace or self.namespace,
                                callback=callback)
553130
public ResponseWrapper addChatRoomMember(long roomId, Members members)
            throws APIConnectionException, APIRequestException {
        return _chatRoomClient.addChatRoomMember(roomId, members);
    }
945643
def on_get(self, request, response, room_alias=None):
        """"""
        response.body = "{}"
        if self.handler(room_alias):
            response.status = falcon.HTTP_200
            self.api.create_room(alias=room_alias)
        else:
            response.status = falcon.HTTP_404
507825
def listen(room):
    """"""
    def onmessage(m):
        """Print the new message and respond to it."""
        print(m)
        if m.admin or m.nick == r.user.name:
            return
        if "parrot" in m.msg.lower():
            r.post_chat("ayy lmao")
        elif m.msg.lower() in ("lol", "lel", "kek"):
            r.post_chat("*kok")
        else:
            r.post_chat(re.sub(r"\blain\b", "purpleadmin", m.msg, re.I))

    with Room(room) as r:
        r.user.change_nick("DumbParrot")
        r.add_listener("chat", onmessage)
        r.listen()
667171
def on_invite(self, data):
        
        if not self._nick:
            self._nick = self.boundjid.user

        # Join the room
        self.plugin["xep_0045"].joinMUC(data["from"], self._nick)
670977
def add(self, client):
        """"""
        if client.pool_id in self._client_ids:
            log.info("%r is already in the penalty box. Ignoring.", client)
            return
        release = time.time() + self._min_wait
        heapq.heappush(self._clients, (release, (client, self._min_wait)))
        self._client_ids.add(client.pool_id)
843757
def publishToRoom(self, roomId, name, data, userList=None):
        
        if userList is None:
            userList = self.getRoom(roomId)

        # Publish data to all room users
        logging.debug("%s: broadcasting (name: %s, data: %s, number of users: %s)" % (self._gcls(), name, data, len(userList)))
        self.broadcast(userList, {
            "name": name,
            "data": SockJSRoomHandler._parser.encode(data)
        })
1058455
protected function bindRoom(): void
    {
        $this->app->bind(RoomContract::class, function (App $app) {
            $config = $app->make('config');
            $room   = $config->get('swoole.websocket.room', []);

            $className = Arr::pull($room, 'type', TableRoom::class);

            // create room instance and initialize
            $room = $this->createRoom($className, $room);
            $room->prepare();

            return $room;
        });

        $this->app->bind('swoole.room', RoomContract::class);
    }