mirror of
https://git.eden-emu.dev/eden-emu/eden.git
synced 2025-10-05 15:52:45 +02:00
fixes airplane mode for local files and specific nifm call
This commit is contained in:
@@ -428,7 +428,8 @@ private:
|
||||
LOG_WARNING(Service_NIFM, "(STUBBED) called");
|
||||
|
||||
const auto result = [this] {
|
||||
const auto has_connection = Network::GetHostIPv4Address().has_value();
|
||||
const auto has_connection = Network::GetHostIPv4Address().has_value() &&
|
||||
!Settings::values.airplane_mode.GetValue();
|
||||
switch (state) {
|
||||
case RequestState::NotSubmitted:
|
||||
return has_connection ? ResultSuccess : ResultNetworkCommunicationDisabled;
|
||||
@@ -947,7 +948,7 @@ void IGeneralService::IsEthernetCommunicationEnabled(HLERequestContext& ctx) {
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 3};
|
||||
rb.Push(ResultSuccess);
|
||||
if (Network::GetHostIPv4Address().has_value()) {
|
||||
if (Network::GetHostIPv4Address().has_value() && !Settings::values.airplane_mode.GetValue()) {
|
||||
rb.Push<u8>(1);
|
||||
} else {
|
||||
rb.Push<u8>(0);
|
||||
@@ -959,7 +960,7 @@ void IGeneralService::IsAnyInternetRequestAccepted(HLERequestContext& ctx) {
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 3};
|
||||
rb.Push(ResultSuccess);
|
||||
if (Network::GetHostIPv4Address().has_value()) {
|
||||
if (Network::GetHostIPv4Address().has_value() && !Settings::values.airplane_mode.GetValue()) {
|
||||
rb.Push<u8>(1);
|
||||
} else {
|
||||
rb.Push<u8>(0);
|
||||
|
@@ -491,11 +491,6 @@ void BSD::ExecuteWork(HLERequestContext& ctx, Work work) {
|
||||
|
||||
std::pair<s32, Errno> BSD::SocketImpl(Domain domain, Type type, Protocol protocol) {
|
||||
|
||||
if (Settings::values.airplane_mode.GetValue()) {
|
||||
LOG_ERROR(Service, "Airplane mode is enabled, cannot create socket");
|
||||
return {-1, Errno::NOTCONN};
|
||||
}
|
||||
|
||||
if (type == Type::SEQPACKET) {
|
||||
UNIMPLEMENTED_MSG("SOCK_SEQPACKET errno management");
|
||||
} else if (type == Type::RAW && (domain != Domain::INET || protocol != Protocol::ICMP)) {
|
||||
@@ -528,6 +523,11 @@ std::pair<s32, Errno> BSD::SocketImpl(Domain domain, Type type, Protocol protoco
|
||||
descriptor.socket->Initialize(Translate(domain), Translate(type), Translate(protocol));
|
||||
descriptor.is_connection_based = IsConnectionBased(type);
|
||||
|
||||
if (Settings::values.airplane_mode.GetValue() && descriptor.is_connection_based) {
|
||||
LOG_ERROR(Service, "Airplane mode is enabled, cannot create socket");
|
||||
return {-1, Errno::NOTCONN};
|
||||
}
|
||||
|
||||
return {fd, Errno::SUCCESS};
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user