SendJoinRoom() public méthode

public SendJoinRoom ( Room room ) : void
room RohBot.Rooms.Room
Résultat void
Exemple #1
0
        public void Add(Connection connection)
        {
            List <string> rooms;
            bool          firstConnection;

            lock (_sync)
            {
                if (_connections.Contains(connection))
                {
                    return;
                }

                _connections.Add(connection);

                connection.Session = this;
                rooms = _rooms.ToList();

                firstConnection  = _firstConnection;
                _firstConnection = false;
            }

            foreach (var roomName in rooms)
            {
                var room = Program.RoomManager.Get(roomName);
                if (room == null)
                {
                    continue;
                }

                connection.SendJoinRoom(room);

                if (firstConnection)
                {
                    room.SessionEnter(this);
                }
            }
        }
Exemple #2
0
        public void Add(Connection connection)
        {
            List<string> rooms;
            bool firstConnection;

            lock (_sync)
            {
                if (_connections.Contains(connection))
                    return;

                _connections.Add(connection);

                connection.Session = this;
                rooms = _rooms.ToList();

                firstConnection = _firstConnection;
                _firstConnection = false;
            }

            foreach (var roomName in rooms)
            {
                var room = Program.RoomManager.Get(roomName);
                if (room == null)
                    continue;

                connection.SendJoinRoom(room);

                if (firstConnection)
                    room.SessionEnter(this);
            }
        }