示例#1
0
        public List <Room> GetAllRooms()
        {
            return(Operation(() =>
            {
                CheckIsUserAuthenticated();

                var rooms = serverManager.GetAllRooms().ToList();
                rooms.RemoveAll(r =>
                {
                    if (!r.IsRoomEmpty())
                    {
                        return false;
                    }

                    NotifyUsersOfRoomChange(r, RoomUpdate.Closed);

                    return true;
                });

                return rooms;
            }));
        }