mirror of
https://git.eden-emu.dev/eden-emu/eden.git
synced 2026-08-28 09:41:36 +00:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| f0b82e6033 | |||
| ed5976afda |
@@ -262,6 +262,13 @@ void AndroidConfig::SavePathValues() {
|
||||
}
|
||||
EndArray();
|
||||
|
||||
BeginArray(std::string("blocked_domains"));
|
||||
for (size_t i = 0; i < Settings::values.blocked_domains.size(); ++i) {
|
||||
SetArrayIndex(i);
|
||||
WriteStringSetting(std::string("domain"), Settings::values.blocked_domains[i]);
|
||||
}
|
||||
EndArray();
|
||||
|
||||
// Save custom NAND directory
|
||||
const auto nand_path = Common::FS::GetEdenPathString(Common::FS::EdenPath::NANDDir);
|
||||
WriteStringSetting(std::string("nand_directory"), nand_path,
|
||||
|
||||
@@ -803,9 +803,16 @@ struct Values {
|
||||
Setting<bool> first_launch{linkage, true, "first_launch", Category::Miscellaneous};
|
||||
|
||||
// Network
|
||||
Setting<std::string> network_interface{linkage, std::string(), "network_interface",
|
||||
Category::Network};
|
||||
Setting<std::string> network_interface{linkage, std::string(), "network_interface", Category::Network};
|
||||
SwitchableSetting<bool> airplane_mode{linkage, false, "airplane_mode", Category::Network};
|
||||
std::vector<std::string> blocked_domains = {
|
||||
"srv.nintendo.net",
|
||||
"battle.net",
|
||||
"microsoft.com",
|
||||
"mojang.com",
|
||||
"xboxlive.com",
|
||||
"minecraftservices.com"
|
||||
};
|
||||
|
||||
// WebService
|
||||
Setting<std::string> web_api_url{linkage, "api.ynet-fun.xyz", "web_api_url",
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
|
||||
@@ -8,6 +8,7 @@
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
#include "common/settings.h"
|
||||
#include "common/string_util.h"
|
||||
#include "common/swap.h"
|
||||
#include "core/core.h"
|
||||
@@ -53,17 +54,11 @@ enum class NetDbError : s32 {
|
||||
NoData = 4,
|
||||
};
|
||||
|
||||
static const constexpr std::array blockedDomains = {"srv.nintendo.net",
|
||||
"battle.net",
|
||||
"microsoft.com",
|
||||
"mojang.com",
|
||||
"xboxlive.com",
|
||||
"minecraftservices.com"};
|
||||
|
||||
static bool IsBlockedHost(const std::string& host) {
|
||||
return std::any_of(
|
||||
blockedDomains.begin(), blockedDomains.end(),
|
||||
[&host](const std::string& domain) { return host.find(domain) != std::string::npos; });
|
||||
auto const& v = Settings::values.blocked_domains;
|
||||
return std::any_of(v.begin(), v.end(), [&host](const std::string& domain) {
|
||||
return host.find(domain) != std::string::npos;
|
||||
});
|
||||
}
|
||||
|
||||
static NetDbError GetAddrInfoErrorToNetDbError(GetAddrInfoError result) {
|
||||
@@ -163,7 +158,17 @@ static std::pair<u32, GetAddrInfoError> GetHostByNameRequestImpl(HLERequestConte
|
||||
parameters.use_nsd_resolve, parameters.cancel_handle, parameters.process_id);
|
||||
|
||||
const auto host_buffer = ctx.ReadBuffer(0);
|
||||
const std::string host = Common::StringFromBuffer(host_buffer);
|
||||
|
||||
std::string host = Common::StringFromBuffer(host_buffer);
|
||||
if (parameters.use_nsd_resolve) {
|
||||
// TODO: how its actually done?
|
||||
if (auto const pos = host.find('%'); pos != std::string::npos) {
|
||||
host[pos] = 'l';
|
||||
host.insert(pos, "p1");
|
||||
}
|
||||
LOG_WARNING(Service, "nsd resolve={}", host);
|
||||
}
|
||||
|
||||
// For now, ignore options, which are in input buffer 1 for GetHostByNameRequestWithOptions.
|
||||
|
||||
// Prevent resolution of Nintendo servers
|
||||
|
||||
@@ -241,6 +241,16 @@ void QtConfig::ReadPathValues() {
|
||||
}
|
||||
EndArray();
|
||||
|
||||
Settings::values.blocked_domains.clear();
|
||||
const int blocked_domains_size = BeginArray(std::string("blocked_domains"));
|
||||
for (int i = 0; i < blocked_domains_size; ++i) {
|
||||
SetArrayIndex(i);
|
||||
if (auto s = ReadStringSetting(std::string("domain")); !s.empty()) {
|
||||
Settings::values.blocked_domains.push_back(s);
|
||||
}
|
||||
}
|
||||
EndArray();
|
||||
|
||||
ReadCategory(Settings::Category::Paths);
|
||||
|
||||
EndGroup();
|
||||
@@ -463,6 +473,13 @@ void QtConfig::SavePathValues() {
|
||||
}
|
||||
EndArray();
|
||||
|
||||
BeginArray(std::string("blocked_domains"));
|
||||
for (int i = 0; i < static_cast<int>(Settings::values.blocked_domains.size()); ++i) {
|
||||
SetArrayIndex(i);
|
||||
WriteStringSetting(std::string("domain"), Settings::values.blocked_domains[i]);
|
||||
}
|
||||
EndArray();
|
||||
|
||||
EndGroup();
|
||||
}
|
||||
|
||||
|
||||
@@ -2096,23 +2096,21 @@ ImageView::ImageView(TextureCacheRuntime& runtime, const VideoCommon::ImageViewI
|
||||
samples(ConvertSampleCount(image.info.num_samples)) {
|
||||
using Shader::TextureType;
|
||||
|
||||
const VkImageAspectFlags view_aspect_mask = ImageViewAspectMask(info);
|
||||
this->aspect_mask = view_aspect_mask;
|
||||
std::array<SwizzleSource, 4> view_swizzle{
|
||||
const VkImageAspectFlags aspect_mask = ImageViewAspectMask(info);
|
||||
std::array<SwizzleSource, 4> swizzle{
|
||||
SwizzleSource::R,
|
||||
SwizzleSource::G,
|
||||
SwizzleSource::B,
|
||||
SwizzleSource::A,
|
||||
};
|
||||
if (!info.IsRenderTarget()) {
|
||||
view_swizzle = info.Swizzle();
|
||||
TryTransformSwizzleIfNeeded(format, view_swizzle,
|
||||
swizzle = info.Swizzle();
|
||||
TryTransformSwizzleIfNeeded(format, swizzle,
|
||||
!device->IsExt4444FormatsSupported());
|
||||
if ((view_aspect_mask & (VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT)) != 0) {
|
||||
std::ranges::transform(view_swizzle, view_swizzle.begin(), ConvertGreenRed);
|
||||
if ((aspect_mask & (VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT)) != 0) {
|
||||
std::ranges::transform(swizzle, swizzle.begin(), ConvertGreenRed);
|
||||
}
|
||||
}
|
||||
this->swizzle = view_swizzle;
|
||||
const auto format_info = MaxwellToVK::SurfaceFormat(*device, FormatType::Optimal, true, format);
|
||||
if (ImageUsageFlags(format_info, format) != image.UsageFlags()) {
|
||||
LOG_WARNING(Render_Vulkan,
|
||||
@@ -2132,12 +2130,12 @@ ImageView::ImageView(TextureCacheRuntime& runtime, const VideoCommon::ImageViewI
|
||||
.viewType = VkImageViewType{},
|
||||
.format = format_info.format,
|
||||
.components{
|
||||
.r = ComponentSwizzle(view_swizzle[0]),
|
||||
.g = ComponentSwizzle(view_swizzle[1]),
|
||||
.b = ComponentSwizzle(view_swizzle[2]),
|
||||
.a = ComponentSwizzle(view_swizzle[3]),
|
||||
.r = ComponentSwizzle(swizzle[0]),
|
||||
.g = ComponentSwizzle(swizzle[1]),
|
||||
.b = ComponentSwizzle(swizzle[2]),
|
||||
.a = ComponentSwizzle(swizzle[3]),
|
||||
},
|
||||
.subresourceRange = MakeSubresourceRange(view_aspect_mask, info.range),
|
||||
.subresourceRange = MakeSubresourceRange(aspect_mask, info.range),
|
||||
};
|
||||
const auto create = [&](TextureType tex_type, std::optional<u32> num_layers) {
|
||||
VkImageViewCreateInfo ci{create_info};
|
||||
@@ -2193,8 +2191,6 @@ ImageView::ImageView(TextureCacheRuntime& runtime, const VideoCommon::ImageInfo&
|
||||
|
||||
ImageView::ImageView(TextureCacheRuntime& runtime, const VideoCommon::NullImageViewParams& params)
|
||||
: VideoCommon::ImageViewBase{params}, device{&runtime.device} {
|
||||
swizzle = {SwizzleSource::R, SwizzleSource::G, SwizzleSource::B, SwizzleSource::A};
|
||||
aspect_mask = VK_IMAGE_ASPECT_COLOR_BIT;
|
||||
if (device->HasNullDescriptor()) {
|
||||
return;
|
||||
}
|
||||
@@ -2251,13 +2247,7 @@ VkImageView ImageView::StorageView(Shader::TextureType texture_type,
|
||||
Shader::ImageFormat image_format) {
|
||||
if (image_handle) {
|
||||
if (image_format == Shader::ImageFormat::Typeless) {
|
||||
auto& view = identity_views[static_cast<size_t>(texture_type)];
|
||||
if (!view) {
|
||||
const auto format_info =
|
||||
MaxwellToVK::SurfaceFormat(*device, FormatType::Optimal, true, format);
|
||||
view = MakeView(format_info.format, aspect_mask);
|
||||
}
|
||||
return *view;
|
||||
return Handle(texture_type);
|
||||
}
|
||||
const bool is_signed = image_format == Shader::ImageFormat::R8_SINT
|
||||
|| image_format == Shader::ImageFormat::R16_SINT;
|
||||
@@ -2276,7 +2266,7 @@ bool ImageView::IsRescaled() const noexcept {
|
||||
return (*slot_images)[image_id].IsRescaled();
|
||||
}
|
||||
|
||||
vk::ImageView ImageView::MakeView(VkFormat vk_format, VkImageAspectFlags view_aspect_mask) {
|
||||
vk::ImageView ImageView::MakeView(VkFormat vk_format, VkImageAspectFlags aspect_mask) {
|
||||
return device->GetLogical().CreateImageView({
|
||||
.sType = VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO,
|
||||
.pNext = nullptr,
|
||||
@@ -2290,7 +2280,7 @@ vk::ImageView ImageView::MakeView(VkFormat vk_format, VkImageAspectFlags view_as
|
||||
.b = VK_COMPONENT_SWIZZLE_IDENTITY,
|
||||
.a = VK_COMPONENT_SWIZZLE_IDENTITY,
|
||||
},
|
||||
.subresourceRange = MakeSubresourceRange(view_aspect_mask, range),
|
||||
.subresourceRange = MakeSubresourceRange(aspect_mask, range),
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -17,8 +17,6 @@
|
||||
#include "video_core/vulkan_common/vulkan_memory_allocator.h"
|
||||
#include "video_core/vulkan_common/vulkan_wrapper.h"
|
||||
|
||||
#include "video_core/textures/texture.h"
|
||||
|
||||
namespace Settings {
|
||||
struct ResolutionScalingInfo;
|
||||
}
|
||||
@@ -381,9 +379,6 @@ private:
|
||||
const SlotVector<Image>* slot_images = nullptr;
|
||||
|
||||
std::array<vk::ImageView, Shader::NUM_TEXTURE_TYPES> image_views;
|
||||
std::array<vk::ImageView, Shader::NUM_TEXTURE_TYPES> identity_views;
|
||||
std::array<Tegra::Texture::SwizzleSource, 4> swizzle;
|
||||
VkImageAspectFlags aspect_mask;
|
||||
std::optional<StorageViews> storage_views;
|
||||
vk::ImageView depth_view;
|
||||
vk::ImageView stencil_view;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
// SPDX-FileCopyrightText: Copyright 2019 yuzu Emulator Project
|
||||
@@ -10,6 +10,7 @@
|
||||
#include "core/internal_network/network_interface.h"
|
||||
#include "ui_configure_network.h"
|
||||
#include "yuzu/configuration/configure_network.h"
|
||||
#include "yuzu/util/limitable_input_dialog.h"
|
||||
|
||||
ConfigureNetwork::ConfigureNetwork(const Core::System& system_, QWidget* parent)
|
||||
: QWidget(parent), ui(std::make_unique<Ui::ConfigureNetwork>()), system{system_} {
|
||||
@@ -20,6 +21,26 @@ ConfigureNetwork::ConfigureNetwork(const Core::System& system_, QWidget* parent)
|
||||
ui->network_interface->addItem(QString::fromStdString(iface.name));
|
||||
}
|
||||
|
||||
ui->blocked_domains_list->clear();
|
||||
for (const auto& s : Settings::values.blocked_domains) {
|
||||
ui->blocked_domains_list->addItem(QString::fromStdString(s));
|
||||
}
|
||||
|
||||
connect(ui->add_blocked_domains_button, &QPushButton::pressed, this, [this, parent] {
|
||||
if (const QString s = LimitableInputDialog::GetText(parent, tr("Add blocked domain"), tr("Input DNS match rule"), 0, 64); !s.isEmpty()) {
|
||||
ui->blocked_domains_list->addItem(s);
|
||||
}
|
||||
});
|
||||
connect(ui->remove_blocked_domains_button, &QPushButton::pressed, this, [this] {
|
||||
auto selected = ui->blocked_domains_list->selectedItems();
|
||||
if (!selected.isEmpty()) {
|
||||
qDeleteAll(ui->blocked_domains_list->selectedItems());
|
||||
}
|
||||
});
|
||||
connect(ui->blocked_domains_list, &QListWidget::itemSelectionChanged, this, [this] {
|
||||
ui->remove_blocked_domains_button->setEnabled(!ui->blocked_domains_list->selectedItems().isEmpty());
|
||||
});
|
||||
|
||||
this->SetConfiguration();
|
||||
}
|
||||
|
||||
@@ -28,8 +49,24 @@ ConfigureNetwork::~ConfigureNetwork() = default;
|
||||
void ConfigureNetwork::ApplyConfiguration() {
|
||||
Settings::values.network_interface = ui->network_interface->currentText().toStdString();
|
||||
Settings::values.airplane_mode = ui->airplane_mode->isChecked();
|
||||
|
||||
std::vector<std::string> new_dirs;
|
||||
new_dirs.reserve(ui->blocked_domains_list->count());
|
||||
for (int i = 0; i < ui->blocked_domains_list->count(); ++i) {
|
||||
new_dirs.push_back(ui->blocked_domains_list->item(i)->text().toStdString());
|
||||
}
|
||||
if (new_dirs != Settings::values.blocked_domains) {
|
||||
Settings::values.blocked_domains = std::move(new_dirs);
|
||||
}
|
||||
}
|
||||
|
||||
// void ConfigureGeneral::UpdateExternalContentList() {
|
||||
// ui->blocked_domains_list->clear();
|
||||
// for (const auto& dir : Settings::values.blocked_domains) {
|
||||
// ui->blocked_domains_list->addItem(QString::fromStdString(dir));
|
||||
// }
|
||||
// }
|
||||
|
||||
void ConfigureNetwork::changeEvent(QEvent* event) {
|
||||
if (event->type() == QEvent::LanguageChange) {
|
||||
RetranslateUI();
|
||||
|
||||
@@ -45,6 +45,66 @@
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox_blocked_domains">
|
||||
<property name="title">
|
||||
<string>Blocked Domains Content</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_blocked_domains">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_blocked_domains_desc">
|
||||
<property name="text">
|
||||
<string>Add domains to filter out on DNS resolutions</string>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QListWidget" name="blocked_domains_list">
|
||||
<property name="selectionMode">
|
||||
<enum>QAbstractItemView::SingleSelection</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_blocked_domains_buttons">
|
||||
<item>
|
||||
<widget class="QPushButton" name="add_blocked_domains_button">
|
||||
<property name="text">
|
||||
<string>Add Domain</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="remove_blocked_domains_button">
|
||||
<property name="text">
|
||||
<string>Remove Selected</string>
|
||||
</property>
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_blocked_domains">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
|
||||
Reference in New Issue
Block a user